GithubHelp home page GithubHelp logo

thededlier / auto-surprise-1 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from isg-siegen/auto-surprise

0.0 0.0 0.0 71 KB

An AutoRecSys library for Surprise. Automate algorithm selection and hyperparameter tuning :rocket:

License: MIT License

Python 100.00%

auto-surprise-1's Introduction

Auto-Surprise

Auto-Surprise is built as a wrapper around the Python Surprise recommender-system library. It automates algorithm selection and hyper parameter optimization in a highly parallelized manner.

AutoSurprise is currently in development.

Setup

To setup Auto-Surprise, you will require Python3 installed on a linux system. Auto-Surprise can be installed using pip

pip install auto-surprise

Usage

Basic usage of AutoSurprise is given below.

from surprise import Dataset
from auto_surprise.engine import Engine

# Load the dataset
if __name__ == '__main__':
    data = Dataset.load_builtin('ml-100k')

    # Intitialize auto surprise engine
    engine = Engine(debug=False)

    # Start the trainer
    best_model, best_params, best_score, tasks = engine.train(data=data, target_metric='test_rmse', cpu_time_limit=720, max_evals=100)

In the above example, we first initialize the Engine. We then run engine.train() to begin training our model. To train the model we need to pass the following

  • data : The data as an instance of surprise.dataset.DatasetAutoFolds. Please read Surprise Dataset docs
  • target_metric : The metric we seek to minimize. Available options are test_rmse and test_mae.
  • cpu_time_limit : The time limit we want to train. This is in seconds. For datasets like Movielens 100k, 1 hour is sufficient. But you may want to increase this based on the size of your dataset
  • max_evals: The maximum number of evaluations each algorithm gets for hyper parameter optimization.
  • hpo_algo: Auto-Surprise uses Hyperopt for hyperparameter tuning. By default, it's set to use TPE, but you can change this to any algorithm supported by hyperopt, such as Adaptive TPE or Random search.
# Example for setting the HPO algorithm to adaptive TPE
import hyperopt

...

engine = Engine(debug=False)
engine.train(
    data=data,
    target_metric='test_rmse',
    cpu_time_limit=720,
    max_evals=100,
    hpo_algo=hyperopt.atpe.suggest
)

auto-surprise-1's People

Contributors

thededlier 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.