Programming Collective Intelligence
Building Smart Web 2.0 Applications
By Toby Segaran
Synopsis
Toby Segaran wrote Programming Collective Intelligence at the height of the Web 2.0 era, when websites were accumulating ratings, bookmarks, clicks and profiles in volume. The book shows programmers how to turn that user-generated data into working features, teaching one family of algorithms per chapter through short Python programs run against real data of the time. Chapters build recommendation engines with user-based and item-based collaborative filtering, cluster blogs and draw dendrograms, construct a small search engine with a crawler, indexer and PageRank, and apply stochastic optimization methods such as simulated annealing and genetic algorithms to problems like flight scheduling for a group trip.
Later chapters cover naive Bayes and Fisher document classifiers for spam filtering, decision trees, k-nearest-neighbor price models, support vector machines for a matchmaking example, non-negative matrix factorization for finding themes in news feeds, and genetic programming. Mathematical formulas are collected in an appendix, and each chapter ends with exercises for extending the code. A reader gains an intuitive, working grasp of the core techniques behind recommendation, search and classification. The cost is age: the examples use Python 2 and depend on web services from 2007, several of which have since changed or closed, so modern readers must adapt the code to run it.
Scorecard
Editorial score
How it scored
Editorial score: 63.1 / 1005 weighted criteria
- 24.0/30
Influence30%
- 16.3/25
Authority25%
- 10.0/20
Practical value20%
- 5.3/15
Currency15%
- 7.5/10
Readability10%
- 63.1/100
Editorial score
How the rank was computed
Rank No. 477 of 500 comes from a composite of 47.5: observable signals 19.1 of 55 points plus editorial review 28.4 of 45 points.
All 11 inputs
| Input | Points |
|---|---|
| Observable signals | 19.1/55 |
| Reach (Amazon ratings volume) | 8.6/16.5 |
| Consensus across best-of lists | 5.5/13.8 |
| Awards and bestseller evidence | 0.0/8.3 |
| Reader rating, sample-adjusted | 4.8/8.3 |
| Amazon sales rank | 0.2/5.5 |
| Recency | 0.0/2.8 |
| Editorial review | 28.4/45 |
| Author authority | 7.3/11.3 |
| Influence | 10.8/13.5 |
| Practical value | 4.5/9.0 |
| Readability | 3.4/4.5 |
| Currency | 2.4/6.8 |
Each criterion is scored from 1 to 10 and weighted, and the points add up to the editorial score. The rank combines observable signals (55 percent) with this score (45 percent). Read the methodology.
Verdict
An influential introduction to applied machine learning in Python whose algorithms still teach well, though its code and data sources have aged.
Strengths
- Clear, intuitive explanations of core algorithms
- Runnable Python examples built on real data
- Broad survey spanning recommendation to genetic programming
Keep in mind
The Python 2 code and retired 2007-era web APIs require rework, and the book offers breadth rather than depth or production-scale implementations.
Key takeaways
- Collaborative filtering recommends items by measuring similarity between users or between items, with item-based approaches scaling better for large catalogs.
- PageRank and other link-based scores can be combined with content metrics such as word frequency and word location to rank search results.
- Stochastic optimization methods like hill climbing, simulated annealing and genetic algorithms find good solutions when exhaustive search over every possibility is impractical.
- Simple probabilistic classifiers such as naive Bayes, trained on word features, can filter spam and categorize documents with modest code and data.
Notable facts
- Software developer Doug Hellmann's review strongly recommended the book, praising its in-context explanations of statistics and linear algebra for readers with rusty math skills. Source (opens in a new tab)
- Author and programmer Adam Tornhill called it the best introduction to machine learning he had found, while noting that its Python code is dated. Source (opens in a new tab)
About the author
Questions
Is Programming Collective Intelligence worth reading in 2026?
What is Programming Collective Intelligence about?
Who should read Programming Collective Intelligence?
Related books
- Approaching (Almost) Any Machine Learning Problem Abhishek Thakur
- AI and Machine Learning for Coders Laurence Moroney
- Practical Deep Learning for Cloud, Mobile, and Edge Anirudh Koul, Siddha Ganju and Meher Kasam
- Practical Natural Language Processing Sowmya Vajjala, Bodhisattwa Majumder, Anuj Gupta and Harshit Surana
- Feature Engineering for Machine Learning Alice Zheng and Amanda Casari
- Building Machine Learning Pipelines Hannes Hapke and Catherine Nelson
Sources
As an Amazon Associate, Best AI Books earns from qualifying purchases. Best AI Books is sponsored by Iternal.ai, whose founder and CEO, John Byron Hanby IV, wrote The AI Strategy Blueprint, our #1 ranked book. How we rank books.






