machine learning Flashcards

1
Q

what is accuracy?

A

correct prediction/ total

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

what is precision?

A

TP/(TP+FP)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

what is recall?

A

TP/TP+FP

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

what is ROC AUC?

A

ROC curve: receiver operating characteristic curve - plot of TPR (yaxis) and FPR (xaxis) help decide best threshold
AUC: area under the curve higher better help see which categorisation is better

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

what is entropy?

A

sum(pxlog(1/px))

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What does linear regression solve?

A

Used for regression problems

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How does linear regression work?

A

It works by fitting a linear equation to observed data. The steps to perform linear regression are:
- First, the sum of squared residuals is calculated.
- Then, this sum is minimized to find the best fit line.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

what are the parameters of linear regression?

A
  • fit_intercept: Whether to calculate the intercept for this model. If set to False, no intercept will be used in calculations.
  • normalize: This parameter is ignored when - - fit_intercept is set to False. If True, the regressors X will be normalized before regression by subtracting the mean and dividing by the l2-norm.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What does Naive Bayes solve?

A

classification problems

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

How does Naive Bayes work?

A

It works based on Bayes’ theorem with the assumption of independence between every pair of features. Naive Bayes classifiers work well in many real-world situations such as document classification and spam filtering.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What are the parameters of NB?

A
  • priors: Prior probabilities of the classes. If specified the priors are not adjusted according to the data.
  • var_smoothing: Portion of the largest variance of all features that is added to variances for calculation stability.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What does SVM solve?

A

regression and classification problems

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

How does SVM work?

A

It works by finding a hyperplane in an N-dimensional space(N — the number of features) that distinctly classifies the data points.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What are the parameters in SVM?

A
  • C: Regularization parameter. The strength of the regularization is inversely proportional to C. Must be strictly positive. Larger C –> narrower margin as it penalise wrong classification more.
    - kernel: Specifies the kernel type to be used in the algorithm. It could be ‘linear’, ‘poly’, ‘rbf’, ‘sigmoid’, ‘precomputed’ or a callable.
    - degree: Degree of the polynomial kernel function (‘poly’). Ignored by all other kernels.
    - gamma: Kernel coefficient for ‘rbf’, ‘poly’ and ‘sigmoid’.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is Logistic Regression used for?

A

binary classification problems

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

How does Logistic regression work?

A

It works by using a logistic function to model a binary dependent variable.

17
Q

What are the parameters of Logistic Regression?

A
  • penalty: Used to specify the norm used in the penalization. The ‘newton-cg’, ‘sag’ and ‘lbfgs’ solvers support only l2 penalties. ‘elasticnet’ is only supported by the ‘saga’ solver.
    - C: Inverse of regularization strength; must be a positive float. Like in support vector machines, smaller values specify stronger regularization.
    - fit_intercept: Specifies if a constant (a.k.a. bias or intercept) should be added to the decision function.
18
Q

What is K-Means used for?

A

clustering problems

19
Q

How does K-Means work?

A

It works by partitioning n observations into k clusters in which each observation belongs to the cluster with the nearest mean, serving as a prototype of the cluster.

20
Q

What are the parameters of K-Means?

A
  • n_clusters: The number of clusters to form as well as the number of centroids to generate.
    - init: Method for initialization, defaults to ‘k-means++’.
    - n_init: Number of time the k-means algorithm will be run with different centroid seeds.
21
Q

What is DBSCAN used for?

A

clustering problems

22
Q

What is the mechanism of DBSCAN?

A

It works by defining a cluster as a maximal set of density-connected points. It discovers clusters of arbitrary shape in spatial databases with noise.

23
Q

What are the parameters of DBSCAN?

A
  • eps: The maximum distance between two samples for one to be considered as in the neighborhood of the other.
    - min_samples: The number of samples (or total weight) in a neighborhood for a point to be considered as a core point.
24
Q

What is baggin and boosting used for?

A

both regression and classification problems

25
Q

What is mechanism of bagging and boosting?

A

Bagging works by creating subsets of the original dataset, fitting a model to each subset, and then combining the predictions. Boosting works by fitting a model to the data, then fitting additional models to the residuals of the initial model, and then combining the predictions.

26
Q

What is random forest used for?

A

Used for both regression and classification problems.

27
Q

How does Random Forest work?

A

It works by creating a multitude of decision trees at training time and outputting the class that is the mode of the classes (classification) or mean prediction (regression) of the individual trees.

28
Q

What are parameters of random forest?

A
  • n_estimators: The number of trees in the forest.
    - max_features: The number of features to consider when looking for the best split.
    - max_depth: The maximum depth of the tree.
29
Q

What is decision trees used for?

A

Regresssion and classification problems

30
Q

how does decision trees work?

A

Decision trees split the data into multiple sets. These splits are based on certain conditions, which is why decision trees are also known as Classification and Regression Trees (CART). This process continues on each derived subset in a recursive manner called recursive partitioning.

31
Q

What are the parameters of decision trees?

A

max_depth: The maximum depth of the tree. This parameter controls over-fitting. Too high value can lead to overfitting and too low value can lead to underfitting.
min_samples_split: The minimum number of samples required to split an internal node. This parameter prevents overfitting. Higher values prevent a model from learning relations which might be highly specific to the particular sample selected for a tree.
min_samples_leaf: The minimum number of samples required to be at a leaf node. This parameter also prevents overfitting similar to min_samples_split.

32
Q

What is Support vector regression (SVR) used for?

A

regression problems.

33
Q

How does SVR work?

A

In SVR, we identify a hyperplane with maximum margin such that the maximum number of data points are within that margin. SVR tries to minimize the error within a certain threshold.

34
Q

What are the parameters of SVR?

A

C: The Regularization parameter. The strength of the regularization is inversely proportional to C. Must be strictly positive.
kernel: Specifies the kernel type to be used in the algorithm. It could be ‘linear’, ‘poly’, ‘rbf’, ‘sigmoid’, ‘precomputed’ or a callable.
degree: Degree of the polynomial kernel function (‘poly’). Ignored by all other kernels.
gamma: Kernel coefficient for ‘rbf’, ‘poly’ and ‘sigmoid’.

35
Q
A