Giter Site home page Giter Site logo

rishabhkothaari / machine-learning-algorithms Goto Github PK

View Code? Open in Web Editor NEW
5.0 2.0 0.0 1.68 MB

This repository contains implementation of Neural Network,k-Means and Gaussian Mixture Models with Python

License: MIT License

Python 100.00%
k-means python clustering gaussian-mixture-models algorithm gaussian-distribution em-algorithm

machine-learning-algorithms's Introduction

Machine-Learning-Models

This repository contains implementation of basic ML algorithms Models in Python without use of any frameworks.

Algorithms

Supervised learning using a Neural Network to predict a function that classisfies MNIST digits.

Neural network structure: The neural network takes in (28x28) 784 inputs, one hidden layer with n hidden units (where n is a parameter that can be changed), and 10 output units(0-9). The hidden and output units uses sigmoid activation function. The network is fully connected —that is, every input unit connects to every hidden unit, and every hidden unit connects to every output unit. Every hidden and output unit also has a weighted connection from a bias unit, whose value is set to 1.

Parameters of the network:

Number of neurons in the hidden layer - n = 100

Number of epochs - epochs = 50

Learining rate - eta = 0.1

Momentum - alpha = 0.9

Accuracy vs Parameters
η α n Training Accuracy Test Accuracy
0.1 0.9 20 96% 93%
0.1 0.9 50 98% 96.8%
0.1 0.9 100 99.6% 96.85%
0.1 0 100 99.6% 97.7%
0.1 0.25 100 99.6% 97.7%
0.1 0.5 100 99.6% 97.6%

Unsupervised learning with k-Means clustering using EM algorithm

Parameters

k - number of clusters

Input is 1500 data points(2d) taken from random Gaussian distribution. Although it can accept any 2d data as input. Plots and log-likelihood for different values of k can be found here

Clusters

k = 2 k=2 k = 3 k=3 k = 4 k=4 k = 5 k=5 3.

Unsupervised learning with GMM using EM algorithm

Parameters

k - number of clusters

Input is 1500 data points(2d) taken from random Gaussian distribution. Although it can accept any 2d data as input. Plots and log-likelihood for different values of k can be found here. It makes use of k-Means Clustering to get k clusters and then run Gaussian model and predicts a Gaussian around the data.

Gaussians

k = 2 k=2 k = 3 k=3 k = 4 k=2 k = 5 k=2

Dependencies

  1. Python
  2. Matplotlib

machine-learning-algorithms's People

Contributors

rishabhkothaari avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.