What is machine learning? (concept)

Computer Science · AI/ML fundamentals

Question 1 of 10

0

    Assigning an email to the category spam or not spam is an example of:

    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.

    What is machine learning? (concept) explained

    Machine learning is a way of writing programs that learn patterns from data, instead of following rules that a programmer writes out in full. The program is shown many examples, adjusts its internal settings to fit them, and then makes predictions about new data it has not seen before.

    A traditional program takes data and rules as input and produces answers. A machine learning program takes data and answers as input and produces a model, which is a set of learned rules. For example, a spam filter can be trained on thousands of emails labelled as spam or not spam, and it then learns which words and patterns are common in spam.

    Training means adjusting the model to reduce its errors on the training data. The model is then tested on separate data it has not seen, to check that it works on new examples. Machine learning is often grouped into types, such as supervised learning, where the examples have known answers, and unsupervised learning, where they do not.

    A common mistake is to assume that a model which is accurate on its training data will work well on new data. A model can memorise its training examples and fail on anything different, which is why separate test data is used.

    Worked example

    A model is trained on 100 labelled photos of cats and dogs and gets 90 of them right. It is then tested on 20 new photos it has never seen and gets 15 right.

    1. Training accuracy: 90÷100=0.990 \div 100 = 0.9, so 90%.
    2. Test accuracy: 15÷20=0.7515 \div 20 = 0.75, so 75%.
    3. The fall from 90% to 75% suggests the model may be partly memorising its training photos, although 20 test photos is a small sample.

    What you will practise

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

    Example questions

    • Machine learning is:
    • A model is trained on:
    • Features are:
    • Labels are:
    • Training improves a model by:
    • Supervised learning uses training data that includes:
    • The accuracy of a classification model is:
    • Predicting a house price as a continuous number is an example of:

    …and 97 more.