eriklindernoren/ML-From-Scratch

 eriklindernoren / ML-From-Scratch

eriklindernoren / ML-From-Scratch

Bare bones Python implementations of some of the fundamental Machine Learning models and algorithms.

ML-From-Scratch600060006004600460086008601260126016601660206020602460246028602860326032603660362017-05-132017-05-142017-05-152017-05-162017-05-172017-05-182017-05-192017-05-202017-05-212017-05-222017-05-232017-05-242017-05-252017-05-262017-05-27ML-From-Scratch59988.34650851448199.565737722017-05-13600038.1554674948189.5322667432017-05-14600367.964426475174.4820602792017-05-15600797.7733854553154.4151183262017-05-166010127.582344436139.3649118622017-05-176015157.391303416114.2812344212017-05-186018187.20026239699.23102795612017-05-196023217.00922137674.14735051532017-05-206022246.81818035779.16408600342017-05-216025276.62713933764.11387953892017-05-226028306.43609831749.06367307442017-05-236028336.24505729849.06367307442017-05-246031366.05401627834.01346660982017-05-256034395.86297525818.96326014532017-05-266037425.6719342383.913053680782017-05-27star

 README

Machine Learning From Scratch

About

Python implementations of some of the fundamental Machine Learning models and algorithms from scratch.

The purpose of this project is not to produce as optimized and computationally efficient algorithms as possible but rather to present the inner workings of them in a transparent way. The reason the project uses scikit-learn is to evaluate the implementations on sklearn.datasets.

Feel free to reach out if you can think of ways to expand this project.

Table of Contents

Usage

Installation

$ pip install -r requirements.txt

Classification

$ python supervised_learning/multilayer_perceptron.py

Figure: Classification of the digit dataset using MLP.

Clustering

$ python unsupervised_learning/dbscan.py

Figure: Clustering of the moons dataset using DBSCAN.

Association Analysis

$ python unsupervised_learning/apriori.py 
- Apriori -
Minimum - support: 0.25, confidence: 0.8
Transactions:
    [1, 2, 3, 4]
    [1, 2, 4]
    [1, 2]
    [2, 3, 4]
    [2, 3]
    [3, 4]
    [2, 4]
Frequent Itemsets:
    [1, 2, 3, 4, [1, 2], [1, 4], [2, 3], [2, 4], [3, 4], [1, 2, 4], [2, 3, 4]]
Rules:
    1 -> 2 (support: 0.43, confidence: 1.0)
    4 -> 2 (support: 0.57, confidence: 0.8)
    [1, 4] -> 2 (support: 0.29, confidence: 1.0)

Current Implementations

Supervised Learning

Unsupervised Learning