Git Product home page Git Product logo

super_learner's Introduction

Super Learners

This repository contains sklearn compatible superLearner estimator. Both sequential and parallel version of the estimator was implemented gaining a speed up of 7x in the parallel one. The superLearner class can be used both for classification and regression tasks. For regression tasks the weights of each base estimator can be calculated solving the optimization problem that minimizes the sum of squares between the meta predictions and the target variable or passing a meta_learner (i.e. any parametric estimator of sklearn framework will be fine). For the classification task the weights are calculated using the accuracy of each estimator. Different metrics will be implemented.

Speedup of the parallel version

speedup

Usage

Define a library of learners as a dictionary as follows:

library = {
    "ols": linear_model.LinearRegression(),
    "ridge": linear_model.RidgeCV(alphas=np.arange(0.05, 15, 0.05)),
    "lasso" : linear_model.LassoCV(alphas=np.arange(0.05, 15.0, 0.05)),
    "elastic" :  linear_model.ElasticNetCV(alphas=np.arange(0.05, 15.0, 0.05)),
    "knn_5": neighbors.KNeighborsRegressor(n_neighbors=5),
    "knn_10": neighbors.KNeighborsRegressor(n_neighbors=10),
    "knn_15": neighbors.KNeighborsRegressor(n_neighbors=15),
}

The Super Learner class is sklearn compatible estimator. As such it has the typical fit and predicts methods. To instanciate the Super Learner we can proceed as follows:

sl = SuperLearner(base_estimators = library, folds = 10,  meta_learner = None, task = 'regression', threshold = 0.01, verbose = False)

super_learner's People

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

marcobessi23

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.