Your SlideShare is downloading. ×

MyMediaLite

3,088

Published on

Talk at the FOSDEM 2011 Data Analytics Devroom about MyMediaLite. …

Talk at the FOSDEM 2011 Data Analytics Devroom about MyMediaLite.

http://fosdem.org/2011/schedule/event/mymedialite

MyMediaLite is a lightweight, multi-purpose library of recommender system algorithms written in C#.

The presentation gives a short overview of the library, how to use its features from the command line and from C#, Python, and Ruby programs, as well as how to extend the library with new recommender system algorithms.

Published in: Technology
1 Comment
5 Likes
Statistics
Notes
  • just will be use it
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
No Downloads
Views
Total Views
3,088
On Slideshare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
52
Comments
1
Likes
5
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. MyMediaLite a lightweight, multi-purpose library of recommender system algorithms Zeno Gantner University of Hildesheim February 5, 2011Zeno Gantner, University of Hildesheim: MyMediaLite Recommender System Library — http://ismll.de/mymedialite 1 / 16
  • 2. IntroductionWhat are Recommender Systems?Zeno Gantner, University of Hildesheim: MyMediaLite Recommender System Library — http://ismll.de/mymedialite 2 / 16
  • 3. IntroductionMyMediaLite: Recommender System Algorithm Library functionality rating prediction item recommendation from implicit feedback algorithm testbed target groups why use it? recommender system researchers simple educators and students free application developers scalable misc info well-documented written in C#, runs on Mono choice GNU General Public License (GPL) regular releases (1 or 2 per month)Zeno Gantner, University of Hildesheim: MyMediaLite Recommender System Library — http://ismll.de/mymedialite 3 / 16
  • 4. Using MyMediaLiteData Flow hyperparameters Recommender interaction data predictions Model user/item attributes diskZeno Gantner, University of Hildesheim: MyMediaLite Recommender System Library — http://ismll.de/mymedialite 4 / 16
  • 5. Using MyMediaLiteMethods Implemented in MyMediaLite rating prediction averages: global, user, item linear baseline method by Koren and Bell frequency-weighted Slope One k-nearest neighbor (kNN): user or item similarities, diff. similarity measures collaborative or attribute-/content-based (biased) matrix factorizationitem prediction from implicit feedback random most popular item linear content-based model optimized for BPR (BPR-Linear) support-vector machine using item attributes k-nearest neighbor (kNN) weighted regularized matrix factorization (WR-MF) matrix factorization optimized for BPR (BPR-MF)Zeno Gantner, University of Hildesheim: MyMediaLite Recommender System Library — http://ismll.de/mymedialite 5 / 16
  • 6. Using MyMediaLiteCommand-Line Tools one for each task: rating prediction, item recommendation simple text format: CSV pick method and parameters using command-line arguments evaluate, store/load models http://ismll.de/mymedialite/documentation/command_line.htmlZeno Gantner, University of Hildesheim: MyMediaLite Recommender System Library — http://ismll.de/mymedialite 6 / 16
  • 7. Using MyMediaLiteEmbedding MyMediaLite: C# using System ; using M yM e d ia Lite . Data ; using M yM e d ia Lite . E v a l ; using M yM e d ia Lite . IO ; using M yM e d ia Lite . ItemRecommendation ; p u b l i c c l a s s Example { p u b l i c s t a t i c v o i d Main ( s t r i n g [ ] a r g s ) { // l o a d t h e d a t a v a r u s e r m a p p i n g = new E n t i t y M a p p i n g ( ) ; v a r i t e m m a p p i n g = new E n t i t y M a p p i n g ( ) ; v a r t r a i n i n g d a t a = ItemRecommenderData . Read ( a r g s [ 0 ] , u s e r m a p p i n g , i t e m m a p p i n g ) ; var r e l e v a n t i t e m s = item mapping . I n t e r n a l I D s ; v a r t e s t d a t a = ItemRecommenderData . Read ( a r g s [ 1 ] , u s e r m a p p i n g , i t e m m a p p i n g ) ; // s e t up t h e recommender v a r recommender = new M o s t P o p u l a r ( ) ; recommender . S e t C o l l a b o r a t i v e D a t a ( t r a i n i n g d a t a ) ; recommender . T r a i n ( ) ; // m e a s u r e t h e a c c u r a c y on t h e t e s t d a t a s e t v a r r e s u l t s = I t e m P r e d i c t i o n E v a l . E v a l u a t e ( recommender , t e s t d a t a , t r a i n i n g d a t a , relevant items ); C o n s o l e . W r i t e L i n e ( " prec@5 ={0} " , r e s u l t s [ " prec5 " ] ) ; // make a p r e d i c t i o n f o r a c e r t a i n u s e r and i t e m C o n s o l e . W r i t e L i n e ( recommender . P r e d i c t ( u s e r m a p p i n g . T o I n t e r n a l I D ( 1 ) , item mapping . ToInternalID ( 1 ) ) ) ; } }Zeno Gantner, University of Hildesheim: MyMediaLite Recommender System Library — http://ismll.de/mymedialite 7 / 16
  • 8. Using MyMediaLiteEmbedding MyMediaLite: Python#! / u s r / b i n / e n v i p y import clr clr . AddReference ( " MyMediaLite . dll " ) from MyMediaLite import ∗# load the datauser_mapping = Data . EntityMapping ( )item_mapping = Data . EntityMapping ( )train_data = IO . I t e m R ec o m m e n d e r Da t a . Read ( " u1 . base " , user_mapping , item_mapping )relev ant_ite ms = item_mapping . InternalIDstest_data = IO . I t e m R ec o m m e n d e r Da t a . Read ( " u1 . test " , user_mapping , item_mapping )# s e t up t h e recommenderrecommender = I te mR e co m me nd a ti o n . MostPopular ( )recommender . S e t C o l l a b o r a t i v e D a t a ( train_data ) ;recommender . Train ( )# m e a s u r e t h e a c c u r a c y on t h e t e s t d a t a s e tprint Eval . I t e m Pr ed i ct i on Ev a l . Evaluate ( recommender , test_data , train_data , relevant_items )# make a p r e d i c t i o n f o r a c e r t a i n u s e r and i t e mprint recommender . Predict ( user_mapping . ToInternalID ( 1 ) , item_mapping . ToInternalID ( 1 ) )Zeno Gantner, University of Hildesheim: MyMediaLite Recommender System Library — http://ismll.de/mymedialite 8 / 16
  • 9. Using MyMediaLiteEmbedding MyMediaLite: Ruby#! / u s r / b i n / e n v i r require ’ MyMediaLite ’ min_rating = 1 max_rating = 5# load the datauser_mapping = MyMediaLite : : Data : : EntityMapping . new ( )item_mapping = MyMediaLite : : Data : : EntityMapping . new ( ) train_data = MyMediaLite : : IO : : R a t i n g P r e d i c t i o n D a t a . Read ( " u1 . base " , min_rating , max_rating , user_mapping , item_mapping ) test_data = MyMediaLite : : IO : : R a t i n g P r e d i c t i o n D a t a . Read ( " u1 . test " , min_rating , max_rating , user_mapping , item_mapping )# s e t up t h e recommenderrecommender = MyMediaLite : : RatingPrediction : : UserItemBaseline . new ( )recommender . MinRating = min_ratingrecommender . MaxRating = max_ratingrecommender . Ratings = train_datarecommender . Train ( )# m e a s u r e t h e a c c u r a c y on t h e t e s t d a t a s e teval_results = MyMediaLite : : Eval : : RatingEval : : Evaluate ( recommender , test_data )eval_results . each do | entry | puts " #{ entry } "end# make a p r e d i c t i o n f o r a c e r t a i n u s e r and i t e mputs recommender . Predict ( user_mapping . ToInternalID ( 1 ) , item_mapping . ToInternalID ( 1 ) )Zeno Gantner, University of Hildesheim: MyMediaLite Recommender System Library — http://ismll.de/mymedialite 9 / 16
  • 10. Extending MyMediaLiteRoll Your Own Recommendation Method It’s easy. for basic functionality define model data structures write Train() method write Predict() method That’s all!Zeno Gantner, University of Hildesheim: MyMediaLite Recommender System Library — http://ismll.de/mymedialite 10 / 16
  • 11. Extending MyMediaLiteRoll Your Own: Define Model Data StructuresZeno Gantner, University of Hildesheim: MyMediaLite Recommender System Library — http://ismll.de/mymedialite 11 / 16
  • 12. Extending MyMediaLiteRoll Your Own: Write Train() MethodZeno Gantner, University of Hildesheim: MyMediaLite Recommender System Library — http://ismll.de/mymedialite 12 / 16
  • 13. Extending MyMediaLiteRoll Your Own: Write Predict() MethodZeno Gantner, University of Hildesheim: MyMediaLite Recommender System Library — http://ismll.de/mymedialite 13 / 16
  • 14. Extending MyMediaLiteRoll Your Own Recommendation Method It’s easy. You do not need to worry about including the new method to the command-line tools, reflection takes care of that. advanced functionality CanPredict() method load/store models on-line updatesZeno Gantner, University of Hildesheim: MyMediaLite Recommender System Library — http://ismll.de/mymedialite 14 / 16
  • 15. ConclusionMyMediaLite future work more methods (contributions welcome . . . ) additional scenarios: context-aware recommendation, tags, . . . distributed/parallel computing Methods now shipped with MyMediaLite were used in the MyMedia field trials (>50,000 users). acknowledgements authors: Zeno Gantner, Steffen Rendle, Christoph Freudenthaler funding by EC FP7 project “Dynamic Personalization of Multimedia” (MyMedia) under grant agreement no. 215006. feedback, patches, suggestions: Thorsten Angermann, Fu Changhong, Andreas Hoffmann, Artus Krohn-Grimberghe, Christina Lichtenth¨ler, a Damir Logar, Thai-Nghe NguyenZeno Gantner, University of Hildesheim: MyMediaLite Recommender System Library — http://ismll.de/mymedialite 15 / 16
  • 16. ConclusionMyMediaLitehomepage: http://ismll.de/mymedialitefork it: http://gitorious.org/mymedialitefollow us: http://twitter.com/mymedialitesend feedback/patches: mymedialite@ismll.de MyMediaLite: simple — free — scalable — well-documentedZeno Gantner, University of Hildesheim: MyMediaLite Recommender System Library — http://ismll.de/mymedialite 16 / 16

×