No. 477 of 500 No. 79 in Hands-On AI & Programming

Programming Collective Intelligence

Building Smart Web 2.0 Applications

By Toby Segaran

Print length
360 pages
Publisher
O'Reilly Media
Reading level
Intermediate
ISBN-13
978-0596529321
Published
September 25, 2007
Written for
Programmers who learn by coding and want an intuitive tour of classic machine learning algorithms.

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

  • Influence30%

    24.0/30
  • Authority25%

    16.3/25
  • Practical value20%

    10.0/20
  • Currency15%

    5.3/15
  • Readability10%

    7.5/10
  • Editorial score

    63.1/100

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
InputPoints
Observable signals19.1/55
Reach (Amazon ratings volume)8.6/16.5
Consensus across best-of lists5.5/13.8
Awards and bestseller evidence0.0/8.3
Reader rating, sample-adjusted4.8/8.3
Amazon sales rank0.2/5.5
Recency0.0/2.8
Editorial review28.4/45
Author authority7.3/11.3
Influence10.8/13.5
Practical value4.5/9.0
Readability3.4/4.5
Currency2.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

  1. Collaborative filtering recommends items by measuring similarity between users or between items, with item-based approaches scaling better for large catalogs.
  2. PageRank and other link-based scores can be combined with content metrics such as word frequency and word location to rank search results.
  3. Stochastic optimization methods like hill climbing, simulated annealing and genetic algorithms find good solutions when exhaustive search over every possibility is impractical.
  4. 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

Toby Segaran

Toby Segaran holds a computer science degree from MIT. When the book appeared he was a software developer and manager at Genstruct, a computational systems biology company, after founding the biotech software firm Incellico. He later worked at Metaweb Technologies, the Freebase developer that Google acquired in 2010, co-wrote Programming the Semantic Web and co-edited Beautiful Data with Jeff Hammerbacher.

Questions

Is Programming Collective Intelligence worth reading in 2026?
As a conceptual primer, yes. Its explanations of collaborative filtering, clustering, PageRank, optimization and Bayesian classification remain clear and correct. As a coding guide it is dated: the examples use Python 2 and call web APIs from 2007, many now retired, and the book predates the deep learning era. Readers should treat it as an algorithm tutorial and port the code to current Python.
What is Programming Collective Intelligence about?
The book teaches programmers how to extract useful patterns from data that users generate on websites. Each chapter implements one technique in Python: recommendation engines, clustering, a search engine with PageRank, stochastic optimization, spam filtering, decision trees, price prediction, support vector machines, non-negative matrix factorization and genetic programming. A closing reference chapter summarizes the algorithms, and the math is collected in an appendix rather than the main text.
Who should read Programming Collective Intelligence?
It fits programmers who understand code better than equations and want an intuitive feel for how recommendation, search ranking and classification algorithms work. Basic Python familiarity helps. Data scientists who need production techniques, deep learning or current library workflows should choose a modern text, but this book remains a useful first exposure to why these algorithms behave as they do.

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.