1. Home
  2. Explore
  3. Computer Science
  4. Machine Learning Fundamentals

Study methods

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

Machine Learning Fundamentals

  • 70Unfamiliar
  • 0Learning
  • 0Familiar
  • 0Mastered
Topic: Machine Learning Foundations

What is machine learning, and how does it differ from traditional programming?

70 questions

  1. 1

    What is machine learning, and how does it differ from traditional programming?

    Model answer

    Machine learning is a subset of artificial intelligence that enables computer systems to perform tasks without explicit programming. Instead of relying on fixed rules, the system learns patterns from data.

    Explanation

    Traditional programming uses explicitly coded instructions, such as if-else conditions, while machine learning infers useful relationships from examples.

  2. 2

    How does a machine-learning algorithm use training data to make predictions on new data?

    Model answer

    The algorithm learns patterns from labeled or unlabeled training data and uses those learned patterns to make predictions when previously unseen data is provided.

    Explanation

    In supervised settings, the algorithm learns to predict labels; the goal is for that knowledge to generalize to new instances.

  3. 3

    Apply the idea of machine learning to email spam detection.

    Model answer

    A model can learn from examples of spam and non-spam emails and then classify new email messages as either spam or not spam.

    Explanation

    The email text, or a tokenized version of it, serves as input to the classification system.

  4. 4

    Why is spam detection a binary-classification problem?

    Model answer

    It is binary classification because the model assigns each email to one of two classes: spam or not spam.

    Explanation

    A binary classifier predicts between exactly two possible categories.

  5. 5

    What types of information can serve as input to an email spam classifier?

    Model answer

    The input can be the email message itself, represented as raw text or as a tokenized form of the text.

    Explanation

    Tokenization converts text into units that a model can process as features.

  6. 6

    How might traditional spam-detection systems have operated before modern machine learning became common?

    Model answer

    They likely relied on hard-coded rules or natural-language-processing techniques to identify spam.

    Explanation

    These systems attempted to recognize spam through manually specified patterns rather than learned representations.

  7. 7

    Why can deep learning improve on traditional rule-based approaches for spam detection?

    Model answer

    Deep learning can learn complex patterns from data and may generalize better to changing or previously unseen forms of spam.

    Explanation

    Modern learned models are less dependent on manually writing a rule for every possible message variation.

  8. 8

    Describe the traditional workflow for solving a problem with hard-coded rules.

    Model answer

    A developer studies the problem, writes a set of rules, evaluates whether the solution performs well, and either deploys it or revises the rules.

    Explanation

    Poor performance sends the developer back to the drawing board, while acceptable performance permits deployment.

  9. 9

    Why do hard-coded rule systems become difficult to maintain?

    Model answer

    They can contain thousands of lines of complex code, making it difficult and expensive to understand, modify, and maintain.

    Explanation

    Maintenance becomes especially challenging when the people modifying the system are unfamiliar with its codebase.

  10. 10

    Why can hard-coded rules become obsolete in spam detection?

    Model answer

    Spammers can change the wording and structure of their messages, causing rules based on older patterns to stop recognizing new spam.

    Explanation

    A rule-based detector is not automatically dynamic, so changes in the data can reduce its effectiveness.

  11. 11

    Why may hard-coded rules fail to handle all future email formats?

    Model answer

    Future emails may contain different paragraphs, images, or other structures that were not anticipated when the rules were written.

    Explanation

    A fixed rule set may not capture every possible variation in real-world data.

  12. 12

    What is a false positive in spam detection?

    Model answer

    A false positive occurs when a legitimate email is incorrectly classified as spam.

    Explanation

    A useful spam detector should minimize this type of error because it incorrectly rejects a non-spam message.

  13. 13

    Why are some problems, such as speech recognition, difficult to solve with hard-coded rules?

    Model answer

    Speech contains complex and varying frequencies and patterns, making it impractical to write fixed rules that convert every spoken signal into the correct classification.

    Explanation

    Machine learning is useful because it can learn these complex relationships from examples.

  14. 14

    What is the basic machine-learning workflow for addressing a problem?

    Model answer

    The workflow involves studying the problem, training a model on data, evaluating its accuracy, revising the data or algorithm if performance is poor, and deploying the model if performance is acceptable.

    Explanation

    Unlike a purely rule-based workflow, the prediction mechanism is learned from training data.

  15. 15

    What are three advantages of a machine-learning approach over a large rule-based system?

    Model answer

    Machine-learning solutions can require less code, be easier to maintain and improve, and often achieve better accuracy and generalization.

    Explanation

    Learned models can adapt to new instances without requiring developers to manually encode every new case.

  16. 16

    What is offline learning, also called batch learning?

    Model answer

    Offline or batch learning trains a model on a collected dataset outside production and later replaces the existing production model with the newly trained model.

    Explanation

    The model is trained periodically rather than continuously as each new instance arrives.

  17. 17

    Describe the typical offline-learning model replacement process.

    Model answer

    A new model is trained offline using newly collected data, evaluated, and then used to replace the current model in production if it performs adequately.

    Explanation

    The production model remains in use while the replacement model is prepared.

  18. 18

    Why might an organization retrain an offline model after several months?

    Model answer

    The organization may have collected substantial new data, or the original model may have degraded because the data or predictive relationships changed.

    Explanation

    Periodic retraining helps the model reflect more recent conditions.

  19. 19

    What is online learning?

    Model answer

    Online learning retrains a model in production as new data arrives, often every night or as frequently as practical.

    Explanation

    The model learns from new instances on the fly rather than waiting for a large batch of data.

  20. 20

    What is the main advantage of online learning compared with offline learning?

    Model answer

    Online learning can update the model more quickly as new instances and changing patterns appear.

    Explanation

    This makes it more responsive to recent data than a model retrained only every several months.

  21. 21

    Why can online learning make a model vulnerable to degradation?

    Model answer

    If poor or harmful data enters the training stream, the model may continually learn from it and become progressively worse.

    Explanation

    Because updates occur frequently, bad data can affect the model before it is carefully reviewed.

  22. 22

    How can a fail switch or threshold protect an online-learning system?

    Model answer

    The system can refuse to replace the current model when the newly trained model performs worse on a fixed evaluation set than the production model.

    Explanation

    This prevents an update from degrading performance based on unreliable new data.

  23. 23

    What does the example of a Twitter bot that begins producing offensive or nonsensical text illustrate?

    Model answer

    It illustrates how continuously learning from poor or harmful data can cause an online model to deteriorate over time.

    Explanation

    The model's behavior reflects the quality of the data repeatedly fed into it.

  24. 24

    What is supervised learning?

    Model answer

    Supervised learning trains a model using a labeled training set.

    Explanation

    The labels provide the target outcomes that the model learns to predict.

  25. 25

    What is unsupervised learning?

    Model answer

    Unsupervised learning trains a model using data without labels.

    Explanation

    The model must identify useful structure or patterns without provided target labels.

  26. 26

    What is predictive learning in the context of the presentation?

    Model answer

    Predictive learning refers to models that predict an outcome, such as a numerical value produced by regression.

    Explanation

    Regression is given as an example of a predictive model.

  27. 27

    What is an instance-based model?

    Model answer

    An instance-based model classifies new data points by relating them to existing instances or categories.

    Explanation

    K-nearest neighbors is an example in which a new point is assigned to a region or category based on existing points.

  28. 28

    How can a spam filter combine multiple machine-learning categories?

    Model answer

    It could be a supervised, instance-based model that is trained online as new email examples arrive.

    Explanation

    These categories describe different dimensions of a system, so they can be combined when appropriate.

  29. 29

    What is data drift?

    Model answer

    Data drift occurs when the distribution of one or more features changes, causing a model trained on earlier data to perform worse on the new data.

    Explanation

    The input data itself has changed in a way the model was not trained to handle.

  30. 30

    How does data drift affect model performance?

    Model answer

    When feature distributions change, the model may no longer perform well on the new instances, so its performance deteriorates.

    Explanation

    The model's learned assumptions about the inputs no longer match the data being received.

  31. 31

    What is concept drift?

    Model answer

    Concept drift occurs when the relationship between the target and the features changes so that the previous features are no longer predictive.

    Explanation

    The change concerns the predictive relationship, not merely the distribution of the input features.

  32. 32

    Use the autonomous-vehicle example to explain concept drift in car-accident prediction.

    Model answer

    If autonomous vehicles cause accidents independently of driver age, then driver age is no longer predictive of accidents, representing concept drift.

    Explanation

    The relationship between the target, car accidents, and the feature, driver age, has changed.

  33. 33

    Use the older-driver example to explain data drift.

    Model answer

    If a dataset begins containing many more older drivers than before, the feature distribution has changed, and the model may perform poorly on that new population.

    Explanation

    The predictive relationship may remain the same, but the types or proportions of inputs have shifted.

  34. 34

    What is the key difference between data drift and concept drift?

    Model answer

    Data drift is a change in the distribution of features, whereas concept drift is a change in the relationship between the features and the target.

    Explanation

    Data drift changes what inputs are observed; concept drift changes what those inputs mean for prediction.

  35. 35

    Why should machine-learning practitioners begin a project by understanding the business problem?

    Model answer

    Models are tools for solving business use cases, so practitioners must define the actual problem, its scope, and the desired solution before choosing technical methods.

    Explanation

    Focusing only on modeling metrics can miss the business objective the project is meant to address.

  36. 36

    What should practitioners do with stakeholders during the problem-definition stage?

    Model answer

    They should define the problem, ask questions to understand its full scope, create a solution plan, and use stakeholders' domain knowledge for guidance.

    Explanation

    Stakeholders often understand the business problem more deeply because they have worked with it for a longer time.

  37. 37

    Why are domain experts valuable to a machine-learning project?

    Model answer

    They provide business and technical knowledge about the problem, its context, and meaningful outcomes that the data scientist may not yet possess.

    Explanation

    For example, insurance actuaries can guide models involving insurance problems because of their industry expertise.

  38. 38

    What is exploratory data analysis, and what is its purpose in a machine-learning project?

    Model answer

    Exploratory data analysis involves collecting and examining data to determine whether it supports the business problem and to discover useful patterns and issues.

    Explanation

    EDA helps practitioners understand the data before building a model.

  39. 39

    Why might a project stop after exploratory data analysis instead of proceeding to a complex model?

    Model answer

    EDA may produce useful dashboards and business insights that are sufficient to address the organization's needs.

    Explanation

    A sophisticated model is not always necessary if simpler analysis already delivers valuable results.

  40. 40

    Why should practitioners review initial EDA findings with stakeholders?

    Model answer

    Stakeholder feedback can confirm whether the analysis is relevant, understandable, and aligned with the original business problem.

    Explanation

    Showing plots and insights helps stakeholders develop a shared understanding of the problem.

  41. 41

    How can plotting targets against features help during EDA?

    Model answer

    It can reveal possible predictive relationships and help practitioners form initial hypotheses about which features may be useful in a model.

    Explanation

    This is an initial, one-way investigation and does not by itself prove that a feature should be used.

  42. 42

    What correlations should practitioners examine during EDA?

    Model answer

    They should examine correlations between the target and features as well as correlations among the features themselves.

    Explanation

    These relationships can provide insight into predictive usefulness and the structure of the data.

  43. 43

    Why should practitioners understand the business meaning of their features before modeling?

    Model answer

    They need to know what each feature represents and how it affects the business so that model inputs are meaningful and appropriate.

    Explanation

    Selecting features without understanding them can lead to poorly reasoned models and misleading conclusions.

  44. 44

    What does ETL stand for, and what does an ETL process do?

    Model answer

    ETL stands for Extract, Transform, and Load. It involves obtaining raw data, cleaning or transforming it, and preparing or loading it for use.

    Explanation

    An ETL architecture helps turn raw sources into data suitable for a modeling project.

  45. 45

    Why should a machine-learning project define an architecture for its ETL process?

    Model answer

    A structured ETL architecture makes it possible to consistently prepare data and rerun the process for future requests or model retraining.

    Explanation

    Without a reusable process, practitioners may have to repeat data preparation from scratch.

  46. 46

    Why is data understanding and collection often more important than building a sophisticated model?

    Model answer

    Poor-quality or insufficient data can produce a poor model, while high-quality data can substantially improve performance even with a simpler model.

    Explanation

    The presentation emphasizes that good data can outperform the benefit of using a more powerful algorithm.

  47. 47

    How can increasing the amount of training data improve an NLP model?

    Model answer

    More data can improve performance by allowing the model to learn across more examples, segments, and levels of abstraction.

    Explanation

    The benefit depends on the application and the model, but additional representative data can strengthen generalization.

  48. 48

    What types of issues should be investigated during data cleaning?

    Model answer

    Practitioners should investigate missing values, invalid values, inconsistent data, and values that require modification or imputation.

    Explanation

    EDA should guide decisions about which data problems need to be corrected.

  49. 49

    How could a negative age value be handled during data preparation?

    Model answer

    The practitioner could investigate the invalid value and apply appropriate minimum or maximum capping and imputation procedures where necessary.

    Explanation

    An age variable should be checked for values that do not make real-world sense.

  50. 50

    What is feature engineering?

    Model answer

    Feature engineering is the creation or modification of input features so they better represent useful information for a model.

    Explanation

    One example is combining age and gender into a new feature for investigation.

  51. 51

    Why should data transformations be placed in a reusable data pipeline?

    Model answer

    A pipeline ensures that future data follows the same transformation steps, making retraining and repeated processing consistent and efficient.

    Explanation

    The pipeline funnels incoming data through the established preparation process.

  52. 52

    What is Luigi used for in the described machine-learning workflow?

    Model answer

    Luigi is a pipelining framework that supports data and modeling workflows through dependencies.

    Explanation

    It can help organize repeatable processing steps and has been used by technology companies.

  53. 53

    What activities occur during the modeling stage of a machine-learning project?

    Model answer

    Practitioners train models, split data into training and testing sets, use methods such as cross-validation, and compare different modeling approaches.

    Explanation

    Possible approaches include classification, regression, and clustering.

  54. 54

    Why should practitioners try multiple modeling approaches when possible?

    Model answer

    Different algorithms may be better suited to different problems, so comparing several approaches can help identify the most effective model.

    Explanation

    The best choice depends on the data structure, task, constraints, and available time.

  55. 55

    Why might K-nearest neighbors be appropriate for a geographical problem?

    Model answer

    K-nearest neighbors can work well because it uses spatial proximity and region-based smoothing, which fit geographical relationships.

    Explanation

    Its use of nearby points can reflect geographic constraints better than a simple linear model in some cases.

  56. 56

    Which types of models might be considered for graph-like data, and why?

    Model answer

    Decision trees or neural networks might be considered because their structures can represent complex, graph-like relationships.

    Explanation

    The model should be selected according to the structure of the problem and its data.

  57. 57

    Why are recurrent neural networks and moving-average models suitable for some time-series problems?

    Model answer

    They are designed to work with sequential or time-dependent patterns, making them appropriate for time-series data.

    Explanation

    Time-series models account for information that changes across time.

  58. 58

    Why should evaluation metrics be explained to stakeholders?

    Model answer

    Stakeholders need to understand what the model is optimizing and how the metric relates to the business goal.

    Explanation

    For example, if the goal is to optimize the Gini index, stakeholders should understand what that metric means.

  59. 59

    Which metrics are associated with evaluating classification models in the presentation?

    Model answer

    Precision and recall are identified as metrics for evaluating classification models.

    Explanation

    Different types of models may require different evaluation measures.

  60. 60

    What is overfitting?

    Model answer

    Overfitting occurs when training accuracy is high but testing accuracy is low because the model has learned noise or overly specific patterns from the training data.

    Explanation

    An overfit model may perform poorly on a different dataset because its learned noise does not generalize.

  61. 61

    What does high variance indicate about a model?

    Model answer

    High variance indicates that a model is highly sensitive to the particular training data and may perform very differently on other datasets.

    Explanation

    Overfitting is associated with high variance, especially when the training and testing datasets produce substantially different results.

  62. 62

    What is high bias in a machine-learning model?

    Model answer

    High bias occurs when the model imposes too much simplifying opinion or assumption and ignores a real pattern in the data.

    Explanation

    For example, fitting a flat relationship when the data clearly shows a curve reflects excessive bias.

  63. 63

    Why is too little bias also undesirable?

    Model answer

    With too little bias, the model may rely entirely on the data without incorporating useful prior assumptions about the relationship being modeled.

    Explanation

    The presentation recommends a balance rather than eliminating bias completely.

  64. 64

    What is the bias-variance trade-off?

    Model answer

    The bias-variance trade-off is the need to balance model assumptions and sensitivity to training data, because excessive bias or excessive variance can both harm generalization.

    Explanation

    Increasing model complexity often reduces training error but can increase testing error through overfitting.

  65. 65

    What commonly happens to training and testing accuracy as an overly complex model is developed?

    Model answer

    Training accuracy tends to increase while testing accuracy decreases, indicating movement toward overfitting.

    Explanation

    Training error falls as the model fits the training data more closely, while testing error can rise.

  66. 66

    What is underfitting?

    Model answer

    Underfitting occurs when a model is too simple to capture important relationships in the data, resulting in poor performance on both training and testing data.

    Explanation

    A model with high training and testing error has not learned enough of the underlying structure.

  67. 67

    What should practitioners consider before deploying a trained model?

    Model answer

    They should work with engineers to determine the appropriate production environment and understand how the model fits into the larger system.

    Explanation

    The model may be only one component of a larger process, so deployment should be coordinated rather than handled in isolation.

  68. 68

    Why should data scientists collaborate with engineers during deployment?

    Model answer

    Engineers can help determine the best technical approach and environment for running the model reliably in production.

    Explanation

    Possible environments include an AWS EC2 instance or a local system, depending on the application.

  69. 69

    Why should a model's deployment environment be chosen according to the larger system?

    Model answer

    Because the model may function as one component of a broader process, its environment must support the surrounding application and operational requirements.

    Explanation

    Deployment is not merely placing a model somewhere; it involves integrating it into production.

  70. 70

    What should practitioners communicate to stakeholders at the end of a machine-learning project?

    Model answer

    They should communicate the model's findings, construction, evaluation approach, and delivered results in a way that connects them to the business problem.

    Explanation

    Effective communication helps stakeholders understand what was built and how its performance should be interpreted.

1 of 70
Question 1 of 70

Ask anything

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

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent