1. Home
  2. Explore
  3. Mathematics
  4. Linear Regression

Study methods

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

Linear Regression

  • 67Unfamiliar
  • 0Learning
  • 0Familiar
  • 0Mastered
Topic: Learning Foundations

What is the main goal of linear regression when applied to experimental data?

67 questions

  1. 1

    What is the main goal of linear regression when applied to experimental data?

    Model answer

    Linear regression deduces a model, such as a line or curve, that best fits observed data and can be used to predict new outcomes.

    Explanation

    For example, mass-displacement measurements from a spring can be used to infer a relationship and predict displacement for masses not yet tested.

  2. 2

    How can validation help select a regression model?

    Model answer

    Validation compares candidate models, such as linear, quadratic, or cubic models, to determine which generalizes best to the data.

    Explanation

    Validation helps explore model choices rather than assuming in advance that one particular form is correct.

  3. 3

    According to the definition presented by Art Samuel, what is machine learning?

    Model answer

    Machine learning is the field of study that gives computers the ability to learn without being explicitly programmed.

    Explanation

    The essential idea is that the computer improves or constructs a method from experience instead of receiving every rule directly from the programmer.

  4. 4

    How did Samuel's checkers program demonstrate machine learning?

    Model answer

    It improved its checkers strategy by examining its game results and inferring changes to make in future games.

    Explanation

    The program learned from experience and defeated national-level players rather than relying only on a completely fixed strategy.

  5. 5

    Contrast memorizing facts with inferring new information as ways of learning.

    Model answer

    Memorization stores explicit facts, whereas inference uses existing information or patterns to deduce new information.

    Explanation

    Memorization resembles declarative knowledge, while inference is closer to imperative knowledge because it supports deriving additional conclusions.

  6. 6

    What makes linear regression a simple example of machine learning?

    Model answer

    It uses supplied data to learn a model, such as a spring equation, that can then predict outcomes for previously unseen inputs.

    Explanation

    The computer is not merely applying a fully specified answer; it infers model parameters from observations.

  7. 7

    What three-part paradigm underlies the machine-learning process described in the lecture?

    Model answer

    The system receives training observations, infers a model or program for the process that generated them, and uses that model to make predictions about unseen cases.

    Explanation

    The spring example contains all three elements: measured data, an inferred relationship, and predictions of new displacements.

  8. 8

    In the football-player example, what are the examples, features, and labels?

    Model answer

    Each football player is an example, height and weight are the features, and playing position is the label.

    Explanation

    The learned relationship is intended to use player characteristics to predict the position of a new player.

  9. 9

    Why are machine-learning methods important across many areas of computing?

    Model answer

    They are widely used in areas such as natural-language processing, computational biology, computer vision, robotics, recommendations, and medical diagnosis.

    Explanation

    The lecture emphasizes that machine learning is prevalent in applications including Go-playing systems, advertising, drug discovery, character recognition, face recognition, and autonomous driving.

  10. 10

    What is the difference between traditional programming and the machine-learning approach?

    Model answer

    Traditional programming supplies code that transforms input data into output, while machine learning supplies examples or labeled outputs so the computer can infer a program or model.

    Explanation

    In the machine-learning approach, the learned program is later used to infer information about new inputs.

  11. 11

    What is supervised learning?

    Model answer

    Supervised learning uses training examples that have known labels to learn a rule for predicting labels of unseen inputs.

    Explanation

    It is called supervised because the correct category for each training example provides guidance during learning.

  12. 12

    What is unsupervised learning?

    Model answer

    Unsupervised learning receives examples without known labels and attempts to discover natural groupings or structures among them.

    Explanation

    The system may be told how many groups to seek or may search for an appropriate grouping on its own.

  13. 13

    Compare classification and clustering.

    Model answer

    Classification learns to assign examples to known labeled classes, whereas clustering groups unlabeled examples according to their similarity.

    Explanation

    Classification is associated with supervised learning, while clustering is a standard unsupervised-learning task.

  14. 14

    When is classification generally more appropriate than clustering?

    Model answer

    Classification is appropriate when training examples have known labels and the goal is to predict the label of a new example.

    Explanation

    For example, labeled football players can be used to predict whether a new player is more likely to be a receiver or a lineman.

  15. 15

    When is clustering generally more appropriate than classification?

    Model answer

    Clustering is appropriate when examples lack labels and the goal is to discover natural groups among them.

    Explanation

    The method groups examples based on proximity or similarity rather than using known category assignments.

  16. 16

    What is the purpose of features in a machine-learning representation?

    Model answer

    Features represent measurable characteristics of each example that can be used to compare examples and make predictions.

    Explanation

    Height and weight, for instance, provide a feature representation of football players.

  17. 17

    Why can almost any computer program be argued to learn something, yet still differ from a strong learning algorithm?

    Model answer

    A program may improve or generalize in a very limited sense, but a strong learning algorithm infers useful patterns or a model from experience rather than having every procedure explicitly programmed.

    Explanation

    Newton's method for square roots can be viewed as learning only in a stretched sense because its procedure was explicitly supplied.

  18. 18

    What is the role of labels in supervised learning?

    Model answer

    Labels identify the class or outcome associated with each training example and guide the system in learning how to classify new examples.

    Explanation

    In the football example, the labels identify positions such as receiver and lineman.

  19. 19

    What objective does distance-based clustering try to achieve?

    Model answer

    It aims to make examples within each cluster close to one another while keeping different clusters reasonably far apart.

    Explanation

    A common objective is to make the average within-cluster distance as small as possible.

  20. 20

    Describe the basic initialization step of the clustering procedure presented.

    Model answer

    Choose the desired number of exemplar examples, preferably examples that are far apart, to serve initially as cluster representatives.

    Explanation

    Choosing representatives that are too close together can produce a poor initial division.

  21. 21

    How does the clustering algorithm initially assign examples to clusters?

    Model answer

    Each example is assigned to the cluster whose exemplar is closest to it according to the selected distance measure.

    Explanation

    This creates groups based on proximity to their current representatives.

  22. 22

    How are cluster exemplars updated in the described clustering method?

    Model answer

    After assigning examples, the algorithm selects the median element of each cluster—the example closest to the cluster's center—as the new exemplar.

    Explanation

    The method then repeats assignment and exemplar updating using these new representatives.

  23. 23

    When does the iterative clustering procedure stop?

    Model answer

    It can stop after a predetermined number of iterations or when the assignments and exemplars no longer change.

    Explanation

    Either stopping rule indicates that further repetitions are not producing meaningful changes in the clustering.

  24. 24

    Why did using both height and weight produce a better football-player clustering than using height alone?

    Model answer

    The two-dimensional representation placed similar players closer together and produced a more natural separation between receivers and linemen.

    Explanation

    Height alone produced a less clean division, while the combined feature space separated the groups more effectively.

  25. 25

    What does the equidistant line between two cluster centers represent?

    Model answer

    It is the boundary containing points that are equally distant from the centers of the two clusters.

    Explanation

    A new point on one side of the line is assigned to the corresponding cluster because it is closer to that cluster's center.

  26. 26

    How would a distance-based clustering model classify a new football player located near the boundary between two clusters?

    Model answer

    Its classification would be uncertain because it is nearly equally distant from both cluster centers.

    Explanation

    Such an example may motivate reconsidering the clustering or considering whether more than two groups exist.

  27. 27

    Why might adding a third cluster improve the football-player grouping?

    Model answer

    A third cluster can represent an intermediate group, such as running backs, and produce tighter, more natural groups than forcing all examples into two clusters.

    Explanation

    The three-cluster result separated groups of five, four, and three players with lower average within-cluster distances.

  28. 28

    Why is creating one cluster per example a poor clustering strategy?

    Model answer

    Although each example would be maximally close to its own cluster center, the result would not provide useful general groupings or labels for new data.

    Explanation

    This illustrates why clustering must balance closeness with an appropriate model complexity.

  29. 29

    Why should clustering avoid overly complicated cluster boundaries?

    Model answer

    Overly complicated boundaries can overfit the training data and fail to generalize well to new examples.

    Explanation

    If close or overlapping examples can only be separated by a convoluted boundary, it may be better to tolerate some errors.

  30. 30

    What is feature engineering?

    Model answer

    Feature engineering is the design process of deciding which characteristics to measure and how to represent them for a learning algorithm.

    Explanation

    It includes selecting useful dimensions for the feature vector and deciding how those dimensions should be scaled or represented.

  31. 31

    Why do some features provide more useful information than others?

    Model answer

    Some features carry information related to the target outcome, while others are irrelevant or mostly noise.

    Explanation

    For predicting programming performance, GPA and prior programming experience may be useful, whereas eye color and astrological sign are unlikely to be informative.

  32. 32

    What is the signal-to-noise ratio meant to capture in feature selection?

    Model answer

    It reflects the amount of useful predictive information in selected features relative to irrelevant variation or noise.

    Explanation

    Feature selection seeks to retain informative characteristics and remove features that do not help distinguish the target classes.

  33. 33

    Why can including irrelevant features cause overfitting?

    Model answer

    An algorithm may find accidental correlations between irrelevant features and the target in the training data, producing a model that does not generalize.

    Explanation

    For example, it might incorrectly associate birth month or eye color with programming performance.

  34. 34

    How did the reptile examples show that a classification model must be refined as new data arrive?

    Model answer

    New examples such as boa constrictors and alligators violated earlier rules, requiring the model to remove or modify features and rules.

    Explanation

    A rule that initially used egg-laying, scales, poisonousness, cold-bloodedness, and absence of legs could not classify all later examples correctly.

  35. 35

    Which simplified features initially captured the three snake examples in the reptile example?

    Model answer

    The features of having scales, being cold-blooded, and having legs represented as absent captured the three initial snake examples.

    Explanation

    These features generalized from the cobra and boa constrictor examples more effectively than the original five-feature rule.

  36. 36

    How did the chicken and dart frog examples help evaluate the reptile model?

    Model answer

    They served as negative examples that did not satisfy the relevant reptile features, reinforcing the model's ability to reject some non-reptiles.

    Explanation

    The chicken was not cold-blooded and had legs, while the dart frog lacked scales and was not cold-blooded.

  37. 37

    Why could the selected features not distinguish a python from a salmon?

    Model answer

    The python and salmon had the same values for scales, cold-bloodedness, and number of legs, so no rule using only those features could separate them.

    Explanation

    When two differently labeled examples have identical feature values, the representation provides no basis for distinguishing them.

  38. 38

    What design choice was made in the final reptile rule involving scales and cold-bloodedness?

    Model answer

    An animal was classified as a reptile if it had scales and was cold-blooded, accepting some false positives in order to avoid false negatives.

    Explanation

    This rule incorrectly labels salmon as a reptile but does not label a known reptile as non-reptile in the examples.

  39. 39

    What is the general Minkowski distance between two feature vectors?

    Model answer

    For vectors xxx and yyy, the Minkowski distance with power ppp is d(x,y)=(∑i∣xi−yi∣p)1/pd(x,y)=\left(\sum_i |x_i-y_i|^p\right)^{1/p}d(x,y)=(∑i​∣xi​−yi​∣p)1/p.

    Explanation

    It takes the componentwise absolute differences, raises them to the pppth power, sums them, and takes the pppth root.

  40. 40

    What distance metric results from setting p=1p=1p=1 in the Minkowski metric?

    Model answer

    Setting p=1p=1p=1 gives the Manhattan distance, d(x,y)=∑i∣xi−yi∣d(x,y)=\sum_i |x_i-y_i|d(x,y)=∑i​∣xi​−yi​∣.

    Explanation

    It adds the absolute differences across dimensions, analogous to traveling along streets and avenues rather than directly across a plane.

  41. 41

    What distance metric results from setting p=2p=2p=2 in the Minkowski metric?

    Model answer

    Setting p=2p=2p=2 gives Euclidean distance, d(x,y)=∑i(xi−yi)2d(x,y)=\sqrt{\sum_i (x_i-y_i)^2}d(x,y)=∑i​(xi​−yi​)2​.

    Explanation

    This is the ordinary straight-line distance in a multidimensional space.

  42. 42

    Why can the choice of distance metric change which examples are considered closest?

    Model answer

    Different metrics combine differences across dimensions differently, so the same pairings can have different relative distances under Euclidean and Manhattan distance.

    Explanation

    In the geometric example, one pairing was closer under Euclidean distance while another was closer under Manhattan distance.

  43. 43

    Why did Euclidean distance make the alligator appear closer to the dart frog than desired?

    Model answer

    The number-of-legs dimension ranged from 000 to 444, so its numerical difference contributed much more to Euclidean distance than binary feature differences.

    Explanation

    The alligator differed from the frog in fewer binary features but differed substantially in the legs dimension, distorting the distance calculation.

  44. 44

    How could Manhattan distance improve the animal comparison involving snakes, an alligator, and a dart frog?

    Model answer

    Manhattan distance would count feature differences more directly and would avoid making the larger numerical legs difference dominate as strongly.

    Explanation

    Under this metric, the alligator differs from the snakes in fewer feature dimensions and is therefore placed closer to them.

  45. 45

    How could recoding the number of legs improve the animal feature representation?

    Model answer

    The number-of-legs feature could be converted from an integer to a binary feature indicating whether the animal has legs.

    Explanation

    This prevents a difference such as 000 versus 444 legs from receiving four times the numerical separation of a binary feature difference.

  46. 46

    Why does the scale of a feature dimension matter when using distance?

    Model answer

    A dimension with a larger numerical scale can dominate the distance calculation even if it is not more informative than the other dimensions.

    Explanation

    The legs dimension illustrated how a range of 000 to 444 can outweigh binary dimensions represented only by 000 and 111.

  47. 47

    What are the five essential components that must be considered in a machine-learning method?

    Model answer

    They are the training data, the evaluation method, the representation or features, the distance or similarity measure, and the optimization method used to learn the model.

    Explanation

    The lecture emphasizes that the designer must decide what data to use, how to represent and compare instances, how to evaluate success, and how to optimize the model.

  48. 48

    Why must the number of clusters be treated as a model-design decision?

    Model answer

    Too few clusters may combine genuinely different groups, while too many clusters may overfit by creating overly specific groups.

    Explanation

    Choosing one cluster per example gives excellent within-cluster closeness but poor generalization and usefulness.

  49. 49

    What is the main classification objective when labeled examples are available?

    Model answer

    The objective is to find a separating rule or surface that assigns labeled training examples to their appropriate classes and generalizes to new examples.

    Explanation

    In two dimensions the separator may be a line; in higher dimensions it may be a plane or another surface.

  50. 50

    Why might a classifier intentionally tolerate some incorrectly labeled training examples?

    Model answer

    It may tolerate errors to avoid using an overly complicated boundary that overfits the training data.

    Explanation

    A simpler rule that generalizes can be preferable to a perfect but convoluted separator.

  51. 51

    How would the labeled football-player classifier classify the two new running backs?

    Model answer

    Using the learned weight boundary, both would be classified as more likely to be receivers because both fall below the separating line.

    Explanation

    The labeled boundary provided a clearer decision than the unlabeled cluster boundary, which left one running back ambiguous.

  52. 52

    What is the basic idea of the kkk-nearest-neighbor method?

    Model answer

    For a new example, find the kkk closest labeled training examples and use their labels to decide the new example's class.

    Explanation

    The method assigns the new point according to a vote among its nearest labeled neighbors.

  53. 53

    How does kkk-nearest neighbors use voting to classify a new example?

    Model answer

    If a majority of the kkk nearest examples share a label, the new example is assigned that label; otherwise it may remain unclassified.

    Explanation

    For example, three, four, or five matching labels among five neighbors can support assigning that class.

  54. 54

    Why is a test set used separately from training data?

    Model answer

    A test set evaluates how well a learned model generalizes to unseen examples rather than merely measuring how well it fits the data used to train it.

    Explanation

    The voting-data example reserved half the data for testing and used the other half for training.

  55. 55

    What does a confusion matrix compare?

    Model answer

    A confusion matrix compares a classifier's predicted labels with the actual labels of the examples.

    Explanation

    Its diagonal entries represent correctly classified cases, while off-diagonal entries represent classification errors.

  56. 56

    Define a true positive and a true negative.

    Model answer

    A true positive is an example correctly labeled as belonging to the target class, while a true negative is an example correctly labeled as not belonging to that class.

    Explanation

    Both are correct predictions and contribute to the numerator of accuracy.

  57. 57

    Define a false positive and a false negative.

    Model answer

    A false positive occurs when an example is labeled as belonging to the target class but does not; a false negative occurs when an example is labeled as not belonging to the class but actually does.

    Explanation

    In the reptile example, labeling salmon as a reptile is a false positive.

  58. 58

    How is classification accuracy calculated?

    Model answer

    Accuracy is the fraction of all predictions that are correct: accuracy=true positives+true negativesall examples\text{accuracy}=\frac{\text{true positives}+\text{true negatives}}{\text{all examples}}accuracy=all examplestrue positives+true negatives​.

    Explanation

    The two candidate straight-line classifiers in the voting example each achieved an accuracy of 0.70.70.7 on the evaluated data.

  59. 59

    Why can a classifier with lower training error still be worse overall?

    Model answer

    A model with lower training error may be more complex and overfit the training data, causing poorer performance on unseen test data.

    Explanation

    The complex voting classifier had training accuracy of about 0.8330.8330.833 but test accuracy of only about 0.60.60.6.

  60. 60

    What is positive predictive value (PPV)?

    Model answer

    PPV is the proportion of examples predicted positive that are actually positive: PPV=true positivestrue positives+false positives\text{PPV}=\frac{\text{true positives}}{\text{true positives}+\text{false positives}}PPV=true positives+false positivestrue positives​.

    Explanation

    It measures how trustworthy the classifier's positive predictions are.

  61. 61

    What does sensitivity measure?

    Model answer

    Sensitivity measures the proportion of actual positive examples that the classifier correctly identifies.

    Explanation

    It is the ability to find members of the target class rather than incorrectly rejecting them.

  62. 62

    What does specificity measure?

    Model answer

    Specificity measures the proportion of actual negative examples that the classifier correctly rejects.

    Explanation

    It reflects how well the classifier avoids labeling nonmembers as positive.

  63. 63

    Why is there a trade-off between sensitivity and specificity?

    Model answer

    A classifier can increase sensitivity by labeling more examples as positive, but this usually increases false positives and lowers specificity; rejecting more examples has the opposite effect.

    Explanation

    Labeling everything positive gives sensitivity of 111 and specificity of 000, while labeling nothing positive gives specificity of 111 and sensitivity of 000.

  64. 64

    What is the purpose of a receiver operating characteristic (ROC) curve?

    Model answer

    An ROC curve helps evaluate and choose classifiers by showing the trade-off between sensitivity and specificity as the decision rule changes.

    Explanation

    It provides a way to examine how accepting more positive predictions affects correct rejection of negative examples.

  65. 65

    Why might a complex sequence of line segments be used instead of one straight line for classification?

    Model answer

    A sequence of line segments can separate classes when no single straight line provides a satisfactory division.

    Explanation

    However, the added complexity must be controlled because a highly detailed boundary may overfit the training data.

  66. 66

    How do clustering and classification differ in their treatment of new data?

    Model answer

    Clustering assigns new data according to proximity to discovered groups, while classification assigns new data according to a rule learned from labeled examples.

    Explanation

    Both can label new instances, but they derive their decision structures from unlabeled groupings versus known class labels.

  67. 67

    Why is choosing an appropriate distance measure a design decision rather than a purely mechanical step?

    Model answer

    Different distance measures and feature scales emphasize different aspects of the examples, which can change clustering and classification results.

    Explanation

    The comparison of Euclidean and Manhattan metrics showed that the selected metric can reverse which examples appear closest.

1 of 67
Question 1 of 67

Ask anything

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

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent