Skip to content
elevatedevco

Machine Learning

Types of machine learning

Learn Types of machine learning: 40 practice questions and answers with an interactive quiz — from the offline AI Learning app.

Intermediate40 questions40 quiz questions

Questions & Answers

Tap a question to reveal its answer. Written for self-study and interview preparation.

What are the three main types of machine learning?

The three main types are supervised learning, unsupervised learning, and reinforcement learning. In supervised learning the computer learns from labeled examples, in unsupervised learning it finds patterns in unlabeled data, and in reinforcement learning it learns by trial and error using rewards.

In supervised learning, what does 'labeled data' mean?

Labeled data means each example comes with the correct answer attached. For instance, a photo of a cat is labeled 'cat'. The computer studies many of these labeled examples so it can predict the correct label for new, unseen data.

Which type of machine learning is used when a model learns to sort emails into 'spam' and 'not spam' using past examples that are already marked?

This is supervised learning, because the training emails already have correct labels ('spam' or 'not spam'). The model learns the patterns linking email content to its label and then predicts the label for new emails.

What is unsupervised learning?

Unsupervised learning is when a computer finds patterns or groups in data that has no labels. Nobody tells it the correct answers; instead it discovers structure on its own, such as grouping similar customers together. A common example is clustering.

What is reinforcement learning, in simple words?

Reinforcement learning is when an agent learns by trying actions and receiving rewards or penalties. Good actions earn rewards, bad actions earn penalties, so over time the agent learns which actions lead to the best results. It is like training a dog with treats.

A robot learns to walk by getting points when it moves forward and losing points when it falls. Which type of learning is this?

This is reinforcement learning. The robot is an agent that takes actions, and it receives a reward (points) for good outcomes and a penalty for bad ones. By trying many times, it improves its walking strategy.

What is the difference between classification and regression in supervised learning?

Classification predicts a category or label, such as 'cat' or 'dog'. Regression predicts a continuous number, such as the price of a house or tomorrow's temperature. Both use labeled data, but the type of answer they predict is different.

What is clustering, and which type of machine learning does it belong to?

Clustering is grouping similar data points together based on their features, without using labels. It belongs to unsupervised learning because the computer discovers the groups by itself. For example, it might group shoppers by their buying habits.

What is semi-supervised learning?

Semi-supervised learning uses a small amount of labeled data together with a large amount of unlabeled data. The few labels guide the learning, while the many unlabeled examples help the model understand the overall structure. It is useful when labeling data is expensive or slow.

Why is labeled data often expensive or hard to get?

Labeling data usually requires humans to manually mark the correct answer for each example, which takes time, money, and expertise. For example, doctors must label medical scans, which is slow. This is why some methods, like semi-supervised or unsupervised learning, are valuable.

Which type of learning would you use to group photos of animals when you don't know in advance which animals appear?

You would use unsupervised learning, specifically clustering. Since there are no labels telling you which animal is which, the algorithm groups similar-looking photos together on its own. You could then inspect each group to understand it.

In reinforcement learning, what is an 'agent'?

An agent is the learner or decision-maker that interacts with an environment. It chooses actions, observes the results, and receives rewards or penalties. Over time the agent tries to choose actions that maximize its total reward.

What is a 'reward' in reinforcement learning?

A reward is a number that tells the agent how good or bad its action was. Positive rewards encourage actions, while negative rewards (penalties) discourage them. The agent's goal is to collect as much total reward as possible over time.

A model predicts tomorrow's temperature as a number like 31.5 degrees. Is this classification or regression?

This is regression, because the model predicts a continuous number rather than a category. Regression is a supervised learning task used when the answer is a quantity, such as temperature, price, or height.

A model decides whether a photo shows a 'dog' or 'not a dog'. Is this classification or regression?

This is classification, because the model chooses between categories (dog or not dog) rather than predicting a number. Classification with only two possible labels is called binary classification.

What is the main goal of unsupervised learning compared to supervised learning?

Supervised learning aims to predict known labels from examples, while unsupervised learning aims to discover hidden patterns or structure in data that has no labels. Supervised learning answers 'what is this?', whereas unsupervised learning asks 'how is this data organized?'.

Which type of machine learning powers a game-playing AI that improves by playing thousands of matches against itself?

This is reinforcement learning. The AI is an agent that takes actions (moves), receives rewards for winning, and penalties for losing. By playing many games and learning from outcomes, it gradually discovers winning strategies.

What are 'features' in a machine learning dataset?

Features are the measurable pieces of information describing each example, used as input to the model. For a house, features might include its size, number of rooms, and location. The model uses these features to make predictions or find patterns.

In supervised learning, what is the difference between training data and test data?

Training data is used to teach the model, while test data is kept aside to check how well the model performs on examples it has never seen. Testing on new data shows whether the model truly learned the patterns or just memorized the training examples.

What is 'dimensionality reduction', and which learning type is it usually part of?

Dimensionality reduction means simplifying data by reducing the number of features while keeping the important information. It is usually part of unsupervised learning and helps visualize data or make models faster. A common method is PCA (Principal Component Analysis).

Movie streaming apps suggest films similar to ones you liked. Which idea from unsupervised learning often helps here?

Clustering and finding similar items help here, which are unsupervised learning ideas. The system groups movies or users with similar tastes, then recommends items popular within your group. This kind of system is called a recommendation system.

Why can't we always use supervised learning for every problem?

Supervised learning needs lots of labeled examples, but for many problems labels are missing, expensive, or impossible to get. In those cases we use unsupervised learning to find patterns or reinforcement learning to learn from trial and error. Choosing the type depends on the data we have.

What is overfitting in supervised learning?

Overfitting happens when a model learns the training data too well, including its noise and quirks, so it performs poorly on new data. It is like memorizing answers instead of understanding the topic. Using more data and simpler models helps reduce overfitting.

In the dog-training analogy for reinforcement learning, what plays the role of the 'reward'?

The treat given to the dog plays the role of the reward. When the dog performs the right action, it gets a treat, encouraging it to repeat that behavior. Similarly, a reinforcement learning agent repeats actions that earn higher rewards.

Which type of machine learning is most suitable for detecting unusual or fraudulent bank transactions when most data is unlabeled?

Unsupervised learning is well suited because it can find data points that do not fit the normal patterns, called anomalies. Since most transactions are unlabeled, the model learns what 'normal' looks like and flags anything that stands out as unusual.

What is an 'environment' in reinforcement learning?

The environment is everything the agent interacts with and gets feedback from. The agent takes an action, and the environment responds with a new situation (state) and a reward. For a self-driving car, the environment includes the road, traffic, and signals.

A self-driving car learns to drive safely by getting penalties for crashes and rewards for smooth, safe driving. Which learning type is this?

This is reinforcement learning. The car acts as an agent that interacts with its environment, receiving rewards for good driving and penalties for unsafe actions. It improves its driving policy over many experiences.

How is semi-supervised learning different from supervised learning?

Supervised learning uses only labeled data, while semi-supervised learning uses a small amount of labeled data along with a large amount of unlabeled data. Semi-supervised learning is helpful when labeling everything would be too costly. The unlabeled data helps the model learn the overall structure.

Why is testing a supervised model on new, unseen data important?

Testing on unseen data shows whether the model can generalize, meaning it works on real future examples rather than just the data it memorized. If a model does well on training data but poorly on test data, it has overfit. Good performance on test data builds trust in the model.

Which simple Python library is commonly used to try supervised and unsupervised learning?

scikit-learn (imported as sklearn) is a popular and beginner-friendly Python library for both supervised and unsupervised learning. It provides ready-made tools for classification, regression, and clustering. It is widely used for learning the basics of machine learning.

from sklearn.cluster import KMeans
model = KMeans(n_clusters=3)
What does this Python snippet illustrate about types of machine learning? from sklearn.cluster import KMeans model = KMeans(n_clusters=3)

It illustrates unsupervised learning, specifically clustering. KMeans groups data into a chosen number of clusters (here 3) without using any labels. The model finds the groupings based only on how similar the data points are.

from sklearn.cluster import KMeans
model = KMeans(n_clusters=3)
Predicting a student's exam score (a number) from study hours is which kind of supervised task?

It is regression, because the output is a continuous number (the score). Regression models learn the relationship between input features, like study hours, and a numeric output. Classification, by contrast, would predict a category like 'pass' or 'fail'.

What is one important ethical concern when training supervised models on labeled data?

If the labeled training data is biased or unfair, the model can learn and repeat that bias, leading to unfair predictions. For example, biased data could cause a hiring model to unfairly reject certain groups. It is important to use fair, representative, and accurate data.

Why might using reinforcement learning to control a real machine raise safety concerns?

Reinforcement learning learns by trial and error, so during training the agent may take harmful or dangerous actions before learning the right ones. On a real machine, mistakes could cause damage or injury. That is why such systems are often trained first in safe simulations.

What is anomaly detection, and which learning type often handles it?

Anomaly detection means finding rare data points that are very different from the rest, such as a sudden strange transaction. It is often handled by unsupervised learning, since the model learns the normal pattern and flags anything that does not fit. It is used in fraud detection and fault monitoring.

Match the task to its learning type: recognizing handwritten digits using thousands of images already labeled 0-9.

This is supervised learning because each training image already has a correct label (the digit it shows). The model learns from these labeled images to classify new handwritten digits. Predicting a known category from labeled examples is a classic supervised classification task.

Why is the quality of training data important regardless of the learning type?

Machine learning models learn from data, so if the data is wrong, messy, or unrepresentative, the model will learn the wrong things. This is often summarized as 'garbage in, garbage out'. Good, clean, and representative data leads to more accurate and trustworthy models.

Which learning type best fits the goal of compressing a large set of features into just two for plotting on a graph?

Unsupervised learning fits best, using dimensionality reduction. Techniques like PCA squeeze many features into two while keeping important structure, so the data can be plotted in 2D. No labels are needed for this.

In machine learning, what does it mean for a model to 'generalize' well?

Generalizing well means the model makes accurate predictions on new data it has never seen, not just on its training examples. A model that generalizes has truly learned the underlying patterns. This is the real goal of supervised learning, rather than just memorizing.

How does reinforcement learning differ from supervised learning in how it gets feedback?

In supervised learning, the model is given the exact correct answer for each example. In reinforcement learning, the agent is not told the right action; it only receives a reward signal showing how good its action was. So reinforcement feedback is less direct and comes through trial and error.

Put it into practice with AI Learning

This topic — and hundreds more — comes from our free, offline AI Learning app. Practice Q&A, quizzes and cheat sheets anywhere, no account needed.

  • Free
  • No account
  • Works offline
Coming soon toGoogle Play