Classical Machine Learning Classification
- 59Unfamiliar
- 0Learning
- 0Familiar
- 0Mastered
- spaceFlip card
- KI knew it
- DI didn't know it
- ←Previous card
- →Next card
What does a classification model predict?
Classification is a supervised learning task that assigns an input to a category or class, such as predicting whether a penguin is male or female.
Or swipe the card
59 cards
What does a classification model predict?
Classification is a supervised learning task that assigns an input to a category or class, such as predicting whether a penguin is male or female.
How does classification differ from regression?
Regression predicts a numerical value for a new data point; classification predicts a category or class.
What are the purposes of the training and test sets?
Split the prepared data into a training set to fit the model and a test set to evaluate its performance.
What train–test split was recommended when there is plenty of data?
A common split is 80% of the data for training and 20% for testing.
What are the features and target in a supervised classification problem?
The features, usually denoted X, are the input variables. The target, usually denoted y, is the outcome the model is trained to predict.
Why specify a random state when splitting data?
A random seed or random state makes randomized data splitting reproducible, so the same split can be obtained again.
For the penguin gender-classification task, what were the features and target?
In the example, the features were penguin measurements, island, and species; the target was encoded sex.
What kinds of information are included in the Palmer penguins dataset?
The Palmer penguins dataset includes three penguin species found across three Antarctic islands, along with physical measurements and sex.
Which four physical measurements were used as penguin features?
The dataset’s measurement features include culmen length, culmen depth, flipper length, and body mass.
Why encode categorical variables before training a model?
Many machine-learning models require their input variables to be numeric, so categorical variables must be encoded before training.
How did label encoding represent the penguin categories?
Label encoding replaces each category with a numeric label. In this example, three categories became values 0, 1, and 2; two categories became 0 and 1.
What is one-hot encoding?
One-hot encoding represents categories using separate binary indicator columns, with values of 0 or 1.
Which penguin variables were categorical?
The categorical variables in the dataset were species, island, and sex.
How many rows remained after cleaning the penguin dataset?
The original dataset had 344 rows. Dropping rows with missing values left 334; removing the row with an invalid sex entry left 333.
How were missing values handled in the penguin dataset?
Missing values appeared in culmen length, culmen depth, flipper length, body mass, and sex. The example removed rows containing missing values with
dropna.What additional cleaning step was applied to the sex column?
After removing missing values, the example also filtered out a row whose sex entry was a dot, leaving 333 rows.
What does standard scaling do?
Standard scaling transforms numerical features so they have mean 0 and standard deviation 1, putting measurements on comparable scales.
How was scaling applied to the training data, test data, and target?
The scaler was fitted on the training features and then applied to both the training and test features. The target labels were not scaled.
What is an outlier, and why should its cause be checked?
An outlier is an observation unusually far from the rest of the data. It may reflect an error or meaningful variation, so its cause should be investigated.
What are quartiles, and how is the interquartile range defined?
Quartiles divide ordered data into four parts, each containing about 25% of the observations. The interquartile range is IQR=Q3−Q1.
How are the inner outlier fences calculated?
The inner fences are Q1−1.5(IQR) and Q3+1.5(IQR). Values beyond these boundaries are flagged as potential outliers by this rule.
How are the outer outlier fences calculated?
The outer fences use three interquartile ranges: Q1−3(IQR) and Q3+3(IQR).
Which numerical penguin measurements were reported to have no detected outliers?
The example found no outliers in culmen length, culmen depth, flipper length, or body mass using its outlier checks.
What do a histogram and its KDE overlay help visualize?
Histograms show the distribution of numerical values; a kernel density estimate (KDE) overlays a smoothed estimate of the distribution.
How can plots be used to compare penguin measurements across species?
The distributions of measurements can be plotted separately by species to compare how the species differ.
Which three classification algorithms were compared in the example?
The three classifiers demonstrated were k-nearest neighbors, a decision tree, and a support vector classifier.
How did the example configure its k-nearest neighbors classifier?
A k-nearest neighbors classifier predicts a class based on nearby training examples. The example used k=3 neighbors.
What maximum depth was set for the example decision tree?
The example limited the decision tree to a maximum depth of 3, restricting it to three levels of splits.
How was the support vector classifier configured in the example?
The support vector classifier was configured with a linear kernel and probability estimates enabled.
What are the basic fit-and-predict steps for a classifier?
Fit a classifier using the training features and training labels, then use it to predict labels for the test features.
How can a classifier be fine-tuned?
Model parameters can be adjusted and tested to fine-tune a classifier’s performance.
What is the difference between a k-nearest neighbors classifier and regressor?
A k-nearest neighbors algorithm can be used for classification or regression: its classifier predicts categories, while its regressor predicts numerical values.
What does a confusion matrix show?
A confusion matrix compares predicted classes with actual classes and summarizes correct and incorrect classifications.
What is a true positive?
A true positive (TP) occurs when a positive case is correctly predicted as positive.
What is a false negative?
A false negative (FN) occurs when an actual positive case is predicted as negative.
What is a true negative?
A true negative (TN) occurs when a negative case is correctly predicted as negative.
What is a false positive?
A false positive (FP) occurs when an actual negative case is predicted as positive.
How were actual and predicted classes arranged in the example confusion matrices?
In the displayed confusion matrices, rows represented actual classes and columns represented predicted classes.
How is precision calculated, and what does it measure?
Precision is the proportion of predicted positive cases that are truly positive: rac{TP}{TP+FP}.
How is recall calculated, and what does it measure?
Recall, or the true positive rate, is the proportion of actual positive cases correctly identified: rac{TP}{TP+FN}.
How is classification accuracy calculated?
Accuracy is the proportion of all predictions that are correct: rac{TP+TN}{TP+TN+FP+FN}.
What does the F1 score summarize?
The F1 score combines precision and recall using their harmonic mean: F1=2precision+recallprecision×recall.
What does “support” mean in a classification report?
Support is the number of actual examples belonging to a class in the evaluated dataset.
How do macro and weighted averages differ in a classification report?
A macro average gives each class equal weight; a weighted average accounts for the number of examples in each class.
What do specificity and fallout describe?
Specificity measures the proportion of actual negatives correctly identified, while fallout is the false positive rate.
Why might different applications choose different classification metrics?
Metric choice depends on the task and the costs or importance of different kinds of errors; different research fields may favor different metrics.
How does the confusion matrix size change for a three-class problem?
A binary classifier distinguishes between two classes. A multiclass problem with three classes can be represented by a 3×3 confusion matrix.
What does an ROC curve show?
ROC stands for receiver operating characteristic. An ROC curve evaluates a binary classifier across thresholds by plotting true positive rate against false positive rate.
How is the true positive rate calculated?
The true positive rate is rac{TP}{TP+FN}; it measures the proportion of actual positives correctly identified.
How is the false positive rate calculated?
The false positive rate is rac{FP}{FP+TN}; it measures the proportion of actual negatives incorrectly predicted positive.
What does an ROC AUC of 0.5 indicate?
An ROC curve near the diagonal represents performance like random guessing; its area under the curve (AUC) is about 0.5.
What ROC AUC corresponds to perfect classification?
A perfect classifier has an ROC AUC of 1.
How was the preferred classifier chosen using ROC analysis?
A higher ROC AUC indicates better discrimination between the classes; among the compared models, the one with the highest AUC was selected.
What were the example ROC AUC scores, and which model had the highest?
The example AUCs were 0.94 for k-nearest neighbors, 0.93 for the decision tree, and 0.91 for the support vector classifier. Thus, k-nearest neighbors performed best by AUC.
What is dimensionality reduction?
Dimensionality reduction simplifies a problem by representing data with fewer variables or dimensions while aiming to retain useful structure.
Why might dimensionality reduction be useful?
Reducing dimensions can simplify analysis when a dataset has many variables and not all may be relevant to the task.
How was dimensionality reduction illustrated with the penguin data?
The penguin example had six proposed variables; dimensionality reduction asks whether the data could be represented using fewer dimensions, such as two.
How can dimensionality reduction transform a high-dimensional problem?
The proposed approach transforms the original vector space into a simpler one using linear algebra transformations.
How does unsupervised learning differ from supervised learning?
In supervised learning, a target label is provided for learning or prediction. In unsupervised learning, the algorithm works with data without a supplied target label.

Ask anything
We've read this whole study set, so questions about it get the best answers.