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 and accessible way.
Figure: Classification of the digit dataset by a neural network which has
been evolutionary evolved.
Genetic Algorithm
$ python mlfromscratch/examples/genetic_algorithm.py
+--------+
| GA |
+--------+
Description: Implementation of a Genetic Algorithm which aims to produce
the user specified target string. This implementation calculates each
candidate's fitness based on the alphabetical distance between the candidate
and the target. A candidate is selected as a parent with probabilities proportional
to the candidate's fitness. Reproduction is implemented as a single-point
crossover between pairs of parents. Mutation is done by randomly assigning
new characters with uniform probability.
Parameters
----------
Target String: 'Genetic Algorithm'
Population Size: 100
Mutation Rate: 0.05
[0 Closest Candidate: 'CJqlJguPlqzvpoJmb', Fitness: 0.00]
[1 Closest Candidate: 'MCxZxdr nlfiwwGEk', Fitness: 0.01]
[2 Closest Candidate: 'MCxZxdm nlfiwwGcx', Fitness: 0.01]
[3 Closest Candidate: 'SmdsAklMHn kBIwKn', Fitness: 0.01]
[4 Closest Candidate: ' lotneaJOasWfu Z', Fitness: 0.01]
...
[292 Closest Candidate: 'GeneticaAlgorithm', Fitness: 1.00]
[293 Closest Candidate: 'GeneticaAlgorithm', Fitness: 1.00]
[294 Answer: 'Genetic Algorithm']
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 and accessible way.
Table of Contents
Installation
Examples
Polynomial Regression
Figure: Training progress of a regularized polynomial regression model fitting
temperature data measured in Linköping, Sweden 2016.
Classification With CNN
Figure: Classification of the digit dataset using CNN.
Density-Based Clustering
Figure: Clustering of the moons dataset using DBSCAN.
Generating Handwritten Digits
Figure: Training progress of a Generative Adversarial Network generating
handwritten digits.
Deep Reinforcement Learning
Figure: Deep Q-Network solution to the CartPole-v1 environment in OpenAI gym.
Image Reconstruction With RBM
Figure: Shows how the network gets better during training at reconstructing
the digit 2 in the MNIST dataset.
Evolutionary Evolved Neural Network
Figure: Classification of the digit dataset by a neural network which has
been evolutionary evolved.
Genetic Algorithm
Association Analysis
Implementations
Supervised Learning
Unsupervised Learning
Reinforcement Learning
Deep Learning
Contact
If there’s some implementation you would like to see here or if you’re just feeling social, feel free to email me or connect with me on LinkedIn.