Skip to content
We have put together some examples of different well known machine learning algorithms. This is to make it easier to understand how it looks like when working with machine learning in code. Happy hacking!
Python
Branch: master
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
README.md
data_banknote_authentication.csv
decision_tree_classification.py
ex1data1.txt
insurance.csv
kmeans.py
mnist.pkl.gz
neural_network.py
sgd_linear_regression_multivariable.py
sgd_linear_regression_simple.py
simple_linear_regression.py
winequality-white.csv

README.md

CodeExamples

We have put together some examples of different well known machine learning algorithms. This is to make it easier to understand how it looks like when working with machine learning in code.

The code is written as easy-to-understand and to play with, rather than for efficiency.

Happy hacking!

Neural Network

Play around with this code if you want to understand how to build neural networks only using numpy. This is great to get a better understanding of how it works when training a neural network.

In this code we are using the MNIST Dataset, which is a dataset containing image data of images of handwritten digits. Each sample with a corresponding label.

Kmeans

Use Kmeans clustering in its most common form, with seeding or with seeding and/or constraint.

In this code we are using the dataset IRIS, which is easy to play around with for this task.

Decision Tree Classification

You can use Decision tree for classification, it is using the Gini index for split.

In this code we are using the Bank Dataset, which can easily be replaced in the code.

Linear Regression

Here we are providing three different versions of Linear regression:

  1. Simple Linear Regression

  2. Simple Linear Regression using SGD

  3. Multi-variable Linear Regression using SGD

Here we are using the Insurance Dataset for 1., Wine Dataset for 2. and ex1data1 Dataset for 3.

You can’t perform that action at this time.