CodeHS Artificial Intelligence and Machine Learning Fundamentals 2 — Questions and Answers
Question 1: What is the difference between artificial intelligence (AI) and machine learning (ML)?
- AI and ML are identical terms with no distinction
- AI is the broad field of making machines simulate intelligence; ML is a subset using data-driven learning (Correct answer)
- ML encompasses all of AI, including rule-based systems
- AI refers only to robotics, while ML applies to software
Correct answer: AI is the broad field of making machines simulate intelligence; ML is a subset using data-driven learning
AI is the broader discipline of creating intelligent machines, while ML is a specific approach within AI that uses algorithms and data to enable systems to learn.
Question 2: Which evaluation metric measures the proportion of correctly classified instances out of all instances in a classification problem?
- Precision
- Recall
- Accuracy (Correct answer)
- F1 Score
Correct answer: Accuracy
Accuracy is calculated as the number of correct predictions divided by the total number of predictions, representing the overall correctness of a classifier.
Question 3: What is a 'feature' in the context of a machine learning dataset?
- The output label the model is trying to predict
- An individual measurable property or characteristic used as input to the model (Correct answer)
- The algorithm used to train the model
- A data point that causes the model to overfit
Correct answer: An individual measurable property or characteristic used as input to the model
Features are the individual input variables or attributes (e.g., age, height, pixel value) provided to a machine learning model to make predictions.
Question 4: In CodeHS's AI and ML units, what concept describes an AI system's inability to perform well on data it has not seen during training?
- Underfitting
- Bias
- Poor generalization (Correct answer)
- Data leakage
Correct answer: Poor generalization
Poor generalization refers to a model's failure to apply learned patterns to new, unseen data, often caused by overfitting or insufficient training data.
Question 5: Which type of machine learning algorithm is a decision tree?
- Unsupervised clustering algorithm
- Supervised learning algorithm (Correct answer)
- Reinforcement learning algorithm
- Generative adversarial network
Correct answer: Supervised learning algorithm
Decision trees are supervised learning algorithms that learn a hierarchy of if/else rules from labeled training data to make classification or regression decisions.
Question 6: What is the purpose of splitting data into training and test sets?
- To speed up the training process by using less data
- To evaluate model performance on unseen data and detect overfitting (Correct answer)
- To ensure the model memorizes all available examples
- To balance the class distribution in the dataset
Correct answer: To evaluate model performance on unseen data and detect overfitting
Holding out a test set ensures the model is evaluated on data it hasn't seen, giving an unbiased estimate of how it will perform in the real world.
Question 7: Which of the following best describes a 'neural network' in AI?
- A collection of if-then rules manually coded by programmers
- A computational model inspired by the human brain, consisting of interconnected nodes organized in layers (Correct answer)
- A database structure optimized for storing large datasets
- A type of sorting algorithm used to preprocess training data
Correct answer: A computational model inspired by the human brain, consisting of interconnected nodes organized in layers
Neural networks are computational models loosely inspired by biological neurons, organized in layers of nodes that learn to transform inputs into outputs through training.
What is the difference between artificial intelligence (AI) and machine learning (ML)?