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.
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
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 in the form of notebooks can be found in the examples/notebooks directory.
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.