On this page
Choose supervised learning when historical observations include an outcome you want to predict. Choose unsupervised learning when there is no such target and the task is to expose structure in the inputs. That first decision is more useful than memorising an algorithm name: the same collection of company data can support either task depending on the question asked of it.
Begin with the outcome, not the software
CFA Institute's 2026 Level II machine learning reading asks candidates to identify supervised and unsupervised methods and decide which problems suit them. In a supervised dataset, each training row joins observed features to a known target. Revenue growth, leverage and coverage might be features; a subsequent credit event might be a target. A model estimates a relationship using those paired observations, then applies that relationship to a new row whose outcome is unknown. The output is a prediction, subject to uncertainty and to the quality of the historical labels.
If the target is a measured amount, such as a later spread, think of regression. If it is a category, such as whether a specified event occurred, think of classification. The distinction concerns the output, not whether the inputs happen to be numbers. A classification model can use entirely numeric features, and a regression model can incorporate encoded categories. In an exam vignette, underline the phrase that describes what the analyst wants to know about a future observation. That phrase usually identifies the target type.
Unsupervised learning starts with features but no paired target. An analyst might want to group similar securities or replace many correlated signals with a smaller set of composite variables. Clustering addresses the first task; dimension reduction addresses the second. These outputs can help organise analysis, but a cluster number is a grouping chosen from the data, not an observed credit outcome. Giving the groups familiar names after seeing them does not retroactively make the training supervised.
Select the supervised method from the job it does
Penalised regression is useful when many candidate inputs might predict a continuous target and a simpler model could generalise better. A penalty discourages large or numerous coefficients. With a suitable penalty, LASSO can set some coefficients to zero, so it also selects features. This does not prove that the retained variables cause the outcome. It is a modelling device, and its penalty should be selected using data kept distinct from the final evaluation set. If the question asks which method can remove weak predictors from a large linear model, penalised regression is a direct answer.
A support vector machine draws a separating boundary for categories, with special attention to observations close to that boundary. Its margin idea is different from predicting a numeric spread. A soft margin accepts some classification errors to avoid an excessively brittle boundary. The feature representation and scaling matter because a distance or boundary calculated from poorly scaled variables can be dominated by the variable with the largest units. An exam answer that merely calls the method a classifier misses why margin and near-boundary cases matter.
K-nearest neighbour assigns a new observation using nearby labelled examples. For a classification task, the neighbours' labels vote; the method does not first fit a single global coefficient for every feature. The chosen neighbour count controls how local the decision is. A very small count can follow noise; a very large count can wash out meaningful distinctions. Distance is only useful if the features have sensible scales and if irrelevant inputs have not crowded out the informative ones. The letter used for neighbours has no connection to the number of groups in k-means.
A classification or regression tree repeatedly divides observations using feature thresholds. A path through the splits is relatively easy to explain, which is useful when the question asks for an inspectable rule. A deep tree can fit quirks of its training sample, so stopping rules or pruning matter. A random forest combines many trees built from varying samples and feature selections. Aggregation can make predictions less sensitive to one peculiar tree, while making the combined answer harder to trace to a single rule. The choice is a trade-off between stability and direct interpretability, not a claim that one method is always superior.
Select the unsupervised method from the output
Principal components analysis replaces correlated inputs with new composite directions ordered by the variation they capture. If several measures move together, a smaller collection of components can summarise much of their joint movement. A component is constructed from the original inputs; it is not a newly observed economic factor with a guaranteed business meaning. Retaining a component because it explains substantial variation is different from proving that it predicts a future return. CFA Institute identifies PCA as a dimension reduction method in its machine learning summary.
K-means groups rows around centroids after the analyst chooses the number of groups. It repeatedly assigns rows to nearby centres and recalculates those centres. A result can change when the chosen group count, scale or starting points change. Hierarchical clustering instead creates a nested sequence of groupings, either joining small groups or dividing a large one. A reader can inspect that hierarchy before choosing a useful cut. Neither method supplies a ground-truth label merely because the resulting groups look plausible. The question is whether the required output is a fixed partition or a view of nested similarity.
Work a small case from question to method
Consider an entirely illustrative dataset of twenty borrowers. Each row records two standardised inputs: leverage and interest coverage. For ten older borrowers, an analyst also knows whether a defined payment event occurred during the following year; the remaining ten have no subsequent event observation yet. If the task is to estimate which of the remaining borrowers may meet the event definition, the known event outcomes make this a supervised classification problem. A tree, neighbour method or support vector machine could be considered. None of those names alone tells us which will work best; the analyst must compare performance on observations excluded from fitting.
Suppose instead the analyst removes the event column and asks whether the twenty borrowers form groups with similar balance-sheet profiles. There is now no target to learn. A clustering method fits the question. The number of clusters is an analyst choice for k-means, while a hierarchical result permits examination at several levels. The groups may suggest where to investigate concentration, but they cannot be described as measured default classes without checking them against real outcomes. This is the exact point at which a candidate can accidentally turn a descriptive result into a prediction claim.
Now suppose the dataset grows to include many closely related leverage measures. Before modelling an outcome, the analyst may use PCA to compress the correlated inputs. PCA itself remains unsupervised because its components are constructed without event labels. A later classifier trained on those components is supervised. The pipeline contains both kinds of method; calling the whole pipeline only one or the other hides the role of each step. Keep separate the question answered by the transformation and the question answered by the prediction model.
The illustrative numbers are deliberately small, so they do not imply any real credit performance. They show how to identify the target column and why two analysts can legitimately apply different methods to the same rows. In a real dataset, the analyst would define the event consistently, check when each feature became available, and ensure that future information has not leaked into the training inputs. If the later outcome is used in a supposedly unsupervised grouping, the grouping is no longer independent of that outcome.
Evaluate what the method actually delivered
A training fit is not a reliable verdict on a prediction model. If the model has learned accidental details of the training sample, its reported in-sample result can look strong while its result on untouched data deteriorates. CFA Institute includes overfitting and its remedies among the Level II learning outcomes. Reserve a test set for final assessment; use a separate validation process for choices such as penalty strength, tree depth or neighbour count. Do preprocessing within that process so information from held-out rows does not influence training.
For a classifier, ask which errors matter: missing an event and falsely flagging one have different operational consequences. For a continuous prediction, ask whether errors are large in the units the decision uses. For clustering, predictive accuracy is not even the initial question. Look at stability under reasonable feature scaling and whether the groups explain a decision worth making. For PCA, examine what variation is retained and whether the transformation makes downstream analysis clearer. A technique should be assessed against its task, not against a metric borrowed from another task.
The public CFA Level II data science module likewise distinguishes training and evaluating regression and classification models from cleaning, feature work and tuning. That is a useful study order. First write down the target and what is known at prediction time. Then identify the output type, choose plausible methods, and only then discuss fitting and evaluation. This order prevents an attractive algorithm description from substituting for the actual answer.
A short decision check for revision
Before selecting a method, ask four things. Is there an observed target paired with each training row? If yes, is the target a number or a class? If no, do you need groups of observations or fewer composite features? Finally, what evidence would show the output is useful for the stated task? Applying those questions to a fresh, invented case is more informative than memorising a table of acronyms without their inputs and outputs.
For context, see the CFA programme page and how it works. For this reading, revise by inventing one dataset and changing only the analyst's question: prediction of a labelled outcome, grouping without labels, and compression of correlated inputs. If you can justify the switch each time, the algorithm list becomes a set of tools rather than a set of names.
Sources
- Machine Learning | CFA Institute · cfainstitute.org · Retrieved
- Python, Data Science & AI | CFA Institute · cfainstitute.org · Retrieved



