Coder Social home page Coder Social logo

mftransformers's Introduction

mftransformers

One of my favorite scikit-learn features is the Pipeline class. Pipelines allow you to quickly combine multiple feature selection, classifiers or estimators into a single unit. Using an example from the scikit-learn documentation, we could set up a simple pipeline that performs an unsupervised dimension reduction using PCA and then performs classification using logistic regression:

pca = decomposition.PCA()
pipe = Pipeline(steps=[('pca', pca), ('logistic', logistic)])

By doing this we've essentially created a compound estimator that we can operate on as a whole (instead of working our data through each estimator individually). Continuing with the example from the scikit-learn documentation, we can use a grid search to set the parameters for number of components and inverse regularization strength and then fit the model:

estimator = GridSearchCV(pipe,
                         dict(pca__n_components=n_components,
                              logistic__C=Cs))
estimator.fit(X_digits, y_digits)

See the (excellent) scikit-learn documentation for more details.

While scikit-learn includes PCA it lacks other matrix factorization methods. The purpose of this package is to implement those methods in a way that is compatible with the scikit-learn pipeline system.

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.