Git Product home page Git Product logo

mlopt's Introduction

Build Status codecov

mlopt

Python library including algorithms for optimization problems like weighted blending, hyperparameter tuning and more.

Installation

The package can be downloaded using

    git clone https://github.com/pklauke/mlopt

Afterwards it can be installed with

    cd mlopt 
    python3 setup.py install

Usage

Example for weighted blending with greedy optimization:

    from sklearn.metrics import mean_absolute_error
    from mlopt import BlendingTransformer

    labels = [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9]
    predictions_model_1 = [0.11, 0.19, 0.25, 0.37, 0.55, 0.62, 0.78, 0.81, 0.94]
    predictions_model_2 = [0.07, 0.21, 0.29, 0.33, 0.53, 0.54, 0.74, 0.74, 0.91]
    predictions_blended = [predictions_model_1, predictions_model_2]

    blender = BlendingTransformer(metric=mean_absolute_error, maximize=False)
    blender.fit(y=labels, X=predictions_blended)

    weights = blender.weights
    score = blender.score

    print('MAE 1: {:0.3f}'.format(mean_absolute_error(labels, predictions_model_1)))
    print('MAE 2: {:0.3f}'.format(mean_absolute_error(labels, predictions_model_2)))
    print('Optimized blending weights: ', weights)
    print('MAE blended: {:0.3f}'.format(score))

mlopt's People

Contributors

pklauke avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

hamzahalneshmi

mlopt's Issues

Can I add this to steppy/steppy-toolkit

Hi I came across this repository and find this transformer quite usefull.
I am also one of the core developers of two projects:

where we are building a toolkit with a lot of stuff that you can use for efficient data-sciensing and kaggling.
Can I add this transformer to our library or better yet would you like to make a PR with this transformer to steppy-toolkig?

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.