Giter Club home page Giter Club logo

machine-learning-algorithms's Introduction

Machine Learning Algorithms

My personal machine learning projects without using machine learning libraries for educational purposes

IMDB Review sentiment analysis

  • Implemented Naive Bayes Classification by first cleaning the data of common english stop words and then creating a bag of words matrix.
  • In training phase, computed partial probability of each word and stored it into a matrix
  • In the testing phase, fetched the probability of each testing word, applied laplace smoothing and generated the output as either positive review or negative review.
  • Accuracy of 71% [not so impressive :)]

MNIST Image Classifier Using Logistic Regression

  • First flattened the input 60000 x 28 x 28 matrix into 60000 x 784 matrix
  • Initialized W matrix as 60000 x 10 as there are 60K input rows and 10 class labels
  • Used softmax function to compute posterior probability of image based on class label and input 1 x 784 matrix
  • Based on the posterior probability, calculated the gradient dw as X[l]*(Y-P(Y|X,W). For this step, we create a sparse matrix of Y to be of same shape as P(Y|X) which is the posterior probability.
  • For gradient ascent, multiplied this dw with tolerance (also called learning rate) and added to the previous value of w.
  • Accuracy of 91%

MNIST Image Classifier using K-Nearest Neighbor

  • First flattened the input 60000 x 28 x 28 matrix in a 60000 x 784 matrix
  • In the next step, I calculated the L2 distance (Euclidean distance) between one test sample and all training sample and store the distance in a matrix
  • Created a list of several K [1,10,100] and classified the test sample based on the closest training samples and plotted a graph between K and accuracy. Accuracy ranged between 94-96% which is pretty impressive!

machine-learning-algorithms's People

Contributors

varun1309 avatar

Watchers

 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.