1. Home
  2. Explore
  3. Computer Science
  4. Classical Machine Learning Classification

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

Classical Machine Learning Classification

  • 69Unfamiliar
  • 0Learning
  • 0Familiar
  • 0Mastered
Topic: Classification Foundations
A supervised learning task that predicts a category or label is called
.

69 questions

  1. 1
    A supervised learning task that predicts a category or label is called
    _____
    .
    Hint

    Unlike regression, this task predicts a class or label.

    Answer

    classification

    Explanation

    Classification is a supervised learning task that predicts a category, such as whether a penguin is male or female. Regression instead predicts a numerical value.

  2. 2
    A supervised learning model that predicts a numerical value for a new data point performs
    _____
    .
    Hint

    Think of predicting a measurable quantity rather than a class.

    Answer

    regression

    Explanation

    Regression models predict numerical values for new data points, while classification models predict categories.

  3. 3
    The data set used to demonstrate classification contains penguin measurements and is known as
    _____
    .
    Hint

    This is the name of the penguin data set used in the example.

    Answer

    Palmer's Penguins

    Explanation

    The workshop uses the Palmer's Penguins data set, which contains measurements and categorical information for penguins.

  4. 4
    The Palmer's Penguins data set contains
    _____
    penguin species.
    Hint

    The species labels include Adelie, Gentoo, and Chinstrap.

    Answer

    three

    Explanation

    The data set includes three penguin species, so predicting species would be a multi-class classification problem.

  5. 5
    A model that predicts whether a penguin is male or female is a
    _____
    .
    Hint

    The target has two possible categories.

    Answer

    binary classifier

    Explanation

    Predicting male or female gives two possible classes, making the gender-prediction model a binary classifier.

  6. 6
    Predicting which of three penguin species an observation belongs to is an example of
    _____
    .
    Hint

    Consider classification with several possible categories rather than just two.

    Answer

    multi-label classification

    Explanation

    The lesson describes classification across more than two categories as multi-label classification; predicting among three penguin species is its example.

  7. 7
    If a classifier predicts among three species, its confusion matrix has dimensions
    _____
    .
    Hint

    Use the number of classes for both matrix dimensions.

    Answer

    3 by 3

    Explanation

    A confusion matrix has one row and column for each class. With three species, it has three rows and three columns.

  8. 8
    Before training the models in this example, all input variables must be converted to
    _____
    .
    Hint

    Think of the data type the model inputs must use.

    Answer

    numeric

    Explanation

    The lesson states that variables used to train the models must be numeric, so categorical variables need encoding first.

  9. 9
    Species, island, and sex are examples of
    _____
    that need to be encoded before model training.
    Hint

    These variables represent named groups or labels.

    Answer

    categorical variables

    Explanation

    Species, island, and sex are categories rather than continuous measurements, so they are categorical variables that must be encoded for the models.

  10. 10
    The three categorical variables identified for encoding in the penguin data are
    _____
    .
    Hint

    Name the three non-measurement categories in the example.

    Answer

    species, island, and sex

    Explanation

    The penguin data set has three categorical variables identified for encoding: species, island, and sex.

  11. 11
    The tool used in the example to convert categories into numeric labels is
    _____
    .
    Hint

    This scikit-learn tool maps category labels to numbers.

    Answer

    LabelEncoder

    Explanation

    The lesson uses LabelEncoder to convert categorical values into numeric labels.

  12. 12
    After label encoding, a variable with three categories is represented by
    _____
    .
    Hint

    Three distinct classes need three distinct integer labels in this example.

    Answer

    0, 1, or 2

    Explanation

    Three categories are represented by three numeric labels: 0, 1, and 2.

  13. 13
    After label encoding, the two sex categories are represented by
    _____
    .
    Hint

    Two categories receive two integer labels.

    Answer

    0 or 1

    Explanation

    The two sex categories are represented by two numeric labels, 0 and 1.

  14. 14
    The scikit-learn tool used to standardize numerical features in the example is
    _____
    .
    Hint

    This scaler is used to standardize numerical features.

    Answer

    StandardScaler

    Explanation

    StandardScaler transforms numerical features so that their values are expressed on a standardized scale.

  15. 15
    The intended standardized distribution has a
    _____
    .
    Hint

    Recall the two target statistics of the standardized distribution.

    Answer

    mean of 0 and standard deviation of 1

    Explanation

    The stated standardization converts numerical variables to a Gaussian distribution with mean 0 and standard deviation 1.

  16. 16
    In pandas, the function used to remove rows with missing values is
    _____
    .
    Hint

    This pandas operation drops rows with missing entries.

    Answer

    dropna

    Explanation

    The dropna function removes rows containing missing values, allowing the data set to be cleaned before modeling.

  17. 17
    After rows with missing values were removed, the data set contained
    _____
    rows.
    Hint

    Subtract the ten rows removed from the original row count.

    Answer

    334

    Explanation

    Removing rows with missing values reduced the original 344-row data set to 334 rows.

  18. 18
    After the row with a dot instead of a sex category was filtered out, the data set contained
    _____
    rows.
    Hint

    One more row was excluded after the data set had 334 rows.

    Answer

    333

    Explanation

    After the missing-value rows were dropped, one additional row with an invalid dot in the sex field was removed, leaving 333 rows.

  19. 19
    To count the observations in each species, island, or sex category, the lesson uses
    _____
    .
    Hint

    Think of a pandas operation that counts occurrences of each distinct value.

    Answer

    value counts

    Explanation

    The value counts operation reports how many observations belong to each category in a variable.

  20. 20
    Rows with NaN entries contain
    _____
    that need to be addressed during preprocessing.
    Hint

    These are absent entries, often represented as NaN.

    Answer

    missing values

    Explanation

    The initial data set had missing entries in several measurement columns and in sex, so it required cleaning before model training.

  21. 21
    An extreme value that differs substantially from the rest of a distribution is an
    _____
    .
    Hint

    These observations are unusually far from the general pattern.

    Answer

    outliers

    Explanation

    An outlier is an extreme observation that lies far from the rest of the data. It may reflect an error or have a meaningful cause that should be investigated.

  22. 22
    The method described identifies outliers by dividing the ordered data into four parts called
    _____
    .
    Hint

    These divide a distribution into four equal parts.

    Answer

    quartiles

    Explanation

    Quartiles divide ordered data into four portions, each containing about 25% of the observations, and are used to construct the interquartile range.

  23. 23
    The distance between the first and third quartiles, used to define outlier fences, is the
    _____
    .
    Hint

    It spans the middle half of the data.

    Answer

    interquartile range

    Explanation

    The interquartile range measures the distance between the first and third quartiles and is used to set the outlier fences.

  24. 24
    The inner outlier fences extend
    _____
    below the first quartile and above the third quartile.
    Hint

    This is the multiplier used for the inner fences.

    Answer

    1.5 times the interquartile range

    Explanation

    The inner lower fence is one and a half interquartile ranges below the first quartile, and the inner upper fence is the same distance above the third quartile.

  25. 25
    The outer outlier fences are set
    _____
    beyond the first and third quartiles.
    Hint

    The outer fences extend twice as far as the inner-fence multiplier.

    Answer

    3 times the interquartile range

    Explanation

    The outer fences use three interquartile ranges below the first quartile and above the third quartile.

  26. 26
    To visualize the distributions of measurements such as culmen length, the lesson uses
    _____
    .
    Hint

    These plots display frequencies across numeric intervals.

    Answer

    histograms

    Explanation

    Histograms show how numerical measurements are distributed by grouping values into bins.

  27. 27
    The smooth distribution curve plotted alongside a histogram is the
    _____
    .
    Hint

    This is the smooth density curve that can be overlaid on a histogram.

    Answer

    kernel density estimate

    Explanation

    The kernel density estimate adds a smoothed representation of the distribution to the histograms.

  28. 28
    The portion of the data used to fit a machine-learning model is the
    _____
    .
    Hint

    This portion is used for learning model parameters.

    Answer

    training data

    Explanation

    The training data are used to fit the model and let it learn patterns linking input features to the target.

  29. 29
    The portion held aside to evaluate predictions on unseen observations is the
    _____
    .
    Hint

    This held-out portion is used to assess model performance.

    Answer

    testing data

    Explanation

    The testing data are held aside to evaluate how well the trained model predicts observations it did not train on.

  30. 30
    In the example's usual split, approximately
    _____
    of the data is used for training.
    Hint

    This is the larger share of the usual training-and-testing split.

    Answer

    80%

    Explanation

    The lesson uses about 80% of the observations for training when there is sufficient data, leaving about 20% for testing.

  31. 31
    In the example's usual split, approximately
    _____
    of the data is reserved for testing.
    Hint

    This is the smaller share reserved for evaluation.

    Answer

    20%

    Explanation

    About 20% of the observations are held out for testing the trained model.

  32. 32
    To reproduce the same randomized train-test split across runs, specify a
    _____
    .
    Hint

    This value controls the random number generator so repeated runs can match.

    Answer

    random seed

    Explanation

    Setting a random seed makes randomized operations such as the train-test split repeatable, supporting reproducibility.

  33. 33
    The example sets the random state to
    _____
    to make its split reproducible.
    Hint

    This is the particular reproducibility value used in the example.

    Answer

    42

    Explanation

    The example sets the random state to 42 for reproducibility.

  34. 34
    The example's training feature set contains
    _____
    rows.
    Hint

    This is the number of training observations reported in the example.

    Answer

    266

    Explanation

    With the selected split, the training features contain 266 rows.

  35. 35
    The example's testing feature set contains
    _____
    rows.
    Hint

    This is the number of held-out test observations reported.

    Answer

    67

    Explanation

    The test set contains 67 rows, or about one fifth of the cleaned observations.

  36. 36
    One of the three models used in the example is the
    _____
    .
    Hint

    This classifier predicts using nearby observations in feature space.

    Answer

    k-nearest neighbors classifier

    Explanation

    The lesson tests three classifiers, including k-nearest neighbors with three neighbors.

  37. 37
    The k-nearest neighbors model in the example bases its classification on
    _____
    .
    Hint

    This is the selected value of k in the example.

    Answer

    three neighbors

    Explanation

    The example configures its k-nearest neighbors classifier to use three neighboring observations.

  38. 38
    The classifier whose maximum depth was set to three is the
    _____
    .
    Hint

    This classifier makes decisions through a branching structure.

    Answer

    decision tree classifier

    Explanation

    The decision tree classifier is one of the three models evaluated, and its maximum depth is set to three.

  39. 39
    The third classifier compared in the example is the
    _____
    .
    Hint

    This classifier is based on support vector machines.

    Answer

    support vector classifier

    Explanation

    The support vector classifier is the third model tested, using a linear kernel in the example.

  40. 40
    Culmen length, culmen depth, flipper length, body mass, island, and species are the model's
    _____
    .
    Hint

    These are the predictor variables supplied to the model.

    Answer

    features

    Explanation

    Features are the input variables used to make a prediction. In this model they include measurements and categories such as island and species.

  41. 41
    In the penguin gender-prediction task, encoded sex is the
    _____
    .
    Hint

    This is the response or label the model aims to predict.

    Answer

    target variable

    Explanation

    The target variable is the outcome the model is trained to predict; here it is encoded sex.

  42. 42
    After creating a classifier, the model is trained on the training features and labels by calling it to
    _____
    .
    Hint

    This verb describes learning from labeled training examples.

    Answer

    fit

    Explanation

    Fitting a classifier means training it on the training features and their corresponding target labels.

  43. 43
    When an observation is actually positive and is predicted as positive, it is a
    _____
    .
    Hint

    Both the actual class and the prediction are positive.

    Answer

    true positive

    Explanation

    A true positive occurs when the actual condition is positive and the model also predicts positive.

  44. 44
    When an observation is actually positive but is predicted as negative, it is a
    _____
    .
    Hint

    The model misses a positive case by predicting the negative class.

    Answer

    false negative

    Explanation

    A false negative occurs when an observation is actually positive but the model predicts negative.

  45. 45
    When an observation is actually negative and is predicted as negative, it is a
    _____
    .
    Hint

    Both the actual class and the prediction are negative.

    Answer

    true negative

    Explanation

    A true negative occurs when the actual condition is negative and the model correctly predicts negative.

  46. 46
    When an observation is actually negative but is predicted as positive, it is a
    _____
    .
    Hint

    The model incorrectly labels a negative case as positive.

    Answer

    false positive

    Explanation

    A false positive occurs when an observation is actually negative but the model predicts positive.

  47. 47
    The table that compares predicted conditions with actual conditions is a
    _____
    .
    Hint

    This table organizes predictions against the actual outcomes.

    Answer

    confusion matrix

    Explanation

    A confusion matrix compares actual classes with predicted classes and summarizes correct classifications and misclassifications.

  48. 48
    The lesson uses a
    _____
    to display confusion-matrix values more clearly.
    Hint

    This color-coded visualization highlights larger and smaller matrix entries.

    Answer

    Seaborn heatmap

    Explanation

    A heatmap makes the numerical values in a confusion matrix easier to interpret visually.

  49. 49
    The metric calculated as true positives divided by all positive predictions is
    _____
    .
    Hint

    This metric answers: of the cases predicted positive, how many really were positive?

    Answer

    precision

    Explanation

    Precision measures the proportion of positive predictions that are truly positive: true positives divided by true positives plus false positives.

  50. 50
    The metric calculated as true positives divided by all actual positive cases is
    _____
    .
    Hint

    This metric asks how many of the actual positive cases the model found.

    Answer

    recall

    Explanation

    Recall measures the proportion of actual positive cases that were identified: true positives divided by true positives plus false negatives.

  51. 51
    The metric that combines precision and recall into one score is the
    _____
    .
    Hint

    This measure summarizes the balance between precision and recall.

    Answer

    F1 score

    Explanation

    The F1 score combines precision and recall into a single measure, making it useful when both are important.

  52. 52
    The number of actual observations for a class in a classification report is its
    _____
    .
    Hint

    This report column counts the true examples in each class.

    Answer

    support

    Explanation

    In a classification report, support is the number of actual observations belonging to a class.

  53. 53
    An average that treats every class equally regardless of its size is the
    _____
    .
    Hint

    Each class contributes equally to this average.

    Answer

    macro average

    Explanation

    A macro average computes a metric for each class and averages the class results without weighting by class size.

  54. 54
    An average that gives class results influence according to their support is the
    _____
    .
    Hint

    Larger classes contribute more to this average.

    Answer

    weighted average

    Explanation

    A weighted average accounts for the number of observations in each class when combining class-level metric values.

  55. 55
    The measure of a classifier's ability to correctly identify negative cases is
    _____
    .
    Hint

    This metric focuses on correctly recognizing negative observations.

    Answer

    specificity

    Explanation

    Specificity, also called the true negative rate, measures how well a classifier identifies negative cases.

  56. 56
    One additional classification metric named alongside the F1 score is the
    _____
    .
    Hint

    This is a named similarity-based metric used to evaluate classifications.

    Answer

    Jaccard index

    Explanation

    The Jaccard index is another classification metric mentioned in the lesson; different applications may favor different metrics.

  57. 57
    The best evaluation metric can depend on the research field and the
    _____
    .
    Hint

    Metric choice depends on what the task needs to emphasize.

    Answer

    application

    Explanation

    The appropriate metric depends on the purpose of the analysis and the priorities of the research or application area.

  58. 58
    The abbreviation ROC stands for
    _____
    .
    Hint

    Expand the letters in ROC.

    Answer

    receiver operating characteristic

    Explanation

    ROC stands for receiver operating characteristic and describes a curve used to assess classifier performance.

  59. 59
    One rate plotted on the ROC curve is the
    _____
    .
    Hint

    This is the vertical-axis rate on an ROC curve.

    Answer

    true positive rate

    Explanation

    The ROC curve plots the true positive rate against the false positive rate as the classification threshold varies.

  60. 60
    The other rate plotted on the ROC curve is the
    _____
    .
    Hint

    This is the rate of incorrectly labeling negatives as positive.

    Answer

    false positive rate

    Explanation

    The false positive rate tracks the proportion of actual negative cases incorrectly classified as positive.

  61. 61
    The summary value used to compare ROC curves is the
    _____
    .
    Hint

    This quantity is often abbreviated AUC.

    Answer

    area under the curve

    Explanation

    The area under the ROC curve summarizes the classifier's performance across thresholds; the lesson uses it to compare models.

  62. 62
    An ROC area of
    _____
    indicates performance like random classification.
    Hint

    This is the midpoint value associated with random performance.

    Answer

    0.5

    Explanation

    An area under the ROC curve of 0.5 corresponds to random classification in the lesson's interpretation.

  63. 63
    A perfect classifier has an area under the ROC curve of
    _____
    .
    Hint

    This is the maximum possible ROC area.

    Answer

    1

    Explanation

    A perfect classifier has an ROC area of 1, corresponding to complete separation of the classes.

  64. 64
    Among the three example models, the highest ROC area belongs to the
    _____
    .
    Hint

    Compare the three reported areas: 0.94, 0.93, and 0.91.

    Answer

    k-nearest neighbors classifier

    Explanation

    The reported ROC areas are 0.94 for k-nearest neighbors, 0.93 for the decision tree, and 0.91 for the support vector classifier, so k-nearest neighbors is highest.

  65. 65
    Simplifying a data problem by representing it with fewer dimensions is called
    _____
    .
    Hint

    This approach reduces the number of dimensions in a data representation.

    Answer

    dimensionality reduction

    Explanation

    Dimensionality reduction simplifies a problem with many variables by transforming it into a representation with fewer dimensions.

  66. 66
    The penguin example describes a problem with
    _____
    variables before possible reduction.
    Hint

    Count the four measurements plus species and gender.

    Answer

    six

    Explanation

    The example discusses six variables: four physical measurements, species, and gender.

  67. 67
    One proposed simplification is to transform the six-variable problem into one with
    _____
    dimensions.
    Hint

    This is the smaller number of dimensions proposed in the example.

    Answer

    two

    Explanation

    The lesson gives reducing a six-dimensional problem to two dimensions as an example of simplification.

  68. 68
    The lesson proposes using transformations from
    _____
    to map data into a simpler vector space.
    Hint

    This area of mathematics studies vector spaces and transformations.

    Answer

    linear algebra

    Explanation

    The proposed transformation from the original vector space to a simpler one uses linear algebra.

  69. 69
    When simplifying a model, one question is whether every variable is equally
    _____
    to the prediction task.
    Hint

    The key question is whether each variable matters to the problem.

    Answer

    relevance

    Explanation

    Dimensionality reduction can help determine whether all variables are useful or whether some carry less relevant information.

1 of 69
Question 1 of 69

Ask anything

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

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent