LENSKIT FOR PYTHON

LENSKIT FOR PYTHON
Slide Note
Embed
Share

LensKit for Python (LKPY) is a set of tools designed for experimenting with recommender systems. It provides support for training, running, and evaluating recommender algorithms, making it suitable for both research and education. With features such as data handling in pandas DataFrames, access to various algorithms, and utilities for data loading, LensKit for Python offers a comprehensive environment for working with recommender systems. The toolkit's flexibility and ease of use make it a valuable resource for those looking to delve into the world of recommendation systems.

  • Python
  • Recommender Systems
  • LensKit
  • Algorithms
  • Data Handling

Uploaded on Feb 17, 2025 | 0 Views


Download Presentation

Please find below an Image/Link to download the presentation.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.

You are allowed to download the files provided on this website for personal or commercial use, subject to the condition that they are used lawfully. All files are the property of their respective owners.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.

E N D

Presentation Transcript


  1. LENSKIT FOR PYTHON 1 Nat lia Poto ekov

  2. OUTLINE What is LensKit 1) Data, datasets and loaders 2) Algorithms 3) Working with the library 4) Experiment evaluation 5) Summary 6) 2

  3. WHAT IS LENSKIT set of Python tools for experimenting with and studying recommender systems support for training, running, and evaluating recommender algorithms suitable for research and education. LensKit for Python (LKPY) is the successor to the Java-based LensKit toolkit Available through pip or conda 3

  4. DATA Can work with any data in a pandas.DataFrame with the expected columns Expected columns: user - containing user identifiers no requirements are placed on user IDs, if needed, the algorithm transforms IDs itself using pandas methods item - containing item identifiers rating - containing user ratings (if available) 4

  5. DATASETS AND DATA LOADERS lenskit.datasets module - utilities for reading LensKit data sets no package or automatical download loading data from a local directory where you have unpacked the data set each data set class or function takes a path parameter specifying the location of the data set LensKit datasets: https://grouplens.org/datasets/movielens/ For new research (250 MB, 25 million ratings) For education or development (1 MB, 100,000 ratings 256 MB, 27 million ratings) 5

  6. ALGORITHMS Basic algorithms 1) k-NN algorithms 2) Matrix factorization algorithms 3) Add-on algorithms 4) 6

  7. BASIC ALGORITHMS Most Popular Item Recommendation Random Item Recommendation Unrated Item Candidate Selector Fallback Predictor Memorized Predictor For testing 7

  8. K-NN ALGORITHMS Implicit/explicit (default) mode explicit feedback (rating values) - you usually want to use the defaults of weighted- average aggregation and mean-centering normalization implicit feedback (unary data such as clicks and purchases, typically represented with rating values of 1 for positive items) - the usual design is sum aggregation and no centering. Item-based k-NN User-based k-NN 8

  9. MATRIX FACTORIZATION ALGORITHMS Common Support Alternating Least Squares SciKit SVD FunkSVD 9

  10. ADD-ON ALGORITHMS Sort of wrappers for algorithms from different packages Currently support for: Implicit wrappers Ben Frederickson s implicit library Support for ALS & BPR Poisson factorization hpfrec library TensorFlow algorithms Biased MF Bias-Based Fully Integrated Bayesian Personalized Ranking 10

  11. CODE EXAMPLES 11

  12. LOADING DATA 12

  13. SETTING UP ALGORITHMS 13

  14. EVAL FUNCTION 14

  15. TRAIN/TEST DATA 15

  16. DEFINE METRIC 16

  17. EVALUATION W.R.T. NDCG 17

  18. EXPERIMENT EVALUATION 18

  19. WORKING WITH THE LIBRARY Documentation https://lkpy.readthedocs.io/en/stable/index.html Nice overview of algorithms I would prefer some small examples, especially for the predictors Coding Nice getting started example with detailed guide Pretty simple usage of algorithms Data sets: provided by Lenskit small, medium or big sizes 19

  20. SUMMARY Good for learning Provides tools for all stages of working with recommender systems (from training to evaluating) Documentation written nicely Issues with installing add on algorithms 20

  21. THANK YOU FOR YOUR ATTENTION 21

More Related Content