Giter Club home page Giter Club logo

molearn's Introduction

MOLearn

Methods for Multiple-Output Learning in python

About

This package provides multi-output methods in python, using scikit-learn for base classifiers. Classifiers are written in the style of scikit-learn classifiers.

For a maturing Java-based framework for multi-label multi-output learning, see the MEKA framework. But sometimes, it's nice to work in python, hence this project. The basic problem transformation methods are implemented, as in MEKA, except using scikit-learn for base classifiers. I have also come across the scikit-multilearn with similar goals which also in fact has a wrapper to MEKA classifiers.

Installation

Installation requires numpy and scikit-learn. To install:

	$ python setup.py install

Or, if you will be developing, then

	git clone https://github.com/jmread/molearn
	cd molearn
	python setup.py develop

If you install locally, then use the --prefix option, e.g.,

	python setup.py develop --prefix=$HOME/.local/

Running

To check that it is working, run the demo:

	$ python runDemo.py

Examples

Data is represented in two-dimensional numpy arrays, similarly to sklearn.
For example, to run Classifier Chains with a Random Forest base classifier:

from molearn.classifiers.CC import CC
from sklearn.ensemble import RandomForestClassifier

h = CC(h=RandomForestClassifier(n_estimators=100))
h.fit(X_train,Y_train)
Y_pred = h.predict_proba(X_test)

print "Exact Match: ", Exact_match(Y_test,Y_pred > 0.5)

For further examples, have a look at runDemo.py.

molearn's People

Contributors

jmread avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

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