GithubHelp home page GithubHelp logo

spatil6 / machine-learning-algorithm-from-scratch Goto Github PK

View Code? Open in Web Editor NEW
2.0 3.0 0.0 282 KB

Machine learning algorithms from scratch

Jupyter Notebook 100.00%
machine-learning numpy neural-network decision-trees linear-regression

machine-learning-algorithm-from-scratch's Introduction

Machine-Learning-algorithm-from-scratch

Linear regression

Linear regression implementation with Numpy

A linear model makes a prediction by simply computing a weighted sum of the input features, plus a constant called the bias term.

Equation y = θ+ X1θ1 + X2θ2 + ...

vectorized form of above equation

alt text

Therefore, to train a Linear Regression model, you need to find the value of θ that minimizes the RMSE. In practice, it is simpler to minimize the Mean Square Error (MSE) than the RMSE, and it leads to the same result (because the value that minimizes a function also minimizes its square root)

The MSE of a Linear Regression hypothesis hθ on a training set X is calculated using below equation .

MSE cost function for a Linear Regression model alt text

The reason for the operations is that the summation of the squared errors gives us a unique and simple global number, the difference between expected and real number gives us the proper distance, and the square power gives us a positive number, which penalizes distances in a more-than-linear fashion.

To find the value of θ that minimizes the cost function, there is a closed-form solution

alt text

For more info : https://github.com/spatil6/Machine-Learning-algorithm-from-scratch/Mathematics_of_machine_learning.docx

machine-learning-algorithm-from-scratch's People

Contributors

spatil6 avatar

Stargazers

 avatar  avatar

Watchers

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