CodeHS Artificial Intelligence and Machine Learning Fundamentals 1 — Questions and Answers
Question 1: Which of the following best describes machine learning?
- A system that follows explicitly programmed rules to make decisions
- A subset of AI where systems learn patterns from data without being explicitly programmed (Correct answer)
- A programming language used exclusively for robotics
- A type of database management system
Correct answer: A subset of AI where systems learn patterns from data without being explicitly programmed
Machine learning is a subset of AI in which algorithms learn from data to improve performance on tasks without being explicitly programmed for each scenario.
Question 2: In a supervised learning model, what is the role of labeled training data?
- It is used only to test the model after training is complete
- It provides input-output pairs so the model can learn the mapping between them (Correct answer)
- It stores the model's weights after training
- It eliminates the need for a validation set
Correct answer: It provides input-output pairs so the model can learn the mapping between them
Labeled training data pairs inputs with correct outputs, allowing the supervised learning algorithm to learn the relationship and generalize to new examples.
Question 3: What is the primary purpose of a neural network's activation function?
- To initialize the weights of the network
- To introduce non-linearity so the network can learn complex patterns (Correct answer)
- To split data into training and testing sets
- To calculate the learning rate
Correct answer: To introduce non-linearity so the network can learn complex patterns
Activation functions introduce non-linearity into neural networks, enabling them to learn and represent complex, non-linear relationships in data.
Question 4: Which machine learning approach is best suited for training an agent to play a video game by rewarding good moves?
- Supervised learning
- Unsupervised learning
- Reinforcement learning (Correct answer)
- Transfer learning
Correct answer: Reinforcement learning
Reinforcement learning trains agents by providing rewards for desired actions and penalties for undesired ones, making it ideal for game-playing AI.
Question 5: What does 'overfitting' mean in the context of machine learning?
- The model performs poorly on both training and test data
- The model learns the training data too well, including noise, and fails to generalize (Correct answer)
- The model is too simple to capture patterns in the data
- The training process takes too long to converge
Correct answer: The model learns the training data too well, including noise, and fails to generalize
Overfitting occurs when a model memorizes training data noise and specifics, resulting in high training accuracy but poor performance on unseen data.
Question 6: Which of the following is an example of unsupervised learning?
- Spam email classification using labeled examples
- Customer segmentation grouping similar buyers without predefined categories (Correct answer)
- Image recognition trained on labeled photos
- Predicting house prices from historical sales data
Correct answer: Customer segmentation grouping similar buyers without predefined categories
Unsupervised learning finds hidden patterns or groupings in data without labeled outputs; customer segmentation is a classic clustering example.
Question 7: In the CodeHS AI curriculum, what is a 'training set' used for?
- Evaluating the final model's real-world performance
- Adjusting hyperparameters during model selection
- Teaching the model by exposing it to examples so it can learn patterns (Correct answer)
- Storing model predictions for later analysis
Correct answer: Teaching the model by exposing it to examples so it can learn patterns
The training set is the data used to fit or teach the model, allowing it to learn the patterns needed to make predictions.
Which of the following best describes machine learning?