Web Tech 2 and Data Anlaytics Notes
Web Tech 2 and Data Anlaytics Notes
if ($_SERVER["REQUEST_METHOD"] == "POST") {
echo "Hello, " . $_POST['name'];
}
8. Sticky Forms (Example)
Sticky forms retain user input after submission.
Example:
<form method="POST">
Name: <input type="text" name="name" value="<?php echo
isset($_POST['name']) ? $_POST['name'] : ''; ?>">
<input type="submit">
</form>
if ($_FILES) {
move_uploaded_file($_FILES["file"]["tmp_name"], "uploads/" .
$_FILES["file"]["name"]);
echo "File uploaded!";
}
< <
> >
& &
' '
" "
Example:
<message>3 < 5 is true</message>
Modification Yes No
$student = $dom->createElement("student");
$student->setAttribute("id", "101");
$name = $dom->createElement("name", "John");
$student->appendChild($name);
$root->appendChild($student);
echo $dom->saveXML();
$parser = xml_parser_create();
xml_set_element_handler($parser, "startElement", NULL);
$xml = "<note><to>John</to></note>";
xml_parse($parser, $xml);
xml_parser_free($parser);
2. What is data analytics? Enlist its different roles. Also, state its
advantages and disadvantages.
Definition:
Data Analytics is the process of analysing raw data to identify
patterns, trends, and useful information.
Roles in Data Analytics:
• Data Engineer – Prepares and processes data.
• Data Analyst – Examines data to generate insights.
• Data Scientist – Develops predictive and machine learning
models.
• Business Analyst – Uses data for business strategy and
decision-making.
Advantages:
Improves decision-making.
Helps detect fraud and anomalies.
Enhances customer experience.
Disadvantages:
Requires high computational resources.
Can lead to biased results if not handled properly.
Positive TP FN
Negative FP TN
y_true = [0, 0, 1, 1]
y_scores = [0.1, 0.4, 0.35, 0.8]
fpr, tpr, _ = roc_curve(y_true, y_scores)
plt.plot(fpr, tpr)
plt.xlabel('False Positive Rate')
plt.ylabel('True Positive Rate')
plt.title('ROC Curve')
plt.show()
Small labeled
Environment-
Data Labeled Unlabeled + Large
based
unlabeled
Maximize
Predict Find hidden Learn with
Goal cumulative
outcomes patterns minimal labels
reward
Semi-
Supervised Unsupervised Reinforcement
Feature Supervised
Learning Learning Learning
Learning