GithubHelp home page GithubHelp logo

hbcbh1999 / mlp Goto Github PK

View Code? Open in Web Editor NEW

This project forked from alvarouc/mlp

0.0 2.0 0.0 2.56 MB

Multilayer Perceptron Keras wrapper for sklearn

License: GNU General Public License v3.0

Python 97.10% Shell 2.90%

mlp's Introduction

Keras Multilayer Perceptron for scikit-learn

Keras makes it very easy to implement deep-learning models, however these are not compatible with scikit-learn out-of-the-box. This prohibits our models to be tested using sciki-learn's methods GridSearchCV and cross_val_score.

I created this MLP class to be compatible with scikit-learn that contains the fit, predict, and predict_proba methods.

Install

pip install mlp

Quick guide

Initialize your classifier

from mlp import MLP
clf = MLP(n_hidden=10, n_deep=3, l1_norm=0, drop=0.1, verbose=0)

Now evaluate your classifier with scikit-learn's cross_val_score

from sklearn.cross_validation import cross_val_score
scores = cross_val_score(clf, data, label, cv=5, n_jobs=-1, scoring='f1_weighted')
print(scores)

See a complete example in https://github.com/alvarouc/mlp/blob/master/examples/moon_sklearn.ipynb

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.