Skip to content

takp/linear-regression-sample

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Linear Regression

Sample program to model the data using linear regression, and show the graph.

Environment

  • Python 2.7.6
  • Numpy
  • Matplotlib

Run

$ python linear_regression.py

Logic

Use the polynomial basis as the basis function.

Polynomial Basis

Then, the function can be expressed as below.

General function

This time, I define the basis function as 4 dimensional. Thence,

function

Using matrix, these "omega" can be solved by this equation.

omega equation

Phi is the matrix as following.

Phi

Graph

Graph

Numpy

Reference

(Japanese) http://gihyo.jp/dev/serial/01/machine-learning/0011?page=1

About

Sample program to model the data using linear regression

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages