Supervised vs. unsupervised learning

Computer Science · AI/ML fundamentals

Question 1 of 10

0

    A classifier's output for an input is:

    Stuck? Read the explanation

    Unlocks at a streak of 5 correct answers in a row.

    Print a free worksheet (PDF)

    Embed this practice on your site or class page

    Paste this HTML into your page. Students practise right there; it is free and needs no account.

    Supervised vs. unsupervised learning explained

    Supervised learning trains a model on data that has labels, meaning the correct answer is given for each example, so the model can learn to predict those answers for new data. Unsupervised learning works on data with no labels and looks for structure, such as groups, that was not given in advance.

    Supervised learning includes classification, where the answer is a category such as spam or not spam, and regression, where the answer is a number such as a house price. Unsupervised learning includes clustering, which sorts items into groups of similar ones, and dimensionality reduction, which simplifies data with many features into fewer.

    Labels are the key difference. Someone must usually create them by hand, which is why labelled data can be expensive. Unsupervised clusters also do not come with names: a person has to look at each group and decide what it means.

    A common mistake is to think unsupervised learning finds the "right" answer. It only finds groups that look similar according to the rules the algorithm uses, and those groups may not match what people care about.

    Worked example

    A spam filter is trained on 200 labelled emails. It is then tested on 50 new emails, and 45 are classified correctly. What is its accuracy?

    1. Accuracy is the number of correct predictions divided by the total number tested.
    2. Correct predictions: 45. Total tested: 50.
    3. Accuracy = 45÷50=0.945 \div 50 = 0.9, which is 90%.

    Check: the 200 training emails were used to learn, so only the 50 new emails count for testing.

    What you will practise

    105 multiple-choice questions (Easy, Medium, Hard). Each answer is followed by an explanation.

    Example questions

    • Supervised learning uses:
    • Unsupervised learning finds:
    • Classification is an example of:
    • Clustering is an example of:
    • Regression predicts:
    • A labelled dataset contains:
    • A spam filter trained on emails that are already marked spam or not spam is usually:
    • Dimensionality reduction is typically a type of:

    …and 97 more.