1. Home
  2. Explore
  3. Computer Science
  4. Introduction to Machine Learning

Study methods

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

Introduction to Machine Learning

  • 81Unfamiliar
  • 0Learning
  • 0Familiar
  • 0Mastered
Topic: Learning Types

What distinguishes machine learning from a system based entirely on explicit instructions?

81 questions

  1. 1

    What distinguishes machine learning from a system based entirely on explicit instructions?

    1. A

      Machine learning can operate only when its input and output are identical

    2. B

      Machine learning replaces all data with randomly generated instructions

    3. C

      Machine learning always uses more computational resources than rule-based systems

    4. D

      Machine learning infers patterns from data rather than receiving every task rule directly

    Correct answer
    D

    Machine learning infers patterns from data rather than receiving every task rule directly

    Explanation

    Machine learning gives a computer access to data or patterns and allows it to infer how to perform a task instead of explicitly specifying every instruction.

  2. 2

    What is the defining structure of the data used in supervised learning?

    1. A

      Sequences of actions with rewards but no predetermined outputs

    2. B

      Randomly generated inputs with no relationship between examples

    3. C

      Unlabeled inputs grouped according to their visual similarity

    4. D

      Input-output pairs in which each input has a known target output

    Correct answer
    D

    Input-output pairs in which each input has a known target output

    Explanation

    Supervised learning uses data sets containing input-output pairs, allowing a model to learn a function that maps inputs to outputs.

  3. 3

    Which task is an example of supervised classification?

    1. A

      Labeling a banknote as authentic or counterfeit

    2. B

      Grouping consumers without knowing their categories in advance

    3. C

      Predicting the exact number of sales from an advertising budget

    4. D

      Learning which game moves produce rewards through trial and error

    Correct answer
    A

    Labeling a banknote as authentic or counterfeit

    Explanation

    Classification predicts a discrete category, such as authentic versus counterfeit banknote.

  4. 4

    Which task is an example of supervised regression?

    1. A

      Predicting the amount of sales from advertising spending

    2. B

      Choosing an action after receiving a punishment

    3. C

      Grouping genes into clusters without labels

    4. D

      Predicting whether a banknote is authentic or counterfeit

    Correct answer
    A

    Predicting the amount of sales from advertising spending

    Explanation

    Regression predicts a continuous real-valued output, such as sales associated with a particular advertising budget.

  5. 5

    What is the central difference between classification and regression?

    1. A

      Classification requires rewards, whereas regression requires punishments

    2. B

      Classification uses images, whereas regression uses only numerical tables

    3. C

      Classification predicts discrete categories, whereas regression predicts continuous values

    4. D

      Classification is unsupervised, whereas regression is always reinforcement learning

    Correct answer
    C

    Classification predicts discrete categories, whereas regression predicts continuous values

    Explanation

    Classification predicts categories such as rain or no rain, while regression predicts real-number quantities such as sales.

  6. 6

    What is the key feature of reinforcement learning?

    1. A

      A model learns only from input-output pairs labeled by a human

    2. B

      An algorithm assigns every input to the nearest existing data point

    3. C

      A system minimizes error without interacting with an environment

    4. D

      An agent learns from rewards or punishments resulting from its actions

    Correct answer
    D

    An agent learns from rewards or punishments resulting from its actions

    Explanation

    In reinforcement learning, an agent interacts with an environment and learns which actions are beneficial from numerical rewards or punishments.

  7. 7

    What is the defining feature of unsupervised learning?

    1. A

      The data has no labels or additional feedback from which to learn

    2. B

      The agent receives a reward after every action

    3. C

      The model is restricted to predicting binary outputs

    4. D

      The data includes a human-provided label for every example

    Correct answer
    A

    The data has no labels or additional feedback from which to learn

    Explanation

    Unsupervised learning discovers patterns in data without labeled target outputs or reward feedback.

  8. 8

    What does clustering attempt to do?

    1. A

      Predict a continuous numerical value from labeled examples

    2. B

      Separate labeled examples using a manually specified line

    3. C

      Organize objects into groups whose members are similar to one another

    4. D

      Select the action with the highest estimated future reward

    Correct answer
    C

    Organize objects into groups whose members are similar to one another

    Explanation

    Clustering organizes unlabeled objects into distinct groups based on similarity.

  9. 9

    In a supervised weather-classification problem, what role do humidity and air pressure play?

    1. A

      They are input features used to predict whether it will rain

    2. B

      They are labels assigned by the learning algorithm

    3. C

      They are reward values assigned after an action

    4. D

      They are cluster centers that define groups of weather records

    Correct answer
    A

    They are input features used to predict whether it will rain

    Explanation

    Humidity and pressure are input variables, while the label indicates whether the day was rainy or not rainy.

  10. 10

    Why are weather records with human-provided rain or no-rain labels considered supervised-learning data?

    1. A

      The labels provide target outputs associated with measured inputs

    2. B

      The records contain more than one numerical feature

    3. C

      The data is plotted using two graphical dimensions

    4. D

      The computer automatically creates labels from the weather measurements

    Correct answer
    A

    The labels provide target outputs associated with measured inputs

    Explanation

    Human labels identify the correct output for each combination of input measurements, making the data supervised.

  11. 11

    In supervised classification, what is the purpose of the hypothesis function hhh?

    1. A

      To store every training example without making predictions

    2. B

      To approximate the unknown function that maps inputs to outputs

    3. C

      To determine the number of labels before data collection begins

    4. D

      To replace the input features with random values

    Correct answer
    B

    To approximate the unknown function that maps inputs to outputs

    Explanation

    The true relationship fff is unknown, so the model constructs a hypothesis hhh that attempts to approximate it.

  12. 12

    How does nearest-neighbor classification assign a label to a new input?

    1. A

      It assigns the class with the largest numerical label

    2. B

      It chooses the class of the nearest training data point

    3. C

      It chooses the class of the most distant training point

    4. D

      It averages all labels regardless of their locations

    Correct answer
    B

    It chooses the class of the nearest training data point

    Explanation

    Nearest-neighbor classification labels an input according to the category of the closest known data point.

  13. 13

    Why can nearest-neighbor classification be ambiguous for some inputs?

    1. A

      The method cannot use numerical input features

    2. B

      The nearest point may have one label while the surrounding majority has another

    3. C

      The method always produces a continuous rather than discrete output

    4. D

      The method requires all categories to contain equal numbers of points

    Correct answer
    B

    The nearest point may have one label while the surrounding majority has another

    Explanation

    A point may be closest to one category but surrounded by many examples from another category, making a single-neighbor decision uncertain.

  14. 14

    How does kkk-nearest-neighbor classification differ from one-nearest-neighbor classification?

    1. A

      It selects the most common class among the kkk closest data points

    2. B

      It uses only unlabeled data and does not compare distances

    3. C

      It predicts a real number instead of a category

    4. D

      It selects the class of the single farthest data point

    Correct answer
    A

    It selects the most common class among the kkk closest data points

    Explanation

    kkk-nearest-neighbor classification considers multiple nearby points and chooses the class receiving the most votes.

  15. 15

    If three of the five nearest neighbors indicate rain and two indicate no rain, what does kkk-nearest-neighbor classification predict?

    1. A

      Rain, because it has the majority of the five votes

    2. B

      No prediction, because five neighbors cannot be used

    3. C

      An intermediate probability of exactly 0.50.50.5

    4. D

      No rain, because the closest individual point determines the result

    Correct answer
    A

    Rain, because it has the majority of the five votes

    Explanation

    Each neighbor contributes one vote, so the class with three votes—rain—wins.

  16. 16

    What is a major computational drawback of a naive nearest-neighbor approach?

    1. A

      It may need to measure the new point's distance from every stored point

    2. B

      It requires a human to label every new prediction

    3. C

      It cannot represent more than two input dimensions

    4. D

      It cannot be applied to classification problems

    Correct answer
    A

    It may need to measure the new point's distance from every stored point

    Explanation

    A naive implementation compares a new input with every existing point, which can be slow for large data sets.

  17. 17

    What is a decision boundary in a classification model?

    1. A

      A boundary that separates inputs assigned to different categories

    2. B

      A measure of how many dimensions the data contains

    3. C

      A list containing all labels in the training data

    4. D

      A reward received after an agent reaches a terminal state

    Correct answer
    A

    A boundary that separates inputs assigned to different categories

    Explanation

    A decision boundary divides the input space into regions associated with different classes.

  18. 18

    What does it mean for data to be linearly separable?

    1. A

      A straight line or linear boundary can perfectly separate the categories

    2. B

      Every input contains exactly one numerical feature

    3. C

      All data points are equally distant from one another

    4. D

      The categories contain identical numbers of examples

    Correct answer
    A

    A straight line or linear boundary can perfectly separate the categories

    Explanation

    Data is linearly separable when a linear boundary can divide the classes without classification errors.

  19. 19

    In a two-feature weather model, what do x1x_1x1​ and x2x_2x2​ represent?

    1. A

      x1x_1x1​ and x2x_2x2​ represent humidity and pressure, respectively

    2. B

      x1x_1x1​ and x2x_2x2​ represent the current and future rewards

    3. C

      x1x_1x1​ and x2x_2x2​ represent the training and testing sets

    4. D

      x1x_1x1​ and x2x_2x2​ represent rain and no rain, respectively

    Correct answer
    A

    x1x_1x1​ and x2x_2x2​ represent humidity and pressure, respectively

    Explanation

    The example identifies x1x_1x1​ as humidity and x2x_2x2​ as pressure.

  20. 20

    What is the role of the weights in a linear hypothesis such as w0+w1x1+w2x2w_0 + w_1x_1 + w_2x_2w0​+w1​x1​+w2​x2​?

    1. A

      They specify the human-provided labels for each training point

    2. B

      They record the number of neighbors used by the classifier

    3. C

      They determine how the inputs contribute to the decision boundary

    4. D

      They determine whether the data is supervised or unsupervised

    Correct answer
    C

    They determine how the inputs contribute to the decision boundary

    Explanation

    The weights scale the input variables, and their values determine the slope, position, and shape of the linear boundary.

  21. 21

    What is the purpose of the constant weight w0w_0w0​ in a linear expression?

    1. A

      It forces every input feature to have equal importance

    2. B

      It allows the boundary to shift upward or downward

    3. C

      It identifies the nearest training example

    4. D

      It converts a continuous output into a cluster label

    Correct answer
    B

    It allows the boundary to shift upward or downward

    Explanation

    The constant term shifts the overall value of the expression and therefore can shift the decision boundary.

  22. 22

    How does the threshold hypothesis classify an input using the weighted expression?

    1. A

      It outputs 111 when the expression is at least 000 and otherwise outputs 000

    2. B

      It outputs the exact value of the weighted expression without thresholding

    3. C

      It assigns the label of the farthest training example

    4. D

      It outputs 000 when the expression is at least 000 and otherwise outputs 111

    Correct answer
    A

    It outputs 111 when the expression is at least 000 and otherwise outputs 000

    Explanation

    The example maps a weighted sum greater than or equal to 000 to rain, represented by 111, and otherwise outputs 000.

  23. 23

    Why does the input vector include a leading 111 when the weight vector includes w0w_0w0​?

    1. A

      The leading 111 indicates that the first input is always rain

    2. B

      The leading 111 ensures that all inputs have different dimensions

    3. C

      The leading 111 removes the need to learn any other weights

    4. D

      Multiplying w0w_0w0​ by 111 incorporates the constant term into the dot product

    Correct answer
    D

    Multiplying w0w_0w0​ by 111 incorporates the constant term into the dot product

    Explanation

    Writing the input as (1,x1,x2)(1,x_1,x_2)(1,x1​,x2​) lets the dot product include w0imes1w_0 imes 1w0​imes1 along with the feature-weight products.

  24. 24

    What is the dot product of the weight vector (w0,w1,w2)(w_0,w_1,w_2)(w0​,w1​,w2​) and input vector (1,x1,x2)(1,x_1,x_2)(1,x1​,x2​)?

    1. A

      w0w1w2+x1x2w_0w_1w_2 + x_1x_2w0​w1​w2​+x1​x2​

    2. B

      w0+w1+w2+x1+x2w_0 + w_1 + w_2 + x_1 + x_2w0​+w1​+w2​+x1​+x2​

    3. C

      w0+w1x1+w2x2w_0 + w_1x_1 + w_2x_2w0​+w1​x1​+w2​x2​

    4. D

      1+w0+x1+x21 + w_0 + x_1 + x_21+w0​+x1​+x2​

    Correct answer
    C

    w0+w1x1+w2x2w_0 + w_1x_1 + w_2x_2w0​+w1​x1​+w2​x2​

    Explanation

    The dot product multiplies corresponding components and adds the results: w0(1)+w1x1+w2x2w_0(1)+w_1x_1+w_2x_2w0​(1)+w1​x1​+w2​x2​.

  25. 25

    Why are the weight and input vectors required to have the same length for a dot product?

    1. A

      Equal lengths prevent the model from using a threshold

    2. B

      Vectors of different lengths always represent the same data

    3. C

      Equal lengths ensure that every classification has two possible labels

    4. D

      Each component of one vector must pair with a corresponding component of the other

    Correct answer
    D

    Each component of one vector must pair with a corresponding component of the other

    Explanation

    A dot product requires corresponding components to be multiplied, so the vectors must contain the same number of components.

  26. 26

    What is the goal of the perceptron learning rule?

    1. A

      To replace rewards with fixed labels in reinforcement learning

    2. B

      To eliminate all training examples after one prediction

    3. C

      To choose the number of clusters without examining the data

    4. D

      To adjust weights using labeled examples so predictions become more accurate

    Correct answer
    D

    To adjust weights using labeled examples so predictions become more accurate

    Explanation

    The perceptron learning rule updates the weights based on the difference between actual and predicted outputs.

  27. 27

    What happens to the perceptron weights when the prediction is correct?

    1. A

      They remain unchanged because the prediction error is zero

    2. B

      They are replaced by randomly selected values

    3. C

      They are all increased by the learning rate

    4. D

      They are all decreased by the learning rate

    Correct answer
    A

    They remain unchanged because the prediction error is zero

    Explanation

    When the actual and predicted values agree, their difference is zero, so the update term is zero.

  28. 28

    If the actual output is greater than the predicted output, what general weight adjustment does the perceptron rule make?

    1. A

      It increases the weights to make a larger output more likely

    2. B

      It decreases the weights to make a smaller output more likely

    3. C

      It leaves the weights unchanged regardless of the error

    4. D

      It replaces the weights with the input values

    Correct answer
    A

    It increases the weights to make a larger output more likely

    Explanation

    A positive difference between the actual and predicted outputs produces a positive update, increasing the weights under the stated assumptions.

  29. 29

    What does the learning rate �alpha�alpha�alpha control in weight updates?

    1. A

      How strongly new information changes the current weights

    2. B

      How many labels are present in the training data

    3. C

      How many dimensions the input space contains

    4. D

      How many clusters are created by an unsupervised algorithm

    Correct answer
    A

    How strongly new information changes the current weights

    Explanation

    A larger �alpha�alpha�alpha produces larger updates, while a smaller �alpha�alpha�alpha produces smaller updates.

  30. 30

    What does �alpha=1�alpha=1�alpha=1 mean in the described update rule?

    1. A

      The old estimate is doubled regardless of new information

    2. B

      The model stops updating after the first example

    3. C

      The new estimate is completely ignored

    4. D

      The new estimate completely replaces the old estimate

    Correct answer
    D

    The new estimate completely replaces the old estimate

    Explanation

    When �alpha=1�alpha=1�alpha=1, the update combines the old value with the full difference between the new and old values, leaving the new value.

  31. 31

    What is an advantage of logistic regression over a hard threshold function?

    1. A

      It guarantees that every training point is classified correctly

    2. B

      It can produce values between 000 and 111 that reflect prediction confidence

    3. C

      It can use only two input variables

    4. D

      It eliminates the need to learn model parameters

    Correct answer
    B

    It can produce values between 000 and 111 that reflect prediction confidence

    Explanation

    A logistic or soft threshold provides graded outputs between 000 and 111, rather than only the hard outcomes 000 and 111.

  32. 32

    Why might a point near a decision boundary receive a lower confidence under a soft-threshold model?

    1. A

      The model ignores all points that lie near the boundary

    2. B

      The point automatically receives the label of the smaller class

    3. C

      Its evidence for either category is less decisive than that of a point farther from the boundary

    4. D

      Soft thresholds assign confidence only to training points

    Correct answer
    C

    Its evidence for either category is less decisive than that of a point farther from the boundary

    Explanation

    A point near the boundary is less clearly associated with either side, so an intermediate output can express lower confidence.

  33. 33

    What objective motivates a support vector machine's maximum-margin separator?

    1. A

      To use the largest possible number of neighboring points

    2. B

      To place the boundary as close as possible to one category

    3. C

      To maximize the distance between the decision boundary and the closest data points

    4. D

      To classify only the training points and ignore future inputs

    Correct answer
    C

    To maximize the distance between the decision boundary and the closest data points

    Explanation

    A support vector machine seeks a maximum-margin separator, which leaves the greatest distance between the boundary and the closest examples.

  34. 34

    What are support vectors in a support vector machine?

    1. A

      The labels assigned to unlabeled examples

    2. B

      The random starting locations of cluster centers

    3. C

      The data points closest to the separating boundary

    4. D

      The data points farthest from every category

    Correct answer
    C

    The data points closest to the separating boundary

    Explanation

    Support vectors are the examples nearest to the boundary and therefore help determine the maximum margin.

  35. 35

    Why can a maximum-margin separator generalize better than a separator that merely classifies the training data correctly?

    1. A

      It ignores points close to the boundary during training

    2. B

      It leaves more space between categories, reducing sensitivity to nearby unseen points

    3. C

      It guarantees that the categories are perfectly linearly separable

    4. D

      It always uses more training examples than every other model

    Correct answer
    B

    It leaves more space between categories, reducing sensitivity to nearby unseen points

    Explanation

    A larger margin provides greater tolerance for variation in unseen examples near the boundary.

  36. 36

    What is a hyperplane in the context of support vector machines?

    1. A

      A single training point that receives the highest reward

    2. B

      A decision boundary that separates data in higher-dimensional space

    3. C

      A cluster center computed from labeled examples

    4. D

      A numerical penalty assigned to a wrong prediction

    Correct answer
    B

    A decision boundary that separates data in higher-dimensional space

    Explanation

    In two dimensions the boundary may be a line; in higher dimensions it is generally called a hyperplane.

  37. 37

    How can support vector machines address data that is not linearly separable?

    1. A

      They convert every continuous output into a binary label

    2. B

      They use only the single nearest neighbor for each prediction

    3. C

      They can use higher-dimensional representations with more suitable decision boundaries

    4. D

      They remove every point that conflicts with a straight-line boundary

    Correct answer
    C

    They can use higher-dimensional representations with more suitable decision boundaries

    Explanation

    By operating in higher-dimensional spaces, support vector machines can sometimes find boundaries, such as curved separations in the original space, that separate complex data more effectively.

  38. 38

    Why is there no universally best classification algorithm?

    1. A

      Different algorithms have trade-offs and perform differently on different data sets

    2. B

      All classification algorithms produce identical hypotheses on every data set

    3. C

      Only one algorithm can work with numerical inputs

    4. D

      The best algorithm is determined solely by the number of labels

    Correct answer
    A

    Different algorithms have trade-offs and perform differently on different data sets

    Explanation

    Nearest neighbors, linear models, and support vector machines make different assumptions and therefore may suit different data sets.

  39. 39

    What does a loss function measure?

    1. A

      How many input features were collected from each example

    2. B

      How many clusters an unsupervised model creates

    3. C

      How poorly a hypothesis performs relative to the actual outputs

    4. D

      How frequently an agent chooses a random action

    Correct answer
    C

    How poorly a hypothesis performs relative to the actual outputs

    Explanation

    A loss function assigns a numerical measure to prediction error or loss of utility.

  40. 40

    How is empirical loss obtained from individual losses?

    1. A

      By selecting only the smallest individual loss

    2. B

      By adding the losses across the available data points

    3. C

      By counting only predictions made on unlabeled data

    4. D

      By multiplying every input feature by its label

    Correct answer
    B

    By adding the losses across the available data points

    Explanation

    Empirical loss is the total loss across the observed data set.

  41. 41

    How does the 000-111 loss function score a prediction?

    1. A

      It assigns 000 to a correct prediction and 111 to an incorrect prediction

    2. B

      It assigns 111 to a correct prediction and 000 to an incorrect prediction

    3. C

      It assigns a squared error to every categorical prediction

    4. D

      It assigns the numerical distance between the prediction and the input

    Correct answer
    A

    It assigns 000 to a correct prediction and 111 to an incorrect prediction

    Explanation

    The 000-111 loss function records whether a categorical prediction is correct, using 000 for correct and 111 for incorrect.

  42. 42

    Why is L1L_1L1​ loss appropriate for many regression problems?

    1. A

      It treats every incorrect categorical prediction as exactly one unit of loss

    2. B

      It ignores the magnitude of the prediction error

    3. C

      It measures only whether the prediction equals the actual value

    4. D

      It measures the absolute distance between predicted and actual values

    Correct answer
    D

    It measures the absolute distance between predicted and actual values

    Explanation

    L1L_1L1​ loss uses the absolute difference between actual and predicted values, so errors are evaluated by how far apart the values are.

  43. 43

    How does L2L_2L2​ loss differ from L1L_1L1​ loss?

    1. A

      L2L_2L2​ assigns the same penalty to every prediction error

    2. B

      L2L_2L2​ ignores the magnitude of errors and uses only correctness

    3. C

      L2L_2L2​ can be used only for categorical rather than numerical outputs

    4. D

      L2L_2L2​ squares the prediction error, penalizing large errors more heavily

    Correct answer
    D

    L2L_2L2​ squares the prediction error, penalizing large errors more heavily

    Explanation

    L2L_2L2​ loss uses the squared difference between actual and predicted values, making large errors disproportionately costly.

  44. 44

    When might L1L_1L1​ loss be preferred over L2L_2L2​ loss?

    1. A

      When the output consists only of two discrete categories

    2. B

      When the model should be less heavily influenced by outliers

    3. C

      When large errors should receive a much stronger penalty

    4. D

      When prediction confidence must be represented between 000 and 111

    Correct answer
    B

    When the model should be less heavily influenced by outliers

    Explanation

    Because L2L_2L2​ squares errors, it emphasizes outliers more strongly; L1L_1L1​ can be preferable when outliers should have less influence.

  45. 45

    What is overfitting?

    1. A

      Using too little data to calculate any training loss

    2. B

      Fitting a model too closely to training data so that it generalizes poorly

    3. C

      Testing a model on data that was not used during training

    4. D

      Choosing a model that cannot represent the training examples

    Correct answer
    B

    Fitting a model too closely to training data so that it generalizes poorly

    Explanation

    An overfit model may perform extremely well on training data but fail to make accurate predictions on unseen data.

  46. 46

    Why can a hypothesis with zero training loss still be undesirable?

    1. A

      Zero training loss proves that the model has too few parameters

    2. B

      It may have memorized the training data instead of learning a general pattern

    3. C

      Zero training loss means the model was evaluated only on testing data

    4. D

      A hypothesis with zero loss cannot make predictions on numerical inputs

    Correct answer
    B

    It may have memorized the training data instead of learning a general pattern

    Explanation

    A highly complex model can fit every training example while failing to generalize to future or unseen examples.

  47. 47

    What is regularization?

    1. A

      Penalizing model complexity in addition to prediction loss

    2. B

      Increasing the number of random actions in reinforcement learning

    3. C

      Removing all labels before training a supervised model

    4. D

      Assigning every input to the largest cluster

    Correct answer
    A

    Penalizing model complexity in addition to prediction loss

    Explanation

    Regularization adds a complexity penalty to the objective, favoring simpler hypotheses that are more likely to generalize.

  48. 48

    What is the effect of increasing the regularization parameter �lambda�lambda�lambda?

    1. A

      The model is forced to use more complex decision boundaries

    2. B

      More complex hypotheses receive a stronger penalty

    3. C

      Testing data is added to the training set automatically

    4. D

      Training loss is ignored completely

    Correct answer
    B

    More complex hypotheses receive a stronger penalty

    Explanation

    A larger �lambda�lambda�lambda gives greater importance to the complexity term in the cost function.

  49. 49

    What is the purpose of holdout cross-validation?

    1. A

      To train and test on exactly the same examples

    2. B

      To eliminate the need for labeled data

    3. C

      To select the nearest neighbor without computing distances

    4. D

      To train on one subset and evaluate generalization on a separate subset

    Correct answer
    D

    To train on one subset and evaluate generalization on a separate subset

    Explanation

    Holdout cross-validation divides data into a training set and a testing set, allowing performance on unseen examples to be measured.

  50. 50

    Why should testing data generally be different from training data?

    1. A

      Testing data is required to contain no input features

    2. B

      Unseen data provides evidence about whether the model generalizes

    3. C

      A model cannot be trained when all data has labels

    4. D

      Different data sets guarantee that the model has zero training loss

    Correct answer
    B

    Unseen data provides evidence about whether the model generalizes

    Explanation

    Evaluating on data not used for training helps reveal whether the model learned general patterns rather than memorizing examples.

  51. 51

    How does kkk-fold cross-validation use the available data?

    1. A

      It creates kkk experiments, each holding out a different subset for testing

    2. B

      It permanently discards kkk subsets and trains on only one subset

    3. C

      It assigns each data point to kkk different labels simultaneously

    4. D

      It uses the same subset for testing in every experiment

    Correct answer
    A

    It creates kkk experiments, each holding out a different subset for testing

    Explanation

    In kkk-fold cross-validation, each fold serves as the testing set once while the remaining folds are used for training.

  52. 52

    What is commonly done with the results from the kkk experiments in kkk-fold cross-validation?

    1. A

      The highest error is discarded before any calculation

    2. B

      All testing predictions are converted into training labels

    3. C

      Only the result from the first experiment is retained

    4. D

      The results are averaged to estimate overall model performance

    Correct answer
    D

    The results are averaged to estimate overall model performance

    Explanation

    Averaging the performance across folds provides an overall estimate that uses multiple training and testing arrangements.

  53. 53

    What is the main purpose of a library such as scikit-learn in the described workflow?

    1. A

      It automatically guarantees that every model generalizes perfectly

    2. B

      It converts every learning problem into clustering

    3. C

      It replaces the need for any training or testing data

    4. D

      It provides ready-made implementations of machine learning algorithms

    Correct answer
    D

    It provides ready-made implementations of machine learning algorithms

    Explanation

    scikit-learn provides implementations of models such as perceptrons, support vector classifiers, and nearest-neighbor classifiers.

  54. 54

    In the banknote example, what do the four measured values represent?

    1. A

      Input features used to predict whether the banknote is authentic or counterfeit

    2. B

      Four rewards received after classifying the banknote

    3. C

      Four cluster centers selected by an unsupervised algorithm

    4. D

      Four possible labels assigned to each banknote

    Correct answer
    A

    Input features used to predict whether the banknote is authentic or counterfeit

    Explanation

    Each banknote has four measured properties that serve as evidence or input features.

  55. 55

    In the banknote data described, what do labels 000 and 111 represent?

    1. A

      000 represents a missing feature and 111 represents a measured feature

    2. B

      000 represents a training example and 111 represents a testing example

    3. C

      000 represents an authentic bill and 111 represents a counterfeit bill

    4. D

      000 represents a counterfeit bill and 111 represents an authentic bill

    Correct answer
    C

    000 represents an authentic bill and 111 represents a counterfeit bill

    Explanation

    The human-labeled data uses 000 for genuine banknotes and 111 for counterfeit banknotes.

  56. 56

    What is the correct purpose of model.fit in the described scikit-learn workflow?

    1. A

      It converts a trained model into a cluster center

    2. B

      It evaluates the model only on previously unseen testing examples

    3. C

      It trains the model using input features and their corresponding labels

    4. D

      It randomly assigns labels to the input data

    Correct answer
    C

    It trains the model using input features and their corresponding labels

    Explanation

    model.fit uses the training inputs and labels to learn the model parameters.

  57. 57

    How is classification accuracy calculated in the banknote example?

    1. A

      By measuring the distance between every pair of banknotes

    2. B

      By counting the number of input features in each banknote

    3. C

      By comparing predicted labels with actual labels and counting the matches

    4. D

      By averaging the numerical values of all banknote measurements

    Correct answer
    C

    By comparing predicted labels with actual labels and counting the matches

    Explanation

    Accuracy is determined by comparing each prediction with its actual label and calculating the proportion classified correctly.

  58. 58

    What is the structure of a Markov decision process?

    1. A

      Inputs, outputs, nearest neighbors, and confidence intervals

    2. B

      Weights, thresholds, folds, and regularization parameters

    3. C

      States, available actions, transition probabilities, and rewards

    4. D

      Labels, cluster centers, distances, and regression errors

    Correct answer
    C

    States, available actions, transition probabilities, and rewards

    Explanation

    A Markov decision process represents states, actions available in each state, transitions resulting from actions, and rewards for those transitions.

  59. 59

    How does a Markov decision process extend a Markov chain?

    1. A

      It allows transitions only when the agent receives a positive reward

    2. B

      It replaces states with fixed supervised labels

    3. C

      It allows an agent to choose actions that influence possible state transitions

    4. D

      It removes all probabilities from state transitions

    Correct answer
    C

    It allows an agent to choose actions that influence possible state transitions

    Explanation

    A Markov chain transitions according to probabilities, whereas a Markov decision process adds agent-selected actions and rewards.

  60. 60

    What does the transition model in a Markov decision process describe?

    1. A

      The probability that a label was assigned correctly by a human

    2. B

      The complexity penalty assigned to a hypothesis

    3. C

      The distance between a point and its nearest neighbor

    4. D

      The probability of reaching a next state given a current state and action

    Correct answer
    D

    The probability of reaching a next state given a current state and action

    Explanation

    The transition model specifies how likely each next state is, conditioned on the current state and chosen action.

  61. 61

    What information does an agent receive after taking an action in a state?

    1. A

      The exact value of every possible action

    2. B

      The labels of every possible future state

    3. C

      A resulting state and a numerical reward

    4. D

      The complete optimal policy for the environment

    Correct answer
    C

    A resulting state and a numerical reward

    Explanation

    The agent observes the new state and receives a positive or negative numerical reward.

  62. 62

    What does the Q-function estimate in Q-learning?

    1. A

      The distance between two supervised-learning inputs

    2. B

      The probability that a data point belongs to a cluster

    3. C

      The number of states in the entire environment

    4. D

      The expected value of taking action aaa in state sss

    Correct answer
    D

    The expected value of taking action aaa in state sss

    Explanation

    Q(s,a)Q(s,a)Q(s,a) estimates how much reward an agent can expect from taking action aaa in state sss.

  63. 63

    Why is Q(s,a)Q(s,a)Q(s,a) initially set to 000 for all state-action pairs in the described approach?

    1. A

      The environment contains no possible positive rewards

    2. B

      A zero initialization prevents the agent from ever exploring

    3. C

      The agent has no experience yet from which to estimate action values

    4. D

      Every action is known in advance to produce zero reward

    Correct answer
    C

    The agent has no experience yet from which to estimate action values

    Explanation

    Before interacting with the environment, the agent has no knowledge about the value of any state-action pair, so all values start at zero.

  64. 64

    What two components contribute to the new Q-value estimate after an action?

    1. A

      The training loss and the testing loss

    2. B

      The current state label and the nearest data point

    3. C

      The number of actions and the number of clusters

    4. D

      The immediate reward and the expected future rewards

    Correct answer
    D

    The immediate reward and the expected future rewards

    Explanation

    Q-learning considers both the reward obtained immediately and the best expected value from future actions.

  65. 65

    What does the learning-rate parameter �alpha�alpha�alpha control in the Q-learning update?

    1. A

      The balance between the existing Q-value and new experience

    2. B

      The number of actions available in each state

    3. C

      The total number of rewards in the environment

    4. D

      The probability that a transition is deterministic

    Correct answer
    A

    The balance between the existing Q-value and new experience

    Explanation

    In Q-learning, �alpha�alpha�alpha determines how much the new estimate changes the current Q-value.

  66. 66

    What is a greedy policy in reinforcement learning?

    1. A

      Choosing the action with the lowest immediate reward

    2. B

      Choosing the action with the highest estimated Q-value

    3. C

      Choosing an action randomly in every state

    4. D

      Choosing the action that was tried most recently

    Correct answer
    B

    Choosing the action with the highest estimated Q-value

    Explanation

    A greedy policy selects the action currently estimated to have the greatest value.

  67. 67

    What is the exploration-exploitation trade-off?

    1. A

      Balancing training data with testing labels

    2. B

      Balancing classification accuracy with the number of input features

    3. C

      Balancing the use of known good actions with trying unfamiliar actions

    4. D

      Balancing cluster size with the number of decision boundaries

    Correct answer
    C

    Balancing the use of known good actions with trying unfamiliar actions

    Explanation

    Exploitation uses known information, while exploration investigates alternatives that may produce better future rewards.

  68. 68

    How does the epsilon-greedy algorithm promote exploration?

    1. A

      It always chooses a random action with probability 111

    2. B

      It eliminates all actions whose Q-values are unknown

    3. C

      It chooses the worst-known action with probability 1−�epsilon1-�epsilon1−�epsilon

    4. D

      It chooses a random action with probability �epsilon�epsilon�epsilon and the best-known action otherwise

    Correct answer
    D

    It chooses a random action with probability �epsilon�epsilon�epsilon and the best-known action otherwise

    Explanation

    With probability �epsilon�epsilon�epsilon, the agent explores randomly; with probability 1−�epsilon1-�epsilon1−�epsilon, it exploits the action with the highest estimated value.

  69. 69

    Why might an agent decrease �epsilon�epsilon�epsilon over time?

    1. A

      A smaller �epsilon�epsilon�epsilon removes the need to estimate Q-values

    2. B

      A smaller �epsilon�epsilon�epsilon guarantees that every state has been visited

    3. C

      After gaining experience, it can exploit more often while exploring less

    4. D

      Decreasing �epsilon�epsilon�epsilon increases the randomness of every decision

    Correct answer
    C

    After gaining experience, it can exploit more often while exploring less

    Explanation

    Early exploration can reveal useful actions; later, once the agent is more informed, it may rely more on its best-known choices.

  70. 70

    What is the rule for removing objects in the game of Nim described in the content?

    1. A

      A player adds objects to one pile before removing an object

    2. B

      A player may remove objects from several piles but never an entire pile

    3. C

      A player removes one or more objects from exactly one pile per turn

    4. D

      A player removes exactly one object from every pile per turn

    Correct answer
    C

    A player removes one or more objects from exactly one pile per turn

    Explanation

    On each turn, a player chooses one pile and removes at least one object, possibly removing many from that pile.

  71. 71

    What is the losing condition in the described version of Nim?

    1. A

      The player who removes the last object loses

    2. B

      The player who leaves the most objects loses

    3. C

      The player who removes the first object loses

    4. D

      The player who removes objects from the largest pile loses

    Correct answer
    A

    The player who removes the last object loses

    Explanation

    The rule states that whoever takes the last object loses the game.

  72. 72

    Why is Nim relatively convenient for a basic reinforcement-learning demonstration?

    1. A

      The game has no possible punishments or negative rewards

    2. B

      A state can be represented by the number of objects in each pile

    3. C

      Every state has exactly one legal action

    4. D

      The winning action is explicitly provided before every turn

    Correct answer
    B

    A state can be represented by the number of objects in each pile

    Explanation

    Nim has a compact state representation: the state is determined by the object count in each pile.

  73. 73

    What is function approximation used for in reinforcement learning?

    1. A

      Replacing every reward with a human-provided label

    2. B

      Grouping unlabeled data points into visual clusters

    3. C

      Estimating action values when the state-action space is too large to enumerate

    4. D

      Ensuring that every possible state is visited exactly once

    Correct answer
    C

    Estimating action values when the state-action space is too large to enumerate

    Explanation

    In large environments such as chess, a function can estimate Q-values from features instead of storing a separate value for every state-action pair.

  74. 74

    What is the main difference between supervised and reinforcement learning?

    1. A

      Supervised learning is always unsupervised, whereas reinforcement learning is always regression

    2. B

      Supervised learning never uses numerical data, whereas reinforcement learning always uses images

    3. C

      Supervised learning has no outputs, whereas reinforcement learning has fixed labels

    4. D

      Supervised learning uses labeled input-output pairs, whereas reinforcement learning uses experience and rewards

    Correct answer
    D

    Supervised learning uses labeled input-output pairs, whereas reinforcement learning uses experience and rewards

    Explanation

    Supervised learning begins with labeled examples, while reinforcement learning learns through interaction and reward feedback.

  75. 75

    How does kkk-means clustering assign a data point during one iteration?

    1. A

      It assigns the point to the cluster with the largest label

    2. B

      It assigns the point according to a human-provided category

    3. C

      It assigns the point to every cluster equally

    4. D

      It assigns the point to the cluster whose center is closest

    Correct answer
    D

    It assigns the point to the cluster whose center is closest

    Explanation

    After cluster centers are chosen, each point is assigned to its nearest center.

  76. 76

    What happens when kkk-means recenters a cluster?

    1. A

      The cluster center moves to the mean of the points assigned to it

    2. B

      The cluster center is replaced by a randomly selected label

    3. C

      Every point moves to the global mean of the entire data set

    4. D

      The cluster center moves to the farthest point in the cluster

    Correct answer
    A

    The cluster center moves to the mean of the points assigned to it

    Explanation

    The center is recalculated as the average position of the points currently assigned to that cluster.

  77. 77

    What is the iterative sequence used by kkk-means clustering?

    1. A

      Label points manually, remove centers, and train a perceptron

    2. B

      Assign points to nearest centers, recenter the clusters, and repeat

    3. C

      Choose the farthest points, assign all points randomly, and stop

    4. D

      Calculate rewards, update Q-values, and select greedy actions

    Correct answer
    B

    Assign points to nearest centers, recenter the clusters, and repeat

    Explanation

    kkk-means alternates between assigning points to the nearest center and moving each center to the mean of its assigned points.

  78. 78

    When does the described kkk-means process stop?

    1. A

      When every cluster contains exactly the same number of points

    2. B

      When the first set of random centers is selected

    3. C

      When assigning points and updating centers produces no further changes

    4. D

      When all points are assigned to one cluster

    Correct answer
    C

    When assigning points and updating centers produces no further changes

    Explanation

    The algorithm reaches equilibrium when points no longer change cluster assignments after the updates.

  79. 79

    What must be selected before running kkk-means clustering?

    1. A

      The exact equation of the final decision boundary

    2. B

      The desired number of clusters, represented by kkk

    3. C

      The correct label for every data point

    4. D

      The reward for every possible action

    Correct answer
    B

    The desired number of clusters, represented by kkk

    Explanation

    The value of kkk specifies how many clusters the algorithm should create.

  80. 80

    Which situation is an application of clustering?

    1. A

      Grouping consumers into similar segments for market research

    2. B

      Calculating the absolute error of a sales prediction

    3. C

      Predicting whether tomorrow will be rainy using labeled weather records

    4. D

      Choosing a game action from an estimated Q-value

    Correct answer
    A

    Grouping consumers into similar segments for market research

    Explanation

    Market research can use clustering to group consumers with similar characteristics without requiring predefined labels.

  81. 81

    Why is clustering considered unsupervised in the described examples?

    1. A

      The algorithm uses only data with binary labels

    2. B

      The algorithm discovers groups without being given labels for the groups

    3. C

      The algorithm receives a reward after every assignment

    4. D

      The algorithm must be trained using a testing set

    Correct answer
    B

    The algorithm discovers groups without being given labels for the groups

    Explanation

    Clustering identifies structure in unlabeled data rather than learning from human-provided category labels.

Question 1 of 81
Question 1 of 81

Ask anything

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

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent