Skip to content

havanagrawal/ml-from-scratch

Repository files navigation

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:

python3 -m virtualenv biost558
source biost558/bin/activate

Install the requirements and package using:

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

Now the classes can be imported as usual:

from classifiers import FGMClassifier
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:

pip3 install jupyter

Then the Jupyter notebook can be started as usual:

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.

About

Machine Learning Algorithms from Scratch.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages