Giter Club home page Giter Club logo

homegrown-machine-learning's Introduction

Implementations of Various Machine Learning Algorithms

Perceptron

A Single-Layered Perceptron Written for the MNIST Dataset

preprocessing.py must be run before perceptron.py. It will break the MNIST files out of csv format, gets them into the format needed by the perceptron, and dumps them to .json objects. This is done to amortize preprocessing time over several tests.

MLP

A Two-Layered Neural Network Using Feed-Forward and Backpropagation Written for the MNIST Dataset.

The mlp expects the .json objects produced by perceptron/preprocessing in its local directory.

Currently backpropagation is hard-coded to expect only two layers (one hidden layer + output layer). All the other components are configured for arbitrary layers, however. Eventually backprop will be updated to manage an arbitrary number of hidden layers.

SVM

Measuring Sklearn's SVM with Different Versions of Spambase Dataset

processing.py scales the spambase data to standard mean, unit variance, shuffles it, and generates a ROC curve. It then measures accuracy as a function of number of features; first, on the most heavily weighted features, then on randomly-selected features.

Naive Bayes

A probablistic classifier for the Spambase Dataset

Naive Bayes makes the assumption that the probabilities of all features occuring given a class are independent. This implementation will intermittently fail to provide good classifications. This happens when the exmaples are shuffled such that one or more features in every example are zero for a given class in the training set, but not the test set. This could be obviated by making the shuffle more deterministic, or by implementing Lapalace Smoothing.

K-Means Clustering

An unsupervised clustering algorithm for classifying handwritten digits

This K-means clusterer will take the best out of five tries given randomly-initialized cluster centers. It works by computing the distances between all possible example-centroid pairs given the training set, and then resetting the cluster centroid to the mean of its cluster. It does this in a loop until accuracy stops changing. Higher accuracies (in the 90% range) are seen for the second iteration where K=30.

Q Learning

A reinforcement learning algorithm that uses a Q-Matrix to navigate a grid and pick up cans

This "robot" uses the q-learning algorithm, which seeks to maximize the amount of reward obtained by a series of decisions. In this case, the robot must navigate a 10x10 grid (the outermost cells of which are walls) and try to pick up all the cans without bumping into walls. The algorithm is rewarded for picking up cans, and penalized to various degrees for hitting walls or attempting a pick up when no can in present. The qlearn.py file runs through several experiments over the algorithm's hyperparameters. The learn2.hs file is my first attempt to code the scenario in Haskell. I completed a better Haskell implementation later, and put it in its own repository here.

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.