Coder Social home page Coder Social logo

tsitsimis / from-scratch Goto Github PK

View Code? Open in Web Editor NEW
6.0 2.0 0.0 4.37 MB

Machine Learning implementations from scratch. Using minimal dependencies this collection intends to cover fundamental machine learning algorithms: from linear regression to neural networks

Python 100.00%
from-scratch machine-learning python algorithms-implemented

from-scratch's Introduction

From Scratch

A collection of Machine Learning algorithms implemented in Python from scratch.

Motivation

Transforming an algorithm from math equations to code is a sometimes difficult but always fruitful journey every Data Scientist should take at least once. The goal of this project is to go down to the last detail of each algorithm, fill the gap between math and code, demystify ML models complexity and revisit their mathematical background.

Implementations

Dependencies

  • numpy: Used in all implementations for vector/matrix operations and vectorized calculations
  • cvxopt: Used in SVM for solving the quadratic programming problem
  • scipy: Borrowed its KDTree implementation for fast nearest neighbours calculation

Demos

Each algorithm is accompanied with a notebook with mathematical background, application of the methodology on toy datasets and visualizations.

Supervised Learning

Multi-layer Neural Networks

Fead-forward Neural Network
---------------------------
4 layers: [10, 10, 10, 1]

       Inputs
       \ | /
 o o o o o o o o o o 
       \ | /
 o o o o o o o o o o 
       \ | /
 o o o o o o o o o o 
          | 
          o 
       Outputs

Classification Trees

{'expr': 'feature_2 <= 2.45',
 'no': {'expr': 'feature_3 <= 1.75',
        'no': {'expr': 'feature_2 <= 4.85',
               'no': {'label': 2.0},
               'yes': {'label': 2.0}},
        'yes': {'expr': 'feature_2 <= 4.95',
                'no': {'label': 2.0},
                'yes': {'label': 1.0}}},
 'yes': {'expr': 'feature_0 <= 4.35',
         'no': {'expr': 'feature_0 <= 4.45',
                'no': {'label': 0.0},
                'yes': {'label': 0.0}},
         'yes': {'label': 0.0}}}

Support Vector Machine

Linear Regression

Unsupervised Learning

K-means

DBSCAN

Principal Component Analysis (PCA)

Reinforcement Learning

N-armed Bandits

Dynamic Programming

Q-Learning

SARSA

from-scratch's People

Contributors

theodoretsitsimis avatar tsitsimis avatar

Stargazers

 avatar  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.