https://github.com/takp/linear-regression-sample
Sample program to model the data using linear regression
https://github.com/takp/linear-regression-sample
linear-regression python
Last synced: 3 months ago
JSON representation
Sample program to model the data using linear regression
- Host: GitHub
- URL: https://github.com/takp/linear-regression-sample
- Owner: takp
- Created: 2014-11-23T10:49:26.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2014-11-23T12:02:17.000Z (over 10 years ago)
- Last Synced: 2024-12-27T09:27:59.494Z (5 months ago)
- Topics: linear-regression, python
- Language: Python
- Size: 191 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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.

Then, the function can be expressed as below.

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

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

Phi is the matrix as following.

### Graph

### Numpy
- numpy.linalg.solve : Sove a linear matrix equation.
ref. http://docs.scipy.org/doc/numpy/reference/generated/numpy.linalg.solve.html
- numpy.dot : Scalar product, Inner product
ref. http://docs.scipy.org/doc/numpy/reference/generated/numpy.dot.html### Reference
(Japanese) http://gihyo.jp/dev/serial/01/machine-learning/0011?page=1