AI Model Wiki

    Skip to main content
    Back to Glossary

    Supervised Learning

    Supervised learning is a machine learning paradigm in which a model is trained on a dataset of labeled input-output pairs, learning to map inputs to the correct outputs by minimising a Loss Function. During training the algorithm adjusts its Parameters through Gradient Descent until predictions closely match the provided labels, whether for classification tasks (assigning discrete categories) or regression tasks (predicting continuous values).

    Think of it like a student sitting exams with an answer key. Every practice question comes with the correct answer, so the student can immediately see where they went wrong, adjust their understanding, and improve before the real test.

    from sklearn.ensemble import RandomForestClassifier
    X_train = [[5.1, 3.5], [4.9, 3.0], [6.3, 3.3]]
    y_train = ["setosa", "setosa", "virginica"]
    clf = RandomForestClassifier().fit(X_train, y_train)
    print(clf.predict([[5.0, 3.4]]))  # ['setosa']
    

    Here each training sample has a known species label; the model learns decision boundaries from those labels and applies them to new, unseen flowers.

    Supervised learning underpins a huge proportion of deployed AI: spam filters, medical-image diagnosis, credit-scoring, and the early stages of RLHF in LLM alignment all rely on labeled data. It contrasts with unsupervised approaches and with Pretraining, which often learns structure from unlabeled corpora before a supervised Fine-tuning stage refines task-specific behaviour. Overfitting is the central risk: a model that memorises training labels rather than learning generalisable patterns.

    You will encounter supervised learning any time you work with labelled datasets — building a sentiment classifier, training an image recogniser, or adding a reward model to guide a language model toward preferred outputs.

    AI Terminology
    Glossary