Git Product home page Git Product logo

regression's Introduction

Regression

Regression is used to find a model for continuous variables. The model can be used to handle prediction, controling and causal link task. Before doing regression, we need to determine which regression function is good for the sample data e.g. linear, polynomial or parabolic.

Develop tools and techniques

  • Python
  • Pycharm

Regression closed form

  • Variable transformation: use linear regression to solve non-linear model
  • Find regression parameter

Practice

Gradient descent to solve linear regression

In ML Lecture 1, I follow the tutorial and practice to use gradient descent to solve linear regression.

  • Without using the linear regression closed form
  • If using the pure gradient descent, it will take too much time to find the optimal parameter. Therefore, we need to give different learning rates to b and w, and update them in each iteration. The cool method is called Adagrad.
  • Adagrad: I remeber my professor tell us that it can normalize the gradient at each iteration by gradient sd
Pure gradient descent Gradient descent with Adagrad

Regression closed form for multiple dimensional vector

We have m data tuples which contain vector x and scalar y,

x is a n-dimensional vector,

Now, Assume y has linear relationship with x,

For simplifying the notation, we combine α and all β into a vector β, all y into vector y. We create a maxtrix X whose row vector ia vector x and added 1 at first column.

We assume the linear regression model is

To minimize error, the loss function is

Xβ can be viewd as a hyperspace in Rm spanned by the n+1 columns of X. X is fixed and β is variable. We want to find the best β so that the error will be minimized. Now, we imagine that if all errors are 0, is the projection of y onto the hyperplane spanned by X


Obviously, y- is orthogonal to the columns of X, we can utilize this property to get the best β instead of solving directly the loss function by partial differential,



Practice

I use as my linear regression model and solve β. It will get a plane in the space of R2.

Reference

regression's People

Contributors

chienkanglu avatar

Watchers

James Cloos 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.