1 / 76

Apache Mahout Feb 13, 2012 Shannon Quinn

Cloud Computing CS 15-319. Apache Mahout Feb 13, 2012 Shannon Quinn. MapReduce Review. Scalable programming model Map phase Shuffle Reduce phase MapReduce Implementations Google Hadoop. chunks. C0. C1. C2. C3. Map Phase. M0. M1. M2. M3. mappers. IO0. IO1. IO2. IO3.

erek
Download Presentation

Apache Mahout Feb 13, 2012 Shannon Quinn

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Cloud ComputingCS 15-319 Apache Mahout Feb 13, 2012 Shannon Quinn

  2. MapReduce Review • Scalable programming model • Map phase • Shuffle • Reduce phase • MapReduce Implementations • Google • Hadoop chunks C0 C1 C2 C3 Map Phase M0 M1 M2 M3 mappers IO0 IO1 IO2 IO3 Shuffling Data R0 R1 Reduce Phase Reducers FO0 FO1 Figure from lecture 6: MapReduce

  3. MapReduce Review • Scalable programming model • Map phase • Shuffle • Reduce phase • MapReduce Implementations • Google • Hadoop chunks C0 C1 C2 C3 Map Phase M0 M1 M2 M3 mappers IO0 IO1 IO2 IO3 Shuffling Data R0 R1 Reduce Phase Reducers FO0 FO1 Figure from lecture 6: MapReduce This is our focus!

  4. Apache Mahout • A scalable machine learning library

  5. Apache Mahout • A scalable machine learning library • Built on Hadoop

  6. Apache Mahout • A scalable machine learning library • Built on Hadoop • Philosophy of Mahout (and Hadoop by proxy)

  7. What does Mahout do?

  8. Recommendation

  9. Classification

  10. Clustering

  11. Other Mahout Algorithms • Dimensionality Reduction • Regression • Evolutionary Algorithms

  12. Mahout • Recommendation • Classification • Clustering

  13. Recommendation Overview • Help users find items they might like based on historical preferences

  14. Recommendation Overview • Mathematically

  15. Recommendation Overview Alice 5 1 4 ? Bob 2 5 Peter 4 3 2 *based on example by Sebastian Schelter

  16. Recommendation Overview 5 1 4 - 2 5 4 3 2 *based on example by Sebastian Schelter

  17. Recommendation Overview 5 1 4 ? Bob 2 5 4 3 2 *based on example by Sebastian Schelter

  18. Recommendation Overview 5 1 4 1.5 Bob 2 5 4 3 2 *based on example by Sebastian Schelter

  19. Recommendation in Mahout • 1st Map phase: process input (Alice, Matrix, 5) <Alice, (Matrix, 5)> (Alice, Alien, 1) <Alice, (Alien, 1)> (Alice, Inception, 4) <Alice, (Inception, 4)> (Bob, Alien, 2) <Bob, (Alien, 2)> *based on example by Sebastian Schelter

  20. Recommendation in Mahout *based on example by Sebastian Schelter • 1st Map phase: process input • 1st Reduce phase: list by user (Alice, Matrix, 5) <Alice, (Matrix, 5)> (Alice, Alien, 1) <Alice, (Alien, 1)> (Alice, Inception, 4) <Alice, (Inception, 4)> (Bob, Alien, 2) <Bob, (Alien, 2)> <Alice, (Matrix, 5)> <Alice, (Matrix, 5);(Alien, 1);…> <Alice, (Alien, 1)> <Alice, (Inception, 4)> <Bob, (Alien, 2);(Inception, 5);…> <Bob, (Alien, 2)>

  21. Recommendation in Mahout • 2nd Map phase: Emit co-occurred ratings <Alice, (Matrix, 5);(Alien, 1);…> <Matrix;Alien, (5;1)> <Matrix;Inception, (5;4)> <Alien;Inception, (1;4)> <Bob, (Alien, 2);(Inception, 5);…> <Alien;Inception, (2;5)> *based on example by Sebastian Schelter

  22. Recommendation in Mahout *based on example by Sebastian Schelter • 2nd Map phase: Emit co-occurred ratings • 2nd Reduce phase: Compute similarities <Alice, (Matrix, 5);(Alien, 1);…> <Matrix;Alien, (5;1)> <Matrix;Inception, (5;4)> <Alien;Inception, (1;4)> <Bob, (Alien, 2);(Inception, 5);…> <Alien;Inception, (2;5)> <Matrix;Alien, (5;1)> <Matrix;Alien, (4;3)> <Matrix;Alien, (-0.47)> <Matrix;Inception, (5;4)> <Matrix;Inception, (4;2)> <Matrix;Inception, (0.47)>

  23. Mahout • Recommendation • Classification • Clustering

  24. Classification Overview • Assigning data to discrete categories

  25. Classification Overview • Assigning data to discrete categories • Train a model on labeled data Not spam Spam

  26. Classification Overview • Assigning data to discrete categories • Train a model on labeled data • Run the model on new, unlabeled data ? Not spam Spam

  27. Naïve Bayes Example

  28. Naïve Bayes Example Prob (token | label) =

  29. Naïve Bayes Example Not spam

  30. Naïve Bayes Example Not spam President Obama’s Nobel Prize Speech

  31. Naïve Bayes Example Spam

  32. Naïve Bayes Example Spam Spam email content

  33. Naïve Bayes Example

  34. Naïve Bayes Example “Order a trial Adobe chicken daily EAB-List new summer savings, welcome!”

  35. Naïve Bayes in Mahout • Complex!

  36. Naïve Bayes in Mahout • Complex! • Training • Read the features

  37. Naïve Bayes in Mahout • Complex! • Training • Read the features • Calculate per-document statistics

  38. Naïve Bayes in Mahout • Complex! • Training • Read the features • Calculate per-document statistics • Normalize across categories

  39. Naïve Bayes in Mahout • Complex! • Training • Read the features • Calculate per-document statistics • Normalize across categories • Calculate normalizing factor of each label

  40. Naïve Bayes in Mahout • Complex! • Training • Read the features • Calculate per-document statistics • Normalize across categories • Calculate normalizing factor of each label • Testing • Classification

  41. Other Classification Algorithms • Stochastic Gradient Descent

  42. Other Classification Algorithms • Stochastic Gradient Descent • Support Vector Machines

  43. Other Classification Algorithms • Stochastic Gradient Descent • Support Vector Machines • Random Forests

  44. Mahout • Recommendation • Classification • Clustering

  45. Clustering Overview • Grouping unstructured data

  46. Clustering Overview • Grouping unstructured data • Small intra-cluster distance

  47. Clustering Overview • Grouping unstructured data • Small intra-cluster distance • Large inter-cluster distance

  48. K-Means Clustering Example

  49. K-Means Clustering Example

  50. K-Means Clustering Example

More Related