Programming Collective Intelligence: Building Smart Web 2.0 Applications


Want to tap the power behind search rankings, product recommendations, social bookmarking, and online matchmaking? This fascinating book demonstrates how you can build Web 2.0 applications to mine the enormous amount of data created by people on the Internet. With the sophisticated algorithms in this book, you can write smart programs to access interesting datasets from other web sites, collect data from users of your own applications, and analyze and understand the data once ...

See more details below
$26.80 price
(Save 32%)$39.99 List Price

Pick Up In Store

Reserve and pick up in 60 minutes at your local store

Other sellers (Paperback)
  • All (17) from $11.84   
  • New (10) from $21.72   
  • Used (7) from $11.84   
Programming Collective Intelligence: Building Smart Web 2.0 Applications

Available on NOOK devices and apps  
  • NOOK Devices
  • NOOK HD/HD+ Tablet
  • NOOK
  • NOOK Color
  • NOOK Tablet
  • Tablet/Phone
  • NOOK for Windows 8 Tablet
  • NOOK for iOS
  • NOOK for Android
  • NOOK Kids for iPad
  • PC/Mac
  • NOOK for Windows 8
  • NOOK for PC
  • NOOK for Mac
  • NOOK Study
  • NOOK for Web

Want a NOOK? Explore Now

NOOK Book (eBook)
$17.99 price
(Save 43%)$31.99 List Price


Want to tap the power behind search rankings, product recommendations, social bookmarking, and online matchmaking? This fascinating book demonstrates how you can build Web 2.0 applications to mine the enormous amount of data created by people on the Internet. With the sophisticated algorithms in this book, you can write smart programs to access interesting datasets from other web sites, collect data from users of your own applications, and analyze and understand the data once you've found it.

Programming Collective Intelligence takes you into the world of machine learning and statistics, and explains how to draw conclusions about user experience, marketing, personal tastes, and human behavior in general — all from information that you and others collect every day. Each algorithm is described clearly and concisely with code that can immediately be used on your web site, blog, Wiki, or specialized application. This book explains:

  • Collaborative filtering techniques that enable online retailers to recommend products or media
  • Methods of clustering to detect groups of similar items in a large dataset
  • Search engine features — crawlers, indexers, query engines, and the PageRank algorithm
  • Optimization algorithms that search millions of possible solutions to a problem and choose the best one
  • Bayesian filtering, used in spam filters for classifying documents based on word types and other features
  • Using decision trees not only to make predictions, but to model the way decisions are made
  • Predicting numerical values rather than classifications to build price models
  • Support vector machines to match people in online dating sites
  • Non-negative matrix factorization to find the independent features in a dataset
  • Evolving intelligence for problem solving — how a computer develops its skill by improving its own code the more it plays a game
Each chapter includes exercises for extending the algorithms to make them more powerful. Go beyond simple database-backed applications and put the wealth of Internet data to work for you.

"Bravo! I cannot think of a better way for a developer to first learn these algorithms and methods, nor can I think of a better way for me (an old AI dog) to reinvigorate my knowledge of the details."
— Dan Russell, Google

"Toby's book does a great job of breaking down the complex subject matter of machine-learning algorithms into practical, easy-to-understand examples that can be directly applied to analysis of social interaction across the Web today. If I had this book two years ago, it would have saved precious time going down some fruitless paths."
— Tim Wolters, CTO, Collective Intellect

Read More Show Less

Product Details

  • ISBN-13: 9780596529321
  • Publisher: O'Reilly Media, Incorporated
  • Publication date: 8/15/2007
  • Edition number: 1
  • Pages: 362
  • Sales rank: 953,199
  • Product dimensions: 7.00 (w) x 9.20 (h) x 0.90 (d)

Meet the Author

Toby Segaran is the author of Programming Collective Intelligence, a very popular O'Reilly title. He was the founder of Incellico, a biotech software company later acquired by Genstruct. He currently holds the title of Data Magnate at Metaweb Technologies and is a frequent speaker at technology conferences.

Read More Show Less

Table of Contents

Praise for Programming Collective Intelligence;
Style of Examples;
Why Python?;
Open APIs;
Overview of the Chapters;
Using Code Examples;
How to Contact Us;
Safari® Books Online;
Chapter 1: Introduction to Collective Intelligence;
1.1 What Is Collective Intelligence?;
1.2 What Is Machine Learning?;
1.3 Limits of Machine Learning;
1.4 Real-Life Examples;
1.5 Other Uses for Learning Algorithms;
Chapter 2: Making Recommendations;
2.1 Collaborative Filtering;
2.2 Collecting Preferences;
2.3 Finding Similar Users;
2.4 Recommending Items;
2.5 Matching Products;
2.6 Building a Link Recommender;
2.7 Item-Based Filtering;
2.8 Using the MovieLens Dataset;
2.9 User-Based or Item-Based Filtering?;
2.10 Exercises;
Chapter 3: Discovering Groups;
3.1 Supervised versus Unsupervised Learning;
3.2 Word Vectors;
3.3 Hierarchical Clustering;
3.4 Drawing the Dendrogram;
3.5 Column Clustering;
3.6 K-Means Clustering;
3.7 Clusters of Preferences;
3.8 Viewing Data in Two Dimensions;
3.9 Other Things to Cluster;
3.10 Exercises;
Chapter 4: Searching and Ranking;
4.1 What's in a Search Engine?;
4.2 A Simple Crawler;
4.3 Building the Index;
4.4 Querying;
4.5 Content-Based Ranking;
4.6 Using Inbound Links;
4.7 Learning from Clicks;
4.8 Exercises;
Chapter 5: Optimization;
5.1 Group Travel;
5.2 Representing Solutions;
5.3 The Cost Function;
5.4 Random Searching;
5.5 Hill Climbing;
5.6 Simulated Annealing;
5.7 Genetic Algorithms;
5.8 Real Flight Searches;
5.9 Optimizing for Preferences;
5.10 Network Visualization;
5.11 Other Possibilities;
5.12 Exercises;
Chapter 6: Document Filtering;
6.1 Filtering Spam;
6.2 Documents and Words;
6.3 Training the Classifier;
6.4 Calculating Probabilities;
6.5 A Naïve Classifier;
6.6 The Fisher Method;
6.7 Persisting the Trained Classifiers;
6.8 Filtering Blog Feeds;
6.9 Improving Feature Detection;
6.10 Using Akismet;
6.11 Alternative Methods;
6.12 Exercises;
Chapter 7: Modeling with Decision Trees;
7.1 Predicting Signups;
7.2 Introducing Decision Trees;
7.3 Training the Tree;
7.4 Choosing the Best Split;
7.5 Recursive Tree Building;
7.6 Displaying the Tree;
7.7 Classifying New Observations;
7.8 Pruning the Tree;
7.9 Dealing with Missing Data;
7.10 Dealing with Numerical Outcomes;
7.11 Modeling Home Prices;
7.12 Modeling "Hotness";
7.13 When to Use Decision Trees;
7.14 Exercises;
Chapter 8: Building Price Models;
8.1 Building a Sample Dataset;
8.2 k-Nearest Neighbors;
8.3 Weighted Neighbors;
8.4 Cross-Validation;
8.5 Heterogeneous Variables;
8.6 Optimizing the Scale;
8.7 Uneven Distributions;
8.8 Using Real Data—the eBay API;
8.9 When to Use k-Nearest Neighbors;
8.10 Exercises;
Chapter 9: Advanced Classification: Kernel Methods and SVMs;
9.1 Matchmaker Dataset;
9.2 Difficulties with the Data;
9.3 Basic Linear Classification;
9.4 Categorical Features;
9.5 Scaling the Data;
9.6 Understanding Kernel Methods;
9.7 Support-Vector Machines;
9.8 Using LIBSVM;
9.9 Matching on Facebook;
9.10 Exercises;
Chapter 10: Finding Independent Features;
10.1 A Corpus of News;
10.2 Previous Approaches;
10.3 Non-Negative Matrix Factorization;
10.4 Displaying the Results;
10.5 Using Stock Market Data;
10.6 Exercises;
11.1 What Is Genetic Programming?;
11.2 Programs As Trees;
11.3 Creating the Initial Population;
11.4 Testing a Solution;
11.5 Mutating Programs;
11.6 Crossover;
11.7 Building the Environment;
11.8 A Simple Game;
11.9 Further Possibilities;
11.10 Exercises;
Chapter 12: Algorithm Summary;
12.1 Bayesian Classifier;
12.2 Decision Tree Classifier;
12.3 Neural Networks;
12.4 Support-Vector Machines;
12.5 k-Nearest Neighbors;
12.6 Clustering;
12.7 Multidimensional Scaling;
12.8 Non-Negative Matrix Factorization;
12.9 Optimization;
Third-Party Libraries;
Universal Feed Parser;
Python Imaging Library;
Beautiful Soup;
Mathematical Formulas;
Euclidean Distance;
Pearson Correlation Coefficient;
Weighted Mean;
Tanimoto Coefficient;
Conditional Probability;
Gini Impurity;
Gaussian Function;

Read More Show Less

Customer Reviews

Be the first to write a review
( 0 )
Rating Distribution

5 Star


4 Star


3 Star


2 Star


1 Star


Your Rating:

Your Name: Create a Pen Name or

Barnes & Review Rules

Our reader reviews allow you to share your comments on titles you liked, or didn't, with others. By submitting an online review, you are representing to Barnes & that all information contained in your review is original and accurate in all respects, and that the submission of such content by you and the posting of such content by Barnes & does not and will not violate the rights of any third party. Please follow the rules below to help ensure that your review can be posted.

Reviews by Our Customers Under the Age of 13

We highly value and respect everyone's opinion concerning the titles we offer. However, we cannot allow persons under the age of 13 to have accounts at or to post customer reviews. Please see our Terms of Use for more details.

What to exclude from your review:

Please do not write about reviews, commentary, or information posted on the product page. If you see any errors in the information on the product page, please send us an email.

Reviews should not contain any of the following:

  • - HTML tags, profanity, obscenities, vulgarities, or comments that defame anyone
  • - Time-sensitive information such as tour dates, signings, lectures, etc.
  • - Single-word reviews. Other people will read your review to discover why you liked or didn't like the title. Be descriptive.
  • - Comments focusing on the author or that may ruin the ending for others
  • - Phone numbers, addresses, URLs
  • - Pricing and availability information or alternative ordering information
  • - Advertisements or commercial solicitation


  • - By submitting a review, you grant to Barnes & and its sublicensees the royalty-free, perpetual, irrevocable right and license to use the review in accordance with the Barnes & Terms of Use.
  • - Barnes & reserves the right not to post any review -- particularly those that do not follow the terms and conditions of these Rules. Barnes & also reserves the right to remove any review at any time without notice.
  • - See Terms of Use for other conditions and disclaimers.
Search for Products You'd Like to Recommend

Recommend other products that relate to your review. Just search for them below and share!

Create a Pen Name

Your Pen Name is your unique identity on It will appear on the reviews you write and other website activities. Your Pen Name cannot be edited, changed or deleted once submitted.

Your Pen Name can be any combination of alphanumeric characters (plus - and _), and must be at least two characters long.

Continue Anonymously
Sort by: Showing all of 4 Customer Reviews
  • Anonymous

    Posted September 5, 2008

    Must read!

    This book is one of the best technology books I have EVER read. It covers many topics with both depth and unity, yet simplicity and structure. It is well written and fun, and certainly useful. This book is a must read for anyone interested even vaguely in collective intelligence.

    Was this review helpful? Yes  No   Report this review
  • Anonymous

    Posted January 5, 2011

    No text was provided for this review.

  • Anonymous

    Posted April 19, 2010

    No text was provided for this review.

  • Anonymous

    Posted October 27, 2010

    No text was provided for this review.

Sort by: Showing all of 4 Customer Reviews

If you find inappropriate content, please report it to Barnes & Noble
Why is this product inappropriate?
Comments (optional)