Programming Books C Java PHP Python Learn more Browse Programming Books

Sorry, this item is not available in
Image not available for
Image not available

To view this video download Flash Player


Sign in to turn on 1-Click ordering
Sell Us Your Item
For a $10.10 Gift Card
Trade in
More Buying Choices
Have one to sell? Sell yours here
Tell the Publisher!
I'd like to read this book on Kindle

Don't have a Kindle? Get your Kindle here, or download a FREE Kindle Reading App.

Machine Learning in Action [Paperback]

by Peter Harrington
3.6 out of 5 stars  See all reviews (21 customer reviews)

List Price: $44.99
Price: $29.48 & FREE Shipping on orders over $35. Details
You Save: $15.51 (34%)
o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o
Only 20 left in stock (more on the way).
Ships from and sold by Gift-wrap available.
Want it tomorrow, April 25? Choose One-Day Shipping at checkout. Details
Free Two-Day Shipping for College Students with Amazon Student

Computer Books from Manning Publications
Brush up on JavaScript, C#, .NET, and more in the Manning Publications bookstore.

Book Description

April 16, 2012 1617290181 978-1617290183 1


Machine Learning in Action is unique book that blends the foundational theories of machine learning with the practical realities of building tools for everyday data analysis. You'll use the flexible Python programming language to build programs that implement algorithms for data classification, forecasting, recommendations, and higher-level features like summarization and simplification.

About the Book

A machine is said to learn when its performance improves with experience. Learning requires algorithms and programs that capture data and ferret out the interesting or useful patterns. Once the specialized domain of analysts and mathematicians, machine learning is becoming a skill needed by many.

Machine Learning in Action is a clearly written tutorial for developers. It avoids academic language and takes you straight to the techniques you'll use in your day-to-day work. Many (Python) examples present the core algorithms of statistical data processing, data analysis, and data visualization in code you can reuse. You'll understand the concepts and how they fit in with tactical tasks like classification, forecasting, recommendations, and higher-level features like summarization and simplification.

Readers need no prior experience with machine learning or statistical processing. Familiarity with Python is helpful.

Purchase of the print book comes with an offer of a free PDF, ePub, and Kindle eBook from Manning. Also available is all code from the book.

What's Inside
  • A no-nonsense introduction
  • Examples showing common ML tasks
  • Everyday data analysis
  • Implementing classic algorithms like Apriori and Adaboos
Table of Contents
  1. Machine learning basics
  2. Classifying with k-Nearest Neighbors
  3. Splitting datasets one feature at a time: decision trees
  4. Classifying with probability theory: naïve Bayes
  5. Logistic regression
  6. Support vector machines
  7. Improving classification with the AdaBoost meta algorithm
  9. Predicting numeric values: regression
  10. Tree-based regression
  12. Grouping unlabeled items using k-means clustering
  13. Association analysis with the Apriori algorithm
  14. Efficiently finding frequent itemsets with FP-growth
  16. Using principal component analysis to simplify data
  17. Simplifying data with the singular value decomposition
  18. Big data and MapReduce

Frequently Bought Together

Machine Learning in Action + Machine Learning for Hackers + Programming Collective Intelligence: Building Smart Web 2.0 Applications
Price for all three: $89.50

Buy the selected items together

Editorial Reviews

About the Author

Peter Harrington holds a Bachelors and a Masters Degrees in Electrical Engineering. He is a professional developer and data scientist. Peter holds five US patents and his work has been published in numerous academic journals.

Product Details

  • Paperback: 384 pages
  • Publisher: Manning Publications; 1 edition (April 16, 2012)
  • Language: English
  • ISBN-10: 1617290181
  • ISBN-13: 978-1617290183
  • Product Dimensions: 9.3 x 7.4 x 1 inches
  • Shipping Weight: 1.4 pounds (View shipping rates and policies)
  • Average Customer Review: 3.6 out of 5 stars  See all reviews (21 customer reviews)
  • Amazon Best Sellers Rank: #139,272 in Books (See Top 100 in Books)

Customer Reviews

Most Helpful Customer Reviews
50 of 53 people found the following review helpful
2.0 out of 5 stars Little on Theory, Too Much on UI June 23, 2012
Format:Paperback|Verified Purchase
I agree with other reviewers' complaints on the repetitiveness and poor flow of this book, but I want to point out some other concerns and appreciations.

In the preface Harrington emphasizes the importance of knowing the theory and being able to connect the theory to the algorithms and applications. I wholeheartedly agree with this statement, but it appears Harrington forgot this was his stated goal. The mathematics contained in the book is wishy-washy and vague, and its connections to the algorithms is at best tenuous. Harrington rarely explains why a particular formula is used, and when he does he's really explaining how it's used and not why it makes sense to use it (given, this is a common criticism of applied mathematics). He will often throw in mathematical jargon without a useable explanation. And for every paragraph spent on mathematical theory, five paragraphs are spent on how to use various third-party libraries for graphing, UI, and data collection (e.g., Tkinter, Matplotlib, Yahoo! PlaceFinder API, Google Shopping API, etc.). These are great, but they massively clutter the text. I'd much rather have a 200 page appendix than have circuitous detours sprinkled throughout the book.

One big plus is in his treatment of support vector machines. He includes (unlike many texts which are solely about support vector machines) a complete python implementation of the Sequential Minimal Optimization algorithm. That being said, it's a horrendous piece of code clearly not written for legibility. This page (page 109) is littered with at least fifteen 1-3 letter variable names and pointless statements like "if L==H: print 'L==H'; continue".
Read more ›
Comment | 
Was this review helpful to you?
23 of 25 people found the following review helpful
3.0 out of 5 stars Good attempt but needs LOT of improvement June 16, 2012
By Arun R
Format:Paperback|Verified Purchase
Looking at many good reviews on amazon, I decided to purchase this book. It's a decent book, but IMO it has been edited poorly and the code has not been tested properly.

The introduction chapter got me really excited, just like other Manning's "in Action" books do. But once I started executing the code in chapter 2 "Classifying with k-nearest neighbors" I realized that the code had bugs. Though I could figure out what's wrong and fix the bugs, I did not expect this from Manning, after having read some of their excellent books like (The Quick Python Book, Second Edition, Spring in Action and Hadoop in Action).

Moreover the book has some introduction to python and numpy in appendix A. I believe the author could have pointed the reader elsewhere for learning python and those pages could have been used to explain more of numpy and matplotlib, which the author uses freely without any explanation in the text. (Yup, be ready to read some online numpy and matplotlib tutorials and documentation.)

If you don't know python, then you can do what I did: read The Quick Python Book, Second Edition and then attempt this book.

The figures in the book are not in color so you need to execute the code to understand what the author is telling. It forces you to actually run the code, which is good, but you can't read this book without a computer in front of you.

Finally, I am a big believer in following the conventions of a language. I would have been really happy had the author followed PEP8 ([...]), because along with learning machine learning, you could have learnt some good python coding practices.
Comment | 
Was this review helpful to you?
42 of 49 people found the following review helpful
1.0 out of 5 stars Great idea, terrible execution June 15, 2012
Format:Paperback|Verified Purchase
Using Python and NumPy code to teach machine learning is a great idea. Well-written Python is so easy to understand that it's often called 'executable pseudocode', and third-party extensions such as NumPy and SciPy make it competitive with platforms like Matlab for math and science application programming. The author seems to know his subject, and he had another good idea when deciding to structure the book around the ten most popular machine learning algorithms (though he only ends up covering eight of them for reasons he explains in the introduction). Unfortunately, the book is poorly written and even more poorly edited; it reads like a very rough draft that was put once through a spell-checker and then published. The text is repetitive, confused, and often doesn't match up with the code and data sets to which it refers. Color-coded figures are published (in the print edition) in black and white. I'd hesitate to trust this author and publisher again (not to mention the reviewers who gave the book four or five stars).
Comment | 
Was this review helpful to you?
4 of 4 people found the following review helpful
2.0 out of 5 stars Poor Code Samples December 24, 2012
As a book that targets developers, I expected Machine Learning in Action to have clear and concise code samples. The author's language of choice, Python, further compounded this expectation; while I am personally not a fan of Python, it carries a well deserved reputation for being extraordinarily readable. Unfortunately, the samples suffer from serious readability issues due to violations of basic programming principles.

Since I found the violations of the Don't Repeat Yourself (DRY) principle to be both the most prolific and impactful, I will share some examples. Sorry about the lack of indentation; apparently Amazon does not like whitespace.

Page 53:
xMid = (parentPt[0]-cntrPt[0])/2.0 + cntrPt[0]
yMid = (parentPt[1]-cntrPt[1])/2.0 + cntrPt[1]

Page 70:
if trainCategory[i] == 1:
p1Num += trainMatrix[i]
p1Denom += sum(trainMatrix[i])
p0Num += trainMatrix[i]
p0Denom += sum(trainMatrix[i])

Page 79:
wordList = textParse(feed1['entries'][i]['summary']
wordList = textParse(feed0['entries'][i]['summary']

Page 90:
if int(labelMat[i]) == 1:
xcord1.append(dataArr[i,1]); ycord1.append(dataArr[i, 2])
xcord2.append(dataArr[i,1]); ycord2.append(dataArr[i, 2])

Keep in mind these are just the examples I found by doing a cursory scan while writing this review. A few instances would have been forgivable, but the problem is widespread and it had a major impact on my ability to reason about the code. Unless a revised edition with cleaner code is released (and I hope it is, there's a lot of potential here) I cannot recommend this book.
Was this review helpful to you?
Most Recent Customer Reviews
5.0 out of 5 stars Machine Learning in Python - Theory simple, Code clear
The author want to write a practical, easy to understand book for ML subject. And I think this book accomplished this object pretty well. Read more
Published 1 month ago by Yeoun Jae Kim
2.0 out of 5 stars not a good book
i would rather have two books instead one. one for java, one for machine learning. this book is quite shallow especially if you are a grad student.
Published 4 months ago by Yifan Peng
2.0 out of 5 stars Waste of money
If you want to learn about machine learning, you can't learn about it from this book. Try taking a course, perhaps, but this just doesn't cut it.
Published 5 months ago by Dennis Brooks
5.0 out of 5 stars Great complement to other books
I first borrowed an electronic copy after losing my hardcopy of Collective Intelligence. I skimmed all of the text and read more thoroughly several sections which appealed to me... Read more
Published 7 months ago by Ryan M. Balfanz
4.0 out of 5 stars very interesting and help
I bought this book to learn more about machine learning and what it is all about. I am a physicist by training, so this is a foreign topic. Read more
Published 10 months ago by Grant Eastland
2.0 out of 5 stars Explanations OK didn't like the code
My main problem with this book is the way the author structure information on the code examples. Again and again he separates data that belongs together into independent data... Read more
Published 14 months ago by Julio Garcia
5.0 out of 5 stars Good python based intro to Machine Learning
I'm a software engineer who knows some Python, and needed to dive deep into Machine Learning. Well, I got my hands on Peter's book, and spent the next few weeks learning machine... Read more
Published 14 months ago by KK
5.0 out of 5 stars A "Just Do It" Machine Learning Book
I am new to Machine Learning and I found the book a very good hands-on introduction on the subject. The author takes 8 of the Top 10 algorithms in Machine Learning (based on a 2007... Read more
Published 15 months ago by Sujit Pal
4.0 out of 5 stars Good Overview of Machine Learning
This book is a good introduction to the main algorithms used in machine learning: linear/logistics regression, kNN, decision and regression trees, naive Bayes, support vector... Read more
Published 16 months ago by entylop
4.0 out of 5 stars Great introduction
This book is a great introduction to the subject of machine learning. The author is very clear and there are tons of examples. I translated many examples from this book to Java.
Published 17 months ago by Andre C. Bandarra
Search Customer Reviews
Only search this product's reviews

What Other Items Do Customers Buy After Viewing This Item?

Sell a Digital Version of This Book in the Kindle Store

If you are a publisher or author and hold the digital rights to a book, you can sell a digital version of it in our Kindle Store. Learn more


There are no discussions about this product yet.
Be the first to discuss this product with the community.
Start a new discussion
First post:
Prompts for sign-in

Look for Similar Items by Category