machine learning Flashcards

1
Q

What are model performance metrics?

A

Performance metrics offer various perspectives on the model’s performance, allowing data scientists to choose appropriate evaluation criteria based on project objectives.

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

What is Ridge Regularization?

A

Ridge Regularization (L2) modifies overfitted or underfitted models by adding a penalty equal to the sum of the squares of the coefficients.

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

What does Ridge Regression aim to achieve?

A

Ridge Regression aims to reduce model complexity while keeping all predictors in the model.

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

What does the loss function in Ridge Regression consist of?

A

The loss function consists of the residual sum of squares (RSS) and a penalty term controlled by λ.

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

What is the effect of a larger λ in Ridge Regression?

A

A larger λ forces the coefficients to shrink more.

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

What is Lasso Regularization?

A

Lasso Regularization (L1) prevents overfitting by adding a penalty term that penalizes the sum of the absolute values of the model’s coefficients.

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

What is the main benefit of Lasso Regularization?

A

Lasso Regularization reduces overfitting by promoting sparsity and implicitly performing feature selection.

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

How does Lasso Regularization affect coefficients?

A

Lasso can shrink some coefficients to exactly zero, simplifying the model by excluding some features altogether.

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

What is Elastic Net?

A

Elastic Net is a hybrid method that combines both Ridge and Lasso penalties.

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

When is Elastic Net particularly useful?

A

Elastic Net is useful when there are many correlated predictors.

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

What are the three main types of regularization techniques?

A
  • Ridge Regularization (L2) * Lasso Regularization (L1) * Elastic Net (Hybrid Model)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is the purpose of regularization techniques?

A

Regularization techniques are used to prevent overfitting and improve model performance.

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

What is the confusion matrix?

A

A confusion matrix is a table used to describe the performance of a classification model on a set of test data.

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

What does accuracy measure?

A

Accuracy measures the proportion of correct predictions among the total number of cases examined.

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

What is precision in classification metrics?

A

Precision is the ratio of true positive predictions to the total positive predictions.

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

What is recall in classification metrics?

A

Recall is the ratio of true positive predictions to the actual positives in the data.

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

What is the F1 Score?

A

The F1 Score is the harmonic mean of precision and recall, providing a balance between the two.

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

What does high bias indicate?

A

High bias indicates that the model is unable to learn the patterns in the data, leading to underfitting.

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

What does high variance indicate?

A

High variance indicates that the model learns noise from the training data, leading to overfitting.

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

What is the role of regularization in bias and variance?

A

Regularization techniques help to balance between bias and variance.

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

What is logistic regression used for?

A

Logistic regression is used for predicting a categorical dependent variable using independent variables.

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

How does logistic regression differ from linear regression?

A

Logistic regression predicts probabilities for categorical outcomes, while linear regression predicts continuous values.

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

What is the sigmoid function?

A

The sigmoid function maps predicted values to probabilities between 0 and 1, forming an S-shaped curve.

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

What are the three types of logistic regression?

A
  • Binomial * Multinomial * Ordinal
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Q

What is a key step in logistic regression modeling?

A

Define the problem by identifying the dependent and independent variables.

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

What is the purpose of exploratory data analysis (EDA) in logistic regression?

A

EDA visualizes relationships between variables and identifies outliers or anomalies.

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

What is overfitting?

A

Overfitting occurs when a model performs well on training data but fails to generalize to new, unseen data.

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

What are key indicators of overfitting?

A
  • High training accuracy but low test accuracy * High variance * Model complexity
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
29
Q

What are methods to avoid overfitting?

A
  • Simplify the model * Apply regularization * Use cross-validation * Use ensemble methods * Increase training data
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
30
Q

What is overfitting?

A

Overfitting occurs when a model learns specific details of the training data, leading to poor generalization on new data.

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

What can help a model generalize better?

A

Increasing training data can help a model generalize better by exposing it to diverse patterns.

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

What does ROC-AUC stand for?

A

Receiver Operating Characteristic - Area Under Curve.

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

What does the AUC value represent?

A

AUC represents the likelihood of the model distinguishing between positive and negative classes.

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

What is a confusion matrix?

A

A confusion matrix is a table showing the actual vs. predicted classifications.

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

What do TN, TP, FP, and FN stand for in a confusion matrix?

A
  • TN - True Negatives
  • TP - True Positives
  • FP - False Positives
  • FN - False Negatives
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
36
Q

How is accuracy defined?

A

Accuracy is defined as the ratio of the number of correct predictions to the total number of predictions.

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

What is R-squared (R²)?

A

R-squared measures how well a statistical model predicts an outcome, with values between 0 and 1.

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

What does an R-squared value of 0.81 indicate?

A

It indicates that the input variables explain 81% of the variation in the output variable.

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

What is Adjusted R-squared?

A

Adjusted R-squared adjusts R-squared based on the number of predictors in the model, penalizing for irrelevant variables.

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

What are common techniques of feature engineering?

A
  • Handling missing values
  • Categorical encoding
  • Feature scaling
  • Feature creation
  • Dimensionality reduction
  • Variable transformations
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
41
Q

What is feature selection?

A

Feature selection focuses on choosing a subset of the most relevant features from the available ones.

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

What are filter methods in feature selection?

A

Filter methods use statistical tests to score features based on their correlation with the target variable.

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

What is the purpose of using regularization techniques?

A

Regularization techniques reduce overfitting and help in feature selection by penalizing irrelevant features.

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

What is the Mean Absolute Error (MAE)?

A

MAE is the average of the absolute errors between predicted and actual values.

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

What does RMSE stand for?

A

Root Mean Squared Error.

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

How is RMSE calculated?

A

RMSE is calculated as the square root of the mean squared error (MSE).

47
Q

What does precision measure?

A

Precision measures the ratio of true positives to the sum of true positives and false positives.

48
Q

What is recall also known as?

A

Recall is also known as sensitivity.

49
Q

What is specificity?

A

Specificity is the ratio of true negatives to the sum of true negatives and false positives.

50
Q

What does log loss measure?

A

Log loss measures the performance of a classification model where the prediction is a probability value.

51
Q

What is the F1-score?

A

F1-score is the harmonic mean of precision and recall.

52
Q

What does AUC-ROC stand for?

A

Area Under The Curve - Receiver Operating Characteristics.

53
Q

What is the formula for Mean Squared Error (MSE)?

A

MSE = Σ(y_i - p_i)² / n.

54
Q

What is logistic regression used for?

A

Logistic regression is used to predict a binary output variable.

55
Q

Fill in the blank: The output variable in logistic regression is transformed using a _______ function.

56
Q

True or False: A model with an AUC score of 0.5 is considered perfect.

57
Q

What happens to R-squared when irrelevant variables are added?

A

R-squared either stays the same or increases, even if the new variables do not relate to the output variable.

58
Q

What is logistic regression?

A

A type of classification algorithm used to predict a binary output variable.

59
Q

In logistic regression, what does the output variable get transformed into?

A

A probability value between 0 and 1.

60
Q

What is Random Forest?

A

An ensemble technique capable of performing both regression and classification tasks using multiple decision trees.

61
Q

What technique is commonly known as bagging?

A

Bootstrap and Aggregation.

62
Q

What is the basic idea behind Random Forest?

A

To combine multiple decision trees in determining the final output.

63
Q

What is the first step in building a decision tree?

A

Select the root node based on which feature best splits the data.

64
Q

What does a confusion matrix show?

A

Counts of true positives (TP), false positives (FP), true negatives (TN), and false negatives (FN).

65
Q

What is Support Vector Regression (SVR)?

A

A type of support vector machine used for both classification and regression tasks.

66
Q

What is the principle behind K-Nearest Neighbors (KNN)?

A

The predicted label is determined by the labels of its k nearest neighbors.

67
Q

What type of learning does KNN represent?

A

Instance-based learning.

68
Q

What is the purpose of choosing the right K value in KNN?

A

To improve prediction accuracy and avoid underfitting or overfitting.

69
Q

What is the formula for linear regression?

A

y = θx + b.

70
Q

What does the term ‘overfitting’ refer to in linear regression?

A

When a model learns detail and noise in the training data, performing poorly on new data.

71
Q

What is polynomial regression used for?

A

To model a non-linear relationship between the dependent variable and independent variables.

72
Q

What is the general syntax of polynomial regression?

A

y = β₀ + β₁x + β₂x² + β₃x³ + … + β_dx^d + ϵ.

73
Q

What does the term ‘bias’ refer to in linear regression?

A

The y-intercept (b), the value of y when x is zero.

74
Q

What is a key characteristic of K-Nearest Neighbors (KNN)?

A

It performs computations only when making predictions.

75
Q

What is a Decision Tree Classifier?

A

A supervised learning algorithm that splits the dataset into subsets based on feature values.

76
Q

What are the major objectives of supervised learning?

A
  • Prediction
  • Generalization
  • Optimization
  • Evaluation
77
Q

What is the definition of classification in machine learning?

A

A supervised learning task where the goal is to assign a label to an input based on learned patterns.

78
Q

What are the types of classification?

A
  • Binary Classification
  • Multiclass Classification
  • Multilabel Classification
79
Q

What is the purpose of model evaluation in supervised learning?

A

To assess model performance using appropriate evaluation metrics.

80
Q

What is the role of feature selection in the workflow of a classification model?

A

To identify relevant features.

81
Q

What does ‘lazy learning’ mean in the context of KNN?

A

KNN doesn’t explicitly build a model during the training phase.

82
Q

What is a common challenge in classification tasks?

A

Overfitting and underfitting.

83
Q

What is the main goal of regression analysis?

A

To understand the relationship between one dependent variable and one or more independent variables.

84
Q

What are some major types of regression techniques?

A
  • Linear Regression
  • Polynomial Regression
  • Decision Tree Regression
  • Random Forest Regression
  • Support Vector Regression
  • Ridge Regression
  • Lasso Regression
  • ElasticNet Regression
  • Bayesian Linear Regression
85
Q

What is the main focus of linear regression?

A

To model the relationship between a scalar response and multiple predictors.

86
Q

What does the ‘degree of the polynomial’ indicate in polynomial regression?

A

The highest power of x.

87
Q

Fill in the blank: A small K in KNN can lead to _______.

A

overfitting.

88
Q

Fill in the blank: A large K in KNN can lead to _______.

A

underfitting.

89
Q

True or False: KNN uses a model to predict values during the training phase.

90
Q

What is the formula for a polynomial regression model?

A

y = β₀ + β₁x + β₂x² + β₃x³ + … + β_dx^d + ϵ

Here, βᵢ are the coefficients, d is the degree of the polynomial, and ϵ is the error term.

91
Q

What does the degree (d) in polynomial regression determine?

A

The complexity of the relationship being modeled

Higher degrees can capture more intricate curves but also risk overfitting.

92
Q

What is the goal of polynomial regression?

A

To find the values for β that minimize the error term (ϵ) and provide the best fit for the data.

93
Q

What is linear regression characterized by?

A

d = 1

This is essentially standard linear regression.

94
Q

What type of relationship does quadratic regression (d = 2) model?

A

U-shaped or inverted U-shaped relationships.

95
Q

What is the defining feature of cubic regression (d = 3)?

A

It can capture more complex S-shaped curves.

96
Q

What is a key characteristic of higher-order polynomials (d > 3)?

A

They can be used for very intricate relationships but are prone to overfitting.

97
Q

What is regression analysis?

A

A statistical process for estimating the relationships between dependent and independent variables.

98
Q

When is regression analysis typically used?

A

When dealing with a dataset that has the target variable in the form of continuous data.

99
Q

What does a decision tree represent?

A

A flowchart-like tree structure for classification and prediction.

100
Q

What does each internal node in a decision tree denote?

A

A test on an attribute.

101
Q

What is a Naïve Bayes classifier based on?

A

Bayes’ Theorem

It is primarily used for classification tasks.

102
Q

What is the key assumption of the Naïve Bayes algorithm?

A

Features are independent of each other.

103
Q

What are the main applications of Naïve Bayes classifiers?

A
  • Spam filtering
  • Sentiment analysis
  • Document classification
  • Medical diagnosis
104
Q

What does Gaussian Naïve Bayes assume about features?

A

They follow a normal distribution.

105
Q

What is Multinomial Naïve Bayes used for?

A

Text classification (e.g., bag-of-words model).

106
Q

What type of data does Bernoulli Naïve Bayes handle?

A

Binary feature data (e.g., presence or absence of a word in a document).

107
Q

In regression, what is the target variable?

A

A continuous value.

108
Q

What is the goal of classification?

A

To predict the class or category of the target variable based on input variables.

109
Q

What are some examples of regression algorithms?

A
  • Linear regression
  • Polynomial regression
  • Decision trees
110
Q

What are examples of classification algorithms?

A
  • Logistic regression
  • Decision trees
  • Support vector machines
  • Neural networks
111
Q

Fill in the blank: A regression problem is when the output variable is a _______.

A

real or continuous value.

112
Q

Fill in the blank: A decision tree can be used to predict a _______ outcome.

A

continuous.

113
Q

True or False: Naïve Bayes is a non-parametric method.