GithubHelp home page GithubHelp logo

zafar-hussain / lk-demo-experiment Goto Github PK

View Code? Open in Web Editor NEW

This project forked from lenskit/lk-demo-experiment

0.0 0.0 0.0 830 KB

Example project for running LensKit experiments

Shell 0.15% Python 2.11% Jupyter Notebook 97.74%

lk-demo-experiment's Introduction

LensKit Demo Experiment

This repository contains a demo experiment for running LensKit experiments on public data sets with current best practices for moderately-sized experiments.

Layout

This experiment uses DVC to script the experiment, and is laid out in several subcomponents:

  • lkdemo is a Python package containing support code (e.g. log configurations) and algorithm definitions. Two files are of particular interest:

    • lkdemo/algorithms.py defines the different algorithms we can train with sensible default configurations.
    • lkdemo/datasets.py defines the different data sets, so that any supported data set can be loaded into the format LensKit expects in a uniform fashion.
  • data contains data files and controls.

  • data-split contains cross-validation splits, produced by split-data.py. These splits only contain the test files, to save disk space - the train files can be obtained with lkdemo.datasets.ds_diff, as seen in run-algo.py.

  • runs contains the results of running LensKit train/test runs.

  • Various Python scripts to run individual pieces of the analysis. They use docopt for parsing their arguments and thus have comprehensive usage docs in their docstrings.

  • Jupyter notebooks to analyze results. These are parameterized and run with Papermill to analyze different data sets with the same notebook.

Setup

This experiment comes with an Anaconda environment file that defines the necessary dependencies. To set up and activate:

conda env create -f environment.yml
conda activate lk-demo

After creating the environment, you just need to activate; you can update the environment with conda env update -f environment.yml.

Running

The dvc program controls runs of individual steps, including downloading data. For example, to download the ML-20M data set and recommend with ALS, run:

dvc repro runs/dvc.yaml:ml20m@ALS

To re-run the whole experiment:

dvc repro

To reproduce results on one data set:

dvc repro eval-report-ml100k

Extending

The various dvc.yaml files control the run. Look at them to modify and extend!

You will probably want to consult the DVC user guide.

lk-demo-experiment's People

Contributors

mdekstrand avatar ngozi-ihemelandu avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.