项目作者: havanagrawal

项目描述 :
Machine Learning Algorithms from Scratch.
高级语言: Python
项目地址: git://github.com/havanagrawal/ml-from-scratch.git
创建时间: 2018-05-30T05:33:32Z
项目社区:https://github.com/havanagrawal/ml-from-scratch

开源协议:MIT License

下载


ML From Scratch - The Fast Gradient Method



Build Status
codecov
Python Version
License: MIT

Introduction

This repository contains a full-fledged, optimized implementation for the fast gradient method, intended as a logical extension to the sklearn library.

This repo is also a submission for DATA558/BIOST558 - Introduction to Machine Learning “Polished Code Release” assignment.

Submission for BIOST558

The main submission for BIOST558 is the FGMClassifier which packages the fast gradient method into a convenient class. The style and naming is inspired from sklearn’s SGDClassifier

How to Run

Create a virtual environment:

  1. python3 -m virtualenv biost558
  2. source biost558/bin/activate

Install the requirements and package using:

  1. pip3 install -r requirements.txt
  2. python3 setup.py install

Now the classes can be imported as usual:

  1. from classifiers import FGMClassifier
  2. from classifiers import FGMBinaryClassifier

The classes are sklearn-compatible, i.e. can be used in conjunction with GridSearchCV, etc.

To run the Jupyter notebooks, you need to first install a local copy of Jupyter and ipykernel in the virtualenv:

  1. pip3 install jupyter

Then the Jupyter notebook can be started as usual:

  1. jupyter notebook

Examples

Examples in the form of notebooks can be found in the examples/notebooks directory.

Implementation Note

In all of the algorithms in this repository, unless explicitly stated otherwise, the convention for binary classification labels is -1/+1, as opposed to 0/1.