Machine Learning Quiz
GIFSQ ID: ART-1940
Test your knowledge with this free 20-question Machine Learning quiz from AI, Data & Digital Food Technology …
What this quiz covers
Machine learning is a set of algorithms that improve at tasks by learning from data, and this quiz starts with the main model types. Classification assigns inputs to categories, such as contaminated versus clean, while regression predicts continuous values, such as shelf life in days. A decision tree splits data through yes or no questions into an interpretable flowchart, and a random forest beats a single tree by averaging many trees trained on varied data samples. Neural networks are layers of interconnected units adjusting weights to reduce prediction error, and deep learning needs large datasets and substantial computing power. Hyperparameters such as learning rate and tree depth are settings chosen before training, and transfer learning adapts models pre-trained on large datasets to smaller food datasets.
The second half of the quiz is about judging a model honestly. Precision measures, of predicted positives, how many were truly positive, while recall measures, of actual positives, how many were caught. A confusion matrix lays out true and false positives and negatives in a table. Cross-validation repeatedly trains and tests on different data splits, and performance should be tested on held-out data resembling real deployment conditions, because testing on training data only shows memorisation. In food safety inspection, high recall is chased because missing a real hazard is far worse than a false alarm. Feature engineering crafts informative inputs, such as colour ratios, from raw data. Clustering groups consumers or products by similarity without pre-set labels, anomaly detection flags unusual patterns such as novel defects or fraud signals, and time-series models exploit order and trends in sequential data to forecast or detect drift. A demand-forecasting model is fed historical sales, promotions, weather, and seasonality.
One idea runs through the set: a model is only as good as the data and the test behind it
Overfitting is what happens when a model memorises training data including noise and then fails on new data. The test that matters is the one on data the model has never seen, under conditions like the ones it will meet in service.
How to use this quiz
Take the quiz cold first, then read the explanations below the player. Each answer defines the term and shows where it bites in a food setting, from inspection recall to shelf life prediction.
Choose how you want to play
A short note: machine learning for food manufacturing
Machine learning builds systems that get better at a task by learning from data. ISO/IEC 22989:2022 defines it as methods that let a system get better with experience, and Russell and Norvig (2021) set out the main kinds: supervised, unsupervised and reinforcement learning.
Classification predicts classes, such as contaminated or clean; regression predicts numbers, such as shelf life in days. A decision tree splits data with yes-or-no questions into a readable flowchart, and a random forest beats a single tree by averaging many trees, each trained on a different slice of data. Neural networks learn as linked units tune their weights to cut prediction error, and deep learning needs big datasets and heavy computing.
Feature engineering turns raw data into useful inputs. Hyperparameters are settings picked before training. Cross-validation trains and tests again and again on different slices of data, and models should be tested on unseen data like real factory conditions. A confusion matrix shows right and wrong positives and negatives: precision counts true positives among predicted positives; recall counts caught positives among real ones.
Clustering groups buyers or products by likeness with no labels given; time-series models use order and trends over time. Anomaly detection spots odd patterns, and transfer learning reuses models trained on big datasets for smaller food datasets. In food safety inspection, high recall is chased: a missed hazard beats a false alarm for harm.
Takeaway: judge a food-safety model on recall first, and always test it on data it has never seen.
Questions and answers
Note: the player shuffles the questions and the answer options on every attempt, so the numbers in the player will not match the numbers in the questions and answers below. Match each answer by its wording.
Question 1: How does a random forest beat a single decision tree?
Correct answer: Averaging many trees trained on varied data samples
A random forest trains many decision trees on different random samples of the data and combines their predictions, which smooths out the overfitting and noise a single tree is prone to.
Question 2: Feature engineering means what?
Correct answer: Crafting informative inputs (e.g. colour ratios) from raw data
Raw measurements are often not the most useful inputs, so feature engineering builds new informative features : like a colour ratio computed from raw pixel data : that expose the patterns a model needs to learn.
Question 3: Why chase high recall in food-safety inspection?
Correct answer: Missing a real hazard is far worse than a false alarm
Recall is the share of real hazards caught, so in food-safety inspection you want it high: letting a genuine hazard slip through is far worse than a false alarm that only triggers an extra check.
Question 4: A classifier's recall measures what?
Correct answer: Of actual positives, how many were caught
Recall equals true positives caught divided by all actual positives; it measures, among the things that were truly positive, how many the classifier found.
Question 5: ML classification predicts what?
Correct answer: Categories, e.g. 'contaminated' vs 'clean'
Classification assigns each input to a category label : for example 'contaminated' versus 'clean' : rather than predicting a number.
Question 6: What is machine learning?
Correct answer: Algorithms that improve at tasks by learning from data
Machine learning uses algorithms that improve their performance on a task by learning patterns from data, instead of following hand-written rules.
Question 7: A classifier's precision measures what?
Correct answer: Of predicted positives, how many were truly positive
Precision equals true positives divided by all predicted positives; it measures, among the items the classifier flagged positive, how many really were positive.
Question 8: What is anomaly detection used for in ML?
Correct answer: Flagging unusual patterns, e.g. novel defects or fraud signals
Anomaly detection learns what 'normal' looks like and flags unusual patterns, which is how novel defects, contamination events, or fraud signals get caught before they blend in.
Question 9: Hyperparameters are what?
Correct answer: Settings chosen before training, e.g. learning rate, tree depth
Hyperparameters such as learning rate and tree depth are settings chosen before training starts; they control how the model learns, unlike the weights the model learns itself.
Question 10: What can clustering group without labels?
Correct answer: Consumers or products by similarity without pre-set labels
Clustering groups similar items : consumers or products : together based on similarity alone, without any pre-set labels telling it the right answer.
Question 11: What do time-series ML models exploit?
Correct answer: Order and trends in sequential data to forecast or detect drift
Time-series models exploit the order and trends in sequential measurements to forecast what comes next or to detect when a process drifts off course.
Question 12: In ML, regression predicts what?
Correct answer: Continuous values, e.g. shelf life in days
Regression predicts continuous numeric values : such as shelf life in days : rather than sorting inputs into categories.
Question 13: How does transfer learning help food AI?
Correct answer: Adapting models pre-trained on large datasets to smaller food datasets
A model pre-trained on a huge dataset already understands general patterns, so adapting it to a smaller food dataset lets the food AI learn well with far less food-specific data.
Question 14: How do neural networks learn?
Correct answer: Layers of interconnected units adjusting weights to reduce prediction error
A neural network is made of layers of interconnected units whose connection weights are adjusted during training to shrink the gap between predictions and the true answers.
Question 15: How does cross-validation estimate model performance?
Correct answer: Repeatedly training and testing on different data splits
Cross-validation repeatedly trains the model on one slice of the data and tests it on a different slice, so the performance estimate reflects unseen data rather than one lucky split.
Question 16: A decision tree is what kind of model?
Correct answer: Split data through yes/no questions into an interpretable flowchart
A decision tree splits data through a chain of yes/no questions, producing an interpretable flowchart from root to leaf.
Question 17: A confusion matrix shows what?
Correct answer: True/false positives and negatives of a classifier
A confusion matrix lays out a classifier's true and false positives and negatives in a table, showing exactly which kinds of mistakes it makes.
Question 18: Deep learning needs what?
Correct answer: Large datasets and substantial computing power
Deep neural networks have enormous numbers of weights to tune, so they need large datasets and substantial computing power to train without memorising noise.
Question 19: Model performance should be tested on what data?
Correct answer: Held-out data resembling real deployment conditions
Performance must be measured on held-out data that resembles real deployment conditions, because testing on training data only shows how well the model memorised what it already saw.
Question 20: An ML demand-forecasting model is fed by what?
Correct answer: Historical sales, promotions, weather and seasonality as inputs
A demand-forecasting model is fed the factors that drive demand : historical sales, promotions, weather, and seasonality : so it can learn how they combine to shape future sales.