liveBook · Manning

Unsupervised learning

As explained in Investing for Programmers

Unsupervised learning is a machine-learning approach that identifies structure or patterns in data without predefined output labels.

Unsupervised learning finds structure in data without predefined output labels. In financial research, it can reveal groups of similar assets, identify unusual companies, and suggest meaningful labels for later supervised models. section 8.1 section 8.5

A practical stock-clustering workflow:

  • Plot an elbow curve across candidate cluster counts and select a cutoff where additional clusters provide diminishing returns; the example uses five. section 8.1.1

Inspecting clusters and outliers

Interactive exploration can highlight assets for further research. Moderna appears as a possible turnaround outlier, Palantir as a high-performing asset, and Super Micro Computer as the highest-volatility stock in the illustrated scatterplot. These observations guide investigation rather than guarantee investment results. section 8.1.1 section 8.5

How Investing for Programmers covers it

How deep it goes
Defines structure discovery and demonstrates feature calculation, elbow selection, K-means clustering, plotting, and cautious interpretation.
Examples
Calculates stock returns and volatility, selects five clusters, plots S&P 500 assets, and examines Moderna, Palantir, and Super Micro Computer.
What you can do after
Apply K-means with pandas, yfinance, and interactive plots to categorize assets and identify candidates for further investigation.
How it connects
Connects clustering with machine learning, supervised learning, classification, regression, features, and outlier detection.

Also explained in

Compare how 20 books explain unsupervised learning →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Investing for Programmers. The section links point to the parts of the book it draws on.