Analyst Dojo
Lesson 2 of 3 6–9% of the exam

You are reading the 2026 curriculum (exams up to November 2026). Sitting in February 2027 or later? Go to the 2027 Quantitative Methods guide.

AI and machine learning: supervised, unsupervised, deep

Artificial intelligence lets computers perform tasks that seem to need human thinking. Machine learning, a branch of AI, finds patterns in data without being given explicit rules. Supervised learning learns from labeled examples; unsupervised learning finds structure in unlabeled data; deep learning uses many-layered neural networks. Overfit models learn the noise.

6 min cram, 24 min full read. Based on the 2026 CFA® Program Level I curriculum, Quantitative Methods, Learning Module 11. This is the 2026 version of the lesson. Sitting in February 2027 or later? Read the updated 2027 version.

Tailor this to you: take the self-assessment

Before this: Big Data, the four Vs and alternative data

On the exam

  • Describe Big Data, artificial intelligence, and machine learning

Describe artificial intelligence and machine learning, the main types of ML and the risks of overfitting and underfitting. Expect "which type of learning is this?" or "what is wrong with a model that fits the past perfectly?".

How deeply to learn each part
Know the idea
Understand it in general. It frames other topics, but you will not calculate with it.
Use it
Understand it well enough to solve a question with it. Recognize when it applies.
Memorize
Learn it by heart. The exam will not give it to you.

You know this one. The full lesson is folded away. The takeaways, formulas and checkpoint below are your quick refresher, and the checkpoint is a fair test of whether you still do.

You tested strong here. The full lesson is folded away. The takeaways, formulas and checkpoint below are your quick refresher, and the checkpoint is a fair test of whether you still know it.

Cram mode: the one-screen version of this lesson. Switch to Full for the explanations, worked examples and interactives.

What are AI and machine learning?

Artificial intelligence (AI) is computer systems performing tasks that traditionally needed human intelligence, at a level comparable or superior to people. An early form was the expert system : hand-coded “if–then” rules written by human experts. Another was the neural networks approach, programming loosely based on how the brain processes information. Banks have used it since the 1980s to flag abnormal card charges.

Machine learning (ML) takes a different route. Nobody writes the rules. The algorithm is given data and learns how inputs relate to outputs, or how the data are structured. The slogan is find the pattern, apply the pattern. ML makes no assumption about the underlying probability distribution of the data.

ML became practical for investing because Big Data supplied enough examples, while computing power grew and storage got cheaper.

How is the data used?

The data are split into three sets. The training data is where the algorithm finds relationships. A validation set is used to tune the model. A test set checks how well it predicts on data it has never seen. A model is judged on the test set, not on how well it explains its own training data.

ML still needs human judgment to choose techniques, and the data must be clean and free of bias. Because nobody programs the rules explicitly, models can also be opaque “black boxes” whose results are hard to explain.

What are the three types of ML?

Types of machine learning
Machine learningfind the pattern, apply the pattern
  • Supervised learning Memorize labeled inputs and outputs; predicts or classifies
  • Unsupervised learning Memorize unlabeled data; finds structure and groups
  • Deep learning Memorize neural networks with many layers
    • Can be supervised
    • Can be unsupervised
TypeDataTaskInvestment example
SupervisedLabeled inputs and outputsPredict or classifyPredict a bond downgrade from past bonds with known outcomes
UnsupervisedNo labelsFind structure, groupCluster 3,000 stocks by return behavior, ignoring sector labels
Deep learningEitherLayered, complex patternsRecognize cars in satellite images; read text

In supervised learning , the training data carry labels, so the algorithm learns the link between inputs and a known answer, then predicts for new data. In unsupervised learning no answer is provided; the algorithm describes the data and finds groups. Deep learning uses neural networks with many hidden layers to process data in stages, building simple concepts into complex ones. It can be supervised or unsupervised.

Memorize

InteractiveHow complex should the model be?

Try this 0 of 3

  • Find the complexity with the lowest test error.
  • Push training error below 0.01, then read the test error.
  • Go back to a straight line and compare the two errors.

Degree 2 curve: training error 0.063, test error 0.149, about right. About right: the model catches the hump. Test error is 0.149; degree 3 does slightly better (0.101). A model that memorizes the past predicts the future badly.

The data and the fitted model

−20246Next-quarter return (%)0246810Sentiment score
  • Training
  • Test (unseen)
  • Model

Error against complexity

0.00.30.60.91.2Mean squared error136912Complexity (degree)UnderfitAbout rightOverfit

Drag the marker, or tap a degree, to change the model.

  • Training error
  • Test error

About right: the model catches the hump. Test error is 0.149; degree 3 does slightly better (0.101).

ModelDegree 2 curve
Training error0.063
Test error0.149
VerdictAbout right
The model
Show working

Training error = average of (actual − fitted)² over the 14 training points = 0.063.

Test error = the same average over the 6 test points the model never saw = 0.149.

Training error only falls as complexity rises (0.843 at degree 1, 0.003 at degree 12), so it cannot tell you when to stop.

Test error is lowest at degree 3 (0.101). At degree 12 it is 1.044, worse than the straight line's 0.924.

A model that memorizes the past predicts the future badly.

How can ML go wrong?

Getting the fit right
Model fit
  • Underfitted Memorize too simple; misses real patterns
  • Well fitted captures signal; generalizes
  • Overfitted Memorize too complex; learns noise; fails on new data

Overfitting happens when the model learns the training data too precisely. It is overtrained: noise is treated as signal, so it discovers false relationships. The model is too complex, scores brilliantly in-sample and predicts poorly on a different dataset. A model that is underfitted does the reverse: it treats real patterns as noise, is too simple, and does badly even on its training data.

Exam tip Great training score, poor test score means overfit. Poor everywhere means underfit.

Go deeper Overfitting and data snooping

Overfitting is the machine-learning cousin of data snooping in hypothesis testing. Try enough models or patterns on the same history and one will look good by chance. Both fail the same test: the result is not replicated on new data. That is why ML keeps a test set aside.

Go deeper Explainability and model risk

A black-box model can predict well and still be hard to defend. Regulated firms must be able to explain why a decision was made, and an unexplained model can break quietly when markets change. Human oversight of the data, the method and the output remains part of the process.

Memorize this

MemorizeThree kinds of machine learning

TypeDataTaskExample
Supervisedlabeled inputs and outputspredict or classifydefault or no default, from past bonds with known outcomes
Unsupervisedno labelsfind structure, groupclusters of stocks by return behavior, no sector labels
Deep learningeitherlayered, non-linear patternsimages, speech, text

Memory hook Supervised has a teacher (the labels). Unsupervised has none. Deep learning is a technique (many hidden layers), not a third kind of data.

Know it cold Deep learning can be supervised or unsupervised. ML = "find the pattern, apply the pattern".

MemorizeOverfitting vs underfitting

OverfittedUnderfitted
What it didlearned the data too precisely, noise as signaltreated real patterns as noise
Model istoo complextoo simple
In-sampleexcellentpoor
New datapoorpoor

Memory hook Over = memorized the past (cannot generalize). Under = never learned it. Compare training score with test score.

Know it cold Three data sets: training (learn), validation (tune), test (judge on unseen data).

Types of machine learning
Machine learningfind the pattern, apply the pattern
  • Supervised learning Memorize labeled inputs and outputs; predicts or classifies
  • Unsupervised learning Memorize unlabeled data; finds structure and groups
  • Deep learning Memorize neural networks with many layers
    • Can be supervised
    • Can be unsupervised
Getting the fit right
Model fit
  • Underfitted Memorize too simple; misses real patterns
  • Well fitted captures signal; generalizes
  • Overfitted Memorize too complex; learns noise; fails on new data

How it is asked

  1. Labeled data, which type?

    A model learns from bonds each marked "defaulted" or "did not default". Which type of learning?

    Labeled outcomes make it supervised. Trap: unsupervised.

  2. Perfect in-sample, poor out-of-sample

    A model fits its training data almost perfectly but predicts poorly on new data. What is it?

    Overfitted. Trap: underfitted ("too simple").

  3. Group without categories

    Stocks are grouped by similarity without predefined categories. Which approach?

    Unsupervised learning. Trap: supervised or natural language processing (NLP).

  4. Deep learning

    Which describes deep learning?

    Neural networks with many hidden layers, usable with supervised or unsupervised approaches.

Exam traps

  • Saying unsupervised learning uses labeled data. Labels are what make learning supervised.
  • Calling an overfit model too simple. That is underfitting; overfit models are too complex.
  • Treating deep learning as a separate kind of data. It is a technique that can be supervised or unsupervised.
  • Judging a model by its in-sample fit. The test is performance on data it has not seen.

Checkpoint

4 exam-style questions. About 90 seconds each.

  1. 1A model is trained on 10 years of past bond data in which each bond is marked "defaulted" or "did not default". This is an example of:

  2. 2A model fits its training data almost perfectly but predicts poorly on new data. It is most likely:

  3. 3Grouping stocks by similarity without using any predefined categories is best described as:

  4. 4Which statement about deep learning is most accurate?

Key takeaways

  • AI: computers doing tasks that needed human intelligence. ML: learning patterns from data instead of following hand-coded rules.
  • Supervised learning uses labeled data to predict; unsupervised finds structure without labels; deep learning uses layered neural networks.
  • Overfitted means learned the noise (great in-sample, poor out-of-sample). Underfitted means too simple.
  • ML needs lots of clean data and human judgment, and can be a hard-to-explain black box.

Questions about this lesson?

Where this comes back

Questions candidates ask

What is the difference between supervised and unsupervised learning?

Supervised learning is given labeled inputs and outputs and learns to predict the output for new data. Unsupervised learning is given data without labels and looks for structure, such as groups of similar companies.

What is overfitting in machine learning?

Overfitting occurs when a model learns its training data too precisely and treats noise as real patterns. It looks excellent in-sample but predicts poorly on new data. Underfitting is the opposite problem: a model too simple to find real patterns.

What is deep learning?

Deep learning uses neural networks with many hidden layers to find complex, non-linear patterns in stages. It can be supervised or unsupervised and is strong at image, speech and pattern recognition.

Spotted an error? Tell us and we will fix it.

  1. Big Data, the four Vs and alternative data
  2. AI and machine learning: supervised, unsupervised, deep
  3. Data science: processing, visualization and text analytics

Ask Sensei Listen instead

Questions on AI and machine learning: supervised, unsupervised, deep

Learn with Sensei, out loud The voice tutor, in early access

Sensei teaches the lesson aloud and stops when you interrupt: "wait, why is the geometric mean lower?" It answers with the lesson's own example, then quizzes you by voice. Every account can try Sensei on one module, with one voice question.

USD 149 a month founding price (regular USD 199), kept for as long as you stay subscribed. Everything in Plus included.

In active development and improving every day. Send feedback · Plans and pricing

Analyst Dojo Plus

Your free review list holds 10 items.

Plus keeps everything you save, for USD 19 a month. To make room on the free plan, remove something from your review list.

See Plus

Lessons, checkpoints and the lesson questions in practice stay free. Compare plans