The Three Families · Machine Learning & AI

Ch 1 · What Is Machine Learning? — card 2 of 2.

Machine learning comes in three broad families, and each one learns in a different way. Supervised learning uses examples that already have answers, unsupervised learning looks for patterns in data without answers, and reinforcement learning improves through trial and reward. The example shows a tiny labelled dataset pairing hours studied with pass or fail, which is exactly the kind of data supervised learning needs.

# A tiny labelled dataset: (hours studied, passed?)
data = [(1, 0), (2, 0), (4, 1), (5, 1), (6, 1)]
for hours, passed in data:
    print(f"{hours}h studied -> {'pass' if passed else 'fail'}")