Wednesday, November 18, 2026
Data from SEC filings, checked daily
My DeskFree
Public filings, plainly told
Machine learning
Summarize with AIChatGPTClaudePerplexityGoogle AIGrokCopilot
CFA® Level II · Quantitative Methods · Lesson 6 of 7

Machine learning

Supervised and unsupervised methods and how to judge them.

Written by Sepehr Parsa9 min read

Types of machine learning

  • Supervised learning: labelled data (inputs with known outputs). Regression for continuous targets, classification for categories.
  • Unsupervised learning: no labels; find patterns, groups or simpler representations.
  • Deep learning: neural networks with many layers for complex data such as images and text.
  • Reinforcement learning: an agent learns by trial and error to maximize rewards.

Fit and generalization

  • Bias error: the model is too simple (underfitting): high error on both training and test data.
  • Variance error: the model is too complex (overfitting): low training error, high test error.
  • Base error: irreducible noise.

Split data into training, validation and test sets. k-fold cross-validation rotates the validation set to estimate out-of-sample error. Regularization penalizes complexity.

Supervised methods

Method Idea Note
Penalized regression (LASSO) Regression with a penalty on coefficients Selects features, reduces overfitting
Support vector machine Finds the boundary with the widest margin between classes Soft margins allow some errors
k-nearest neighbours Classify by the majority of the k closest observations Choice of k and distance measure matter
Classification and regression trees (CART) Split data by feature thresholds Easy to interpret; prone to overfitting; prune
Ensembles: bagging, random forests, boosting Combine many models Lower variance; less interpretable

Unsupervised methods

  • Principal components analysis (PCA): turns correlated features into uncorrelated components; keep those explaining most variance. Use a scree plot to choose how many.
  • k-means clustering: assigns observations to k clusters by distance to cluster centres, iterating until stable.
  • Hierarchical clustering: builds clusters step by step (agglomerative, bottom-up; divisive, top-down) and shows them in a dendrogram.

Neural networks

Layers of nodes: input, hidden and output. Each node sums weighted inputs and applies an activation function (such as sigmoid or ReLU) to capture non-linearity. Weights are learned by backpropagation. Deep networks have many hidden layers. Powerful but data-hungry and hard to interpret.

Exam focus

Match a problem to the right method, explain bias versus variance error and how to reduce overfitting, and describe PCA, clustering and neural networks.

Check yourself

Tap an answer. You get the explanation straight away.

  1. An analyst wants to group 500 stocks into categories based on their return patterns, with no predefined labels. The most suitable approach is:

  2. A model has very low error on training data and high error on test data. This indicates:

  3. Which technique reduces many correlated features into a few uncorrelated composite variables?

Questions people ask

How is LASSO different from ordinary regression?

LASSO adds a penalty on the size of coefficients. It shrinks some to exactly zero, so it selects variables automatically and reduces overfitting.

Why are random forests often better than a single tree?

A single tree overfits easily. A random forest averages many trees built on random subsets of data and features, which reduces variance error.

What are hyperparameters?

Settings chosen before training, such as k in k-nearest neighbours or the depth of a tree. They are tuned using validation data, not learned from training data.

Unlimited practiceGenerate more Quantitative Methods questionsFresh questions with worked solutions every time, in the Level II style.
Progress is saved in this browser.
Next lesson · 7 of 7Big data projectsWorking through a text and data project from start to finish.

CFA Institute does not endorse, promote or warrant the accuracy or quality of WallStPal. CFA® and Chartered Financial Analyst® are registered trademarks owned by CFA Institute.

Exam format, timing and topic weights are from CFA Institute's Level I, II and III exam pages, checked November 15, 2026. Check CFA Institute for the year you sit. Lessons and practice questions are WallStPal's own and are not CFA Institute material.

Report an error

Tell us what looks wrong on this page. We check every report against the original filing and fix mistakes on our corrections page.

Share this trade
XTelegram
My Desk · free

Sign in to follow

Follow stocks, members of Congress, famous investors and funds, and see what's new each time you come back.