ML

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/95

encourage image

There's no tags or description

Looks like no tags are added yet.

96 Terms

1
New cards

Machine learning

Learning patterns from data to make predictions on new examples.

2
New cards

Traditional programming vs ML

Traditional programming follows human-written rules. ML learns patterns from examples.

3
New cards

ML for complex problems

Useful when patterns are too complicated to describe with fixed rules.

4
New cards

Sample, feature, target

Sample = one data row; feature = input information; target = correct output.

5
New cards

Supervised learning

Learning from labeled examples with known answers.

6
New cards

Unsupervised learning

Finding patterns or groups in data without labels.

7
New cards

Semi-supervised learning

Learning from a few labeled examples and many unlabeled examples.

8
New cards

Classification

Predicting a category, such as approved or rejected.

9
New cards

Regression

Predicting a numerical value, such as a house price.

10
New cards

Tom Mitchell's T, E, P

T = task; E = experience or training data; P = performance measure.

11
New cards

T/E/P example: Spam detection

Task = classify spam; Experience = labeled emails; Performance = accuracy or F1 score.

12
New cards

Data preparation

Cleaning and transforming data so models can learn meaningful patterns.

13
New cards

Data quality problems

Missing values, duplicates, invalid entries, outliers and inconsistent labels.

14
New cards

Data inconsistency

Different labels for the same thing, such as US, USA and United States.

15
New cards

Numerical imputation

Replacing missing numbers with the mean or median.

16
New cards

Mean, median and mode

Mean = average; median = middle value; mode = most frequent value. Median resists outliers.

17
New cards

Outlier

A value unusually far from most observations. Investigate before removing it.

18
New cards

Min-Max normalization

Rescaling values, usually to 0–1. Formula: (x − min)/(max − min).

19
New cards

Standardization

Rescaling a feature to have mean 0 and standard deviation 1.

20
New cards

One-hot encoding

Turning categories into separate binary 0/1 columns.

21
New cards

Ordinal encoding

Assigning numbers to ordered categories, such as small, medium and large.

22
New cards

Feature selection vs extraction

Selection keeps useful original features; extraction creates new features.

23
New cards

Exploratory Data Analysis (EDA)

Using summaries and plots to understand data before training.

24
New cards

EDA charts

Histogram = distribution; boxplot = spread/outliers; scatter = relationship; bar = categories.

25
New cards

Data leakage

Information from validation or test data influences training. Fit preprocessing on training data only.

26
New cards

Training set

Data used to learn model parameters.

27
New cards

Validation set

Data used to compare models and choose settings.

28
New cards

Test set

Untouched data used for final evaluation on unseen examples.

29
New cards

K-fold cross-validation

Training and validating repeatedly using different parts of the dataset.

30
New cards

Overfitting

Learning training details or noise and performing poorly on new data.

31
New cards

Underfitting

Being too simple to learn patterns; performance is poor on training and validation data.

32
New cards

Overfitting prevention

Simpler models, regularization, limited tree depth or more suitable training data.

33
New cards

Generalization

A model's ability to perform well on unseen data.

34
New cards

K-Nearest Neighbors (KNN)

Predicting from the K closest training examples.

35
New cards

KNN classification

Predicting the majority class among nearby examples.

36
New cards

KNN regression

Predicting the average target value of nearby examples.

37
New cards

KNN: Small vs large K

Small K may overfit; large K may oversmooth and underfit.

38
New cards

Feature scaling in KNN

Important because features with larger scales can dominate distance calculations.

39
New cards

True Positive (TP)

A correctly predicted positive.

40
New cards

True Negative (TN)

A correctly predicted negative.

41
New cards

False Positive (FP)

A negative incorrectly predicted as positive.

42
New cards

False Negative (FN)

A positive incorrectly predicted as negative.

43
New cards

Accuracy

The proportion of all predictions that are correct.

44
New cards

Precision

Of predicted positives, the proportion that are actually positive.

45
New cards

Recall

Of actual positives, the proportion correctly detected.

46
New cards

F1-score

A measure that balances precision and recall.

47
New cards

Class imbalance

When one class is much more common; accuracy alone may be misleading.

48
New cards

MAE, MSE and RMSE

Regression error measures. MAE uses absolute errors; MSE squares errors; RMSE is the square root of MSE.

49
New cards

R² score

Measures how much variation in the target a regression model explains.

50
New cards

Linear regression

Predicting a number using a weighted combination of input features.

51
New cards

Residual

Actual value minus predicted value.

52
New cards

Logistic regression

A classification model that predicts class probabilities.

53
New cards

Sigmoid function

Converts a score into a value between 0 and 1.

54
New cards

Loss function

Measures how wrong a model's predictions are.

55
New cards

Gradient descent

Updating model parameters in a direction that reduces loss.

56
New cards

Learning rate

Controls the size of parameter updates; too large may overshoot, too small may be slow.

57
New cards

Decision tree

A model that asks questions at nodes, follows branches and predicts at leaves.

58
New cards

Gini impurity

Measures how mixed the classes are; 0 means a completely pure node.

59
New cards

Entropy

Measures uncertainty or class mixing in a node.

60
New cards

Information gain

Reduction in entropy after splitting; higher gain is better.

61
New cards

Pre-pruning

Stopping a tree from growing too complex.

62
New cards

Post-pruning

Removing unnecessary branches after a tree has grown.

63
New cards

Maximum depth and maximum leaves

Limits on tree levels and final leaves to prevent overfitting.

64
New cards

Minimum samples per leaf

The minimum number of examples allowed in each leaf.

65
New cards

Minimum samples for split

The minimum number of examples needed before a node can split.

66
New cards

Classification vs regression trees

Classification reduces class impurity; regression groups similar numerical values.

67
New cards

Random Forest

Multiple decision trees whose predictions are combined.

68
New cards

Random Forest advantage

Usually more stable and less prone to overfitting than a single tree.

69
New cards

Dimensionality reduction

Reducing the number of features while keeping useful information.

70
New cards

Principal Component Analysis (PCA)

Creating new features called principal components that capture the greatest variation first.

71
New cards

Neuron

Combines weighted inputs and a bias, then applies an activation function.

72
New cards

Input layer

Receives input features.

73
New cards

Hidden layer

Transforms information to learn patterns.

74
New cards

Output layer

Produces the final prediction.

75
New cards

Connections and weights

Links between neurons with learned values controlling signal strength.

76
New cards

Activation function

Introduces nonlinearity so neural networks can learn complex patterns.

77
New cards

Network without nonlinear activations

Multiple linear layers behave like one linear layer, limiting the patterns learned.

78
New cards

ReLU

An activation function that replaces negative values with zero.

79
New cards

Sigmoid vs softmax

Sigmoid often gives a binary-class probability; softmax gives multiclass probabilities.

80
New cards

Five steps of neural network learning

Initialize weights → predict → calculate error → backpropagate → update weights.

81
New cards

Forward propagation

Passing data through the network to produce a prediction.

82
New cards

Backpropagation

Calculating gradients that show how weights affect the error.

83
New cards

Weight updates

Adjusting weights using gradients to reduce future errors.

84
New cards

Epoch vs batch

Epoch = one full pass through training data; batch = a smaller group processed together.

85
New cards

Support Vector Machine (SVM)

A supervised model that finds a separating boundary with the largest possible margin.

86
New cards

SVM hyperplane

The decision boundary separating classes; a line in two dimensions.

87
New cards

SVM margin

The perpendicular gap from the decision boundary to the closest training points.

88
New cards

Support vectors

The closest training points that determine the separating boundary.

89
New cards

SVM decision score

w·x + b; positive predicts +1, negative predicts −1, zero is on the boundary.

90
New cards

SVM functional margin

m = y(w·x + b), where y is the actual class, +1 or −1.

91
New cards

SVM margin m = 1

Correctly classified and exactly on its class margin boundary.

92
New cards

SVM margin m > 1

Correctly classified and outside the margin.

93
New cards

SVM margin 0 < m < 1

Correctly classified but inside the margin.

94
New cards

SVM margin m = 0 or m < 0

Zero means on the decision boundary; negative means misclassified.

95
New cards

Hard-margin SVM

Requires perfect linear separation of training examples.

96
New cards

Soft-margin SVM

Allows some margin violations or misclassification to handle noisy data.