Git Product home page Git Product logo

hello-pca-mlp's Introduction

Hello PCA & MLP

Messing around with Databases Dimensionality Reduction and classification using Multi Layers Perceptron.

(simple academic research)

set up and run


git clone https://github.com/myreli/hello-pca-mlp.git

cd hello-pca-mlp

conda create -n pcamlp

conda activate pcamlp

conda install python=3.6.5

pip install -r requirements.txt

python script.py

requirements

Python > 3.6.x

Anaconda

about this sample

  • Using mnist dataset tutorial from tensorflow library

the MNIST database is a large database of handwritten digits, commonly used for ML.

  • Using matplotlib for graphic plotation

to graphically understand the MNIST dataset

  • Using PCA from sklearn.decomposition

to try it out dimensionality reduction

  • Using Multi Layer Perceptron from mlxtend.classifier

to understand dimensionality reduction, each reducted db has been exposed agains 3 MLPs, A (10 hidden layers and 0.005 learning curve), B (30 hidden layers and 0.05 learning curve) and C (60 hidden layers and 0.5 learning curve).

output

reading MNIST dataset from tensorflow sample...
Extracting MNIST_data/train-images-idx3-ubyte.gz
Extracting MNIST_data/train-labels-idx1-ubyte.gz
Extracting MNIST_data/t10k-images-idx3-ubyte.gz
Extracting MNIST_data/t10k-labels-idx1-ubyte.gz

ploting random MNIST sample to prove that dataset loaded properly and understand data...

Random MNIST Sample

applying PCA 1 to dataset...

Random MNIST Sample

applying PCA 2 to dataset...

Random MNIST Sample

apply MLPs and display accuracy to each...

------------------------------------------------

---
[RES] Full: 

[RES] MLP 1: 93.10%
[RES] MLP 2: 87.84%
[RES] MLP 3: 10.09%

---
[RES] PCA 1: 

[RES] MLP 1: 93.25%
[RES] MLP 2: 99.68%
[RES] MLP 3: 92.83%

---
[RES] PCA 2: 

[RES] MLP 1: 93.01%
[RES] MLP 2: 19.13%
[RES] MLP 3: 9.82%

------------------------------------------------

Execution time:  81.14863263649603

hello-pca-mlp's People

Contributors

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