Giter Site home page Giter Site logo

mklearn's Introduction

Mykit-Learn

My implementation of scikit-learn, mykit-learn. Mklearn is my implementation of Linear Support Vector Machine model. It is implemented similarly to scikit-learn using classes and fit functions, etc.

Usage

Make sure Python has the correct path to the modules, and simply import as follows:

import mklearn
import multiclass

mklearn.myLinearSVC(...)
multiclass.Multiclass(...)

Implementation

Linear Support Vector Classifier

mklearn.py contains the implementation of linear support vector classifier. The instance of class myLinearSVC can fit a single binary classifier model using linear SVC. The class is structured in a similar way to scikit-learn's convention, where the class is declared with hyperparameters and .fit() method is called to train the model.

Multiclass Classification

Multiclass classification is supported by multiclass.py file. It contains Multiclass object and several prediction functions that wrap around myLinearSVC. Multiclass can perform both one-vs-one and one-vs-rest multiclass classification through the argument multiclass.

The module also supports model specific cross-validation while running multiclass classification. Simply pass in a list of regularization penalties as Cs and set k to the number of desired folds for cross-validation.

Finally, Multiclass class supports limited multiprocessing to speed up training. Currently, it is only available for the prediction portion only. You can pass in number of threads into n_threads argument. The multiprocessing capabilities for training portion is in development.

Dependencies

The following dependencies are needed to install and run mklearn.

numpy, pandas, matplotlib, scipy, sklearn

Currently mkleran is only supported in Python 3.

Tutorial

There are 3 tutorials to showcase how to use mklearn.

  • mklearn_tutorial_real_dataset.ipynb: contains mklearn multiclass example on real-world dataset.

  • mklearn_tutorial_simulated_dataset.ipynb: contains mklearn multiclass example on simulated dataset using sklearn.

  • tutorial_sklearn_comparison.ipynb: contains performance comparisons with similar implementations from sklearn.

Take a look at the mentioned notebooks for details.

Support/Contact

Author: Ryan Bae

Initial Commit Date: 6/02/2018

This is my official code release for DATA 558 Spring 2018 at University of Washington's MS Data Science program.

mklearn's People

Contributors

ryanbae89 avatar

Stargazers

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