Assignment 2
Assignment 2
The logis c func on, also known as the sigmoid func on, is used in logis c regression to compute
probabili es. It maps any input value to a value between 0 and 1, which can be interpreted as the
probability of the input belonging to a certain class.
2. The criterion commonly used to split nodes in decision tree construc on is the informa on gain. It
is calculated by subtrac ng the weighted average of the entropy of the child nodes from the entropy
of the parent node.
3. Entropy is a measure of impurity in a set of examples. Informa on gain is the reduc on in entropy
achieved by par oning the examples based on a certain a ribute. In decision tree construc on, the
a ribute with the highest informa on gain is chosen as the spli ng criterion.
4. The random forest algorithm u lizes bagging and feature randomiza on to improve classifica on
accuracy. Bagging involves training mul ple decision trees on different subsets of the training data,
while feature randomiza on involves randomly selec ng a subset of features for each tree.
5. The distance metric typically used in k-nearest neighbors (KNN) classifica on is the Euclidean
distance. It measures the straight-line distance between two points in a mul dimensional space. The
choice of distance metric can impact the algorithm's performance.
6. The Naïve-Bayes assump on of feature independence assumes that the features used for
classifica on are condi onally independent given the class label. This assump on simplifies the
computa on of the posterior probability of a class given a set of features.
7. The kernel func on in SVMs is used to transform the input data into a higher-dimensional space
where it is easier to separate the classes. Some commonly used kernel func ons include the linear
kernel, polynomial kernel, and radial basis func on (RBF) kernel.
8. The bias-variance tradeoff refers to the tradeoff between model complexity and overfi ng. A
model with high bias (e.g., a linear model) may underfit the data, while a model with high variance
(e.g., a complex model) may overfit the data. The goal is to find a model with an appropriate balance
between bias and variance.
9. TensorFlow facilitates the crea on and training of neural networks by providing a high-level API for
building and training models. It also includes a variety of pre-built neural network layers and
ac va on func ons.
10. Cross-valida on is a technique used to evaluate model performance by par oning the data into
training and valida on sets. It involves training the model on mul ple subsets of the data and
evalua ng its performance on the remaining subset. Cross-valida on is important for detec ng
overfi ng and selec ng the best model.
11. Techniques that can be employed to handle overfi ng in machine learning models include
regulariza on, early stopping, and dropout. Regulariza on involves adding a penalty term to the loss
func on to discourage overfi ng, while early stopping involves stopping the training process when
the valida on error stops improving. Dropout involves randomly dropping out some neurons during
training to prevent over-reliance on certain features.
12. The purpose of regulariza on in machine learning is to prevent overfi ng by adding a penalty
term to the loss func on. The penalty term encourages the model to have smaller weights, which
can help prevent over-reliance on certain features.
13. Hyper-parameters are parameters that are set before training the model and cannot be learned
from the data. They include parameters such as the learning rate, regulariza on strength, and
number of hidden layers in a neural network. Hyper-parameters are tuned for op mal performance
using techniques such as grid search or random search.
14. Precision and recall are metrics used to evaluate the performance of a classifica on model.
Precision measures the propor on of true posi ves among all posi ve predic ons, while recall
measures the propor on of true posi ves among all actual posi ves. Accuracy measures the
propor on of correct predic ons among all predic ons.
15. The ROC curve is a graphical representa on of the performance of a binary classifier. It plots the
true posi ve rate (TPR) against the false posi ve rate (FPR) for different threshold values. The area
under the ROC curve (AUC) is a commonly used metric for evalua ng the performance of a binary
classifier.