AEM integration with Apache Mahout
-
Upload
ankit-gubrani -
Category
Technology
-
view
136 -
download
1
Transcript of AEM integration with Apache Mahout
![Page 1: AEM integration with Apache Mahout](https://reader034.fdocuments.net/reader034/viewer/2022042600/589cb7b51a28abbe4a8b6f89/html5/thumbnails/1.jpg)
APACHE SLING & FRIENDS TECH MEETUPBERLIN, 26-28 SEPTEMBER 2016
Integrating Apache Mahout with AEMAnkit Gubrani & Rima Mittal
![Page 2: AEM integration with Apache Mahout](https://reader034.fdocuments.net/reader034/viewer/2022042600/589cb7b51a28abbe4a8b6f89/html5/thumbnails/2.jpg)
adaptTo() 2016 2
Speakers Bio
![Page 3: AEM integration with Apache Mahout](https://reader034.fdocuments.net/reader034/viewer/2022042600/589cb7b51a28abbe4a8b6f89/html5/thumbnails/3.jpg)
adaptTo() 2016 3
Agenda
![Page 4: AEM integration with Apache Mahout](https://reader034.fdocuments.net/reader034/viewer/2022042600/589cb7b51a28abbe4a8b6f89/html5/thumbnails/4.jpg)
Agenda
adaptTo() 2016 4
Introduction to Apache Mahout Machine Learning Recommendations AEM with Apache Mahout Demo Extension Points
![Page 5: AEM integration with Apache Mahout](https://reader034.fdocuments.net/reader034/viewer/2022042600/589cb7b51a28abbe4a8b6f89/html5/thumbnails/5.jpg)
adaptTo() 2016 5
Introduction to Apache Mahout
![Page 6: AEM integration with Apache Mahout](https://reader034.fdocuments.net/reader034/viewer/2022042600/589cb7b51a28abbe4a8b6f89/html5/thumbnails/6.jpg)
What is Apache Mahout?
adaptTo() 2016 6
Project of the Apache Software Foundation.
Producing free implementations of scalable machine learning algorithms, written in Java.
![Page 7: AEM integration with Apache Mahout](https://reader034.fdocuments.net/reader034/viewer/2022042600/589cb7b51a28abbe4a8b6f89/html5/thumbnails/7.jpg)
History
adaptTo() 2016 7
Started as a Lucene sub-project. Became Apache TLP in April 2010. Latest version – 0.12.2 – Released on
13th June 2016.
![Page 8: AEM integration with Apache Mahout](https://reader034.fdocuments.net/reader034/viewer/2022042600/589cb7b51a28abbe4a8b6f89/html5/thumbnails/8.jpg)
Why Apache Mahout?
adaptTo() 2016 8
Increasing volume of data! Traditional Data mining algorithms
struggle to process very large datasets.
Apache Mahout to the rescue!
![Page 9: AEM integration with Apache Mahout](https://reader034.fdocuments.net/reader034/viewer/2022042600/589cb7b51a28abbe4a8b6f89/html5/thumbnails/9.jpg)
Traditional Machine Learning
adaptTo() 2016 9
![Page 10: AEM integration with Apache Mahout](https://reader034.fdocuments.net/reader034/viewer/2022042600/589cb7b51a28abbe4a8b6f89/html5/thumbnails/10.jpg)
Machine Learning with Mahout
adaptTo() 2016 10
![Page 11: AEM integration with Apache Mahout](https://reader034.fdocuments.net/reader034/viewer/2022042600/589cb7b51a28abbe4a8b6f89/html5/thumbnails/11.jpg)
Applications
adaptTo() 2016 11
Adobe, Facebook, LinkedIn, Twitter and Yahoo use Mahout internally.
Twitter uses Mahout for interest modelling.
Yahoo! Uses Mahout for pattern mining.
![Page 12: AEM integration with Apache Mahout](https://reader034.fdocuments.net/reader034/viewer/2022042600/589cb7b51a28abbe4a8b6f89/html5/thumbnails/12.jpg)
adaptTo() 2016 12
Machine Learning
![Page 13: AEM integration with Apache Mahout](https://reader034.fdocuments.net/reader034/viewer/2022042600/589cb7b51a28abbe4a8b6f89/html5/thumbnails/13.jpg)
Machine Learning
adaptTo() 2016 13
Programming computers to optimize a Performance Criterion using Example Data or Past Experience Branch of Artificial Intelligence. Computers evolve behavior based on
Empirical data.
![Page 14: AEM integration with Apache Mahout](https://reader034.fdocuments.net/reader034/viewer/2022042600/589cb7b51a28abbe4a8b6f89/html5/thumbnails/14.jpg)
Techniques
adaptTo() 2016 14
Supervised Learning Use Labelled training data to create a
classifier that can predict output for unseen inputs.
Unsupervised Learning Use Unlabeled training data to create a
function that can predict output.
![Page 15: AEM integration with Apache Mahout](https://reader034.fdocuments.net/reader034/viewer/2022042600/589cb7b51a28abbe4a8b6f89/html5/thumbnails/15.jpg)
Machine Learning with Apache Mahout
adaptTo() 2016 15
Data Science use cases Mahout supports: Collaborative Filtering Clustering Classification
![Page 16: AEM integration with Apache Mahout](https://reader034.fdocuments.net/reader034/viewer/2022042600/589cb7b51a28abbe4a8b6f89/html5/thumbnails/16.jpg)
Collaborative Filtering
adaptTo() 2016 16
User behavior mining to make product recommendations.
![Page 17: AEM integration with Apache Mahout](https://reader034.fdocuments.net/reader034/viewer/2022042600/589cb7b51a28abbe4a8b6f89/html5/thumbnails/17.jpg)
Clustering
adaptTo() 2016 17
Organizing items into naturally occurring groups, such that items belonging to same group are similar to each other
![Page 18: AEM integration with Apache Mahout](https://reader034.fdocuments.net/reader034/viewer/2022042600/589cb7b51a28abbe4a8b6f89/html5/thumbnails/18.jpg)
Classification
adaptTo() 2016 18
Learning from existing categorizations and assigning unclassified items to the best category
![Page 19: AEM integration with Apache Mahout](https://reader034.fdocuments.net/reader034/viewer/2022042600/589cb7b51a28abbe4a8b6f89/html5/thumbnails/19.jpg)
adaptTo() 2016 19
Recommendations
![Page 20: AEM integration with Apache Mahout](https://reader034.fdocuments.net/reader034/viewer/2022042600/589cb7b51a28abbe4a8b6f89/html5/thumbnails/20.jpg)
Apache Mahout Recommendation Engine
adaptTo() 2016 20
Helps users find items they might like based on historical behavior and preferences.
Mahout provides a rich set of components from which a customized recommender system can be constructed using a selection of Algorithms.
![Page 21: AEM integration with Apache Mahout](https://reader034.fdocuments.net/reader034/viewer/2022042600/589cb7b51a28abbe4a8b6f89/html5/thumbnails/21.jpg)
Architecture
adaptTo() 2016 21
Top Level Packages DataModel UserSimilarity ItemSimilarity UserNeighboorhood Recommender
![Page 22: AEM integration with Apache Mahout](https://reader034.fdocuments.net/reader034/viewer/2022042600/589cb7b51a28abbe4a8b6f89/html5/thumbnails/22.jpg)
adaptTo() 2016 22
AEM with Apache Mahout
![Page 23: AEM integration with Apache Mahout](https://reader034.fdocuments.net/reader034/viewer/2022042600/589cb7b51a28abbe4a8b6f89/html5/thumbnails/23.jpg)
Checklist
adaptTo() 2016 23
AEM 6.2 Mahout as a Maven Dependency
<dependency><groupId>org.apache.mahout</groupId><artifactId>mahout-mr</artifactId><version>0.10.0</version>
</dependency>
![Page 24: AEM integration with Apache Mahout](https://reader034.fdocuments.net/reader034/viewer/2022042600/589cb7b51a28abbe4a8b6f89/html5/thumbnails/24.jpg)
JCRDataModel
adaptTo() 2016 24
DataModel Implementations representing a
repository of information about users and their associated preferences. AbstractDataModel, JDBCDataModel, FileDataModel,
GenericBooleanPrefDataModel, GenericDataModel. AEM - JCRDataModel.
![Page 25: AEM integration with Apache Mahout](https://reader034.fdocuments.net/reader034/viewer/2022042600/589cb7b51a28abbe4a8b6f89/html5/thumbnails/25.jpg)
25
Code (1/2)
adaptTo() 2016
Using The AEM JCRDataModelpublic JSONArray getUserBasedRecommendations(ResourceResolver resourceResolver, String userId, int numberOfRecommendations) {
//Creating JCRDataModel to fetch information from JCR DataModel model = JCRDataModel.createDataModel(resourceResolver);
}
![Page 26: AEM integration with Apache Mahout](https://reader034.fdocuments.net/reader034/viewer/2022042600/589cb7b51a28abbe4a8b6f89/html5/thumbnails/26.jpg)
26
Code (2/2)
adaptTo() 2016
AEM-Mahout Recommendation stepsUserSimilarity userSimilarity = getSimilarity(model);
UserNeighborhood neighborhood = getNeighbourHood(N_NEIGHOBUR_HOOD, userSimilarity, model);
GenericUserBasedRecommender recommender = new GenericUserBasedRecommender(model, neighborhood, userSimilarity);
recommendations = recommender.recommend(userIdHash, numberOfRecommedations, null, false);
![Page 27: AEM integration with Apache Mahout](https://reader034.fdocuments.net/reader034/viewer/2022042600/589cb7b51a28abbe4a8b6f89/html5/thumbnails/27.jpg)
AEM Product Recommendation
adaptTo() 2016 27
User Based Recommendation Takes user ratings into consideration Based on PearsonCorrelationSimilarity Uses NearestNUserNeighborhood
![Page 28: AEM integration with Apache Mahout](https://reader034.fdocuments.net/reader034/viewer/2022042600/589cb7b51a28abbe4a8b6f89/html5/thumbnails/28.jpg)
Configuring JCRDataModel
adaptTo() 2016 28
Configurations User Generated Content Path
/content/usergenerated/asi/jcr Product Path
/etc/commerce/products/geometrixx-outdoors Rating Resource Type
Defaults to social/tally/components/response
![Page 29: AEM integration with Apache Mahout](https://reader034.fdocuments.net/reader034/viewer/2022042600/589cb7b51a28abbe4a8b6f89/html5/thumbnails/29.jpg)
adaptTo() 2016 29
Demo
![Page 30: AEM integration with Apache Mahout](https://reader034.fdocuments.net/reader034/viewer/2022042600/589cb7b51a28abbe4a8b6f89/html5/thumbnails/30.jpg)
adaptTo() 2016 30
Appendix
![Page 31: AEM integration with Apache Mahout](https://reader034.fdocuments.net/reader034/viewer/2022042600/589cb7b51a28abbe4a8b6f89/html5/thumbnails/31.jpg)
Appendix
adaptTo() 2016 31
https://mahout.apache.org/ http://www.slideshare.net/VaradMeru/
introduction-to-mahout-and-machine-learning
https://www.youtube.com/watch?v=iMAMYzfRiS4
![Page 32: AEM integration with Apache Mahout](https://reader034.fdocuments.net/reader034/viewer/2022042600/589cb7b51a28abbe4a8b6f89/html5/thumbnails/32.jpg)
adaptTo() 2016 32
Clone the code!
![Page 33: AEM integration with Apache Mahout](https://reader034.fdocuments.net/reader034/viewer/2022042600/589cb7b51a28abbe4a8b6f89/html5/thumbnails/33.jpg)
Code Repository
adaptTo() 2016 33
https://github.com/ankit-gubrani/AEMMahout.git
![Page 34: AEM integration with Apache Mahout](https://reader034.fdocuments.net/reader034/viewer/2022042600/589cb7b51a28abbe4a8b6f89/html5/thumbnails/34.jpg)
adaptTo() 2016 34
Questions.
![Page 35: AEM integration with Apache Mahout](https://reader034.fdocuments.net/reader034/viewer/2022042600/589cb7b51a28abbe4a8b6f89/html5/thumbnails/35.jpg)
adaptTo() 2016 35
Thank you.