Linear Regression
Article Directory
learning target
- Ownership in the implementation process of linear regression
- Application LinearRegression or SGDRegressor achieve regression prediction
- We know the assessment criteria and formulas regression algorithm
- Overfitting know the causes and solutions underfitting
- We know principle ridge regression and linear regression differences
- Application Ridge achieve regression prediction
- Application joblib achieve saving and loading models
2.1 Introduction to Linear Regression
1 linear regression scenarios
-
Prices forecast
-
Sales Prediction
-
Loan amount forecast
For example:
2 What is the linear regression
2.1 Definitions and formula
Linear Regression (Linear regression) using the regression equation (function) for between the independent variables (characteristic value) and the dependent variable (target value) of one or more relationships for modeling an analytical way.
- Features: with only one independent variable is called a single-variable regression, more than one independent variable is called multiple regression case
- Examples denoted by linear regression matrix
So how to understand it? Let's look at a few examples
- Final grade: 0.7 × test scores + 0.3 × normal results
- House prices from the central area = 0.02 × + 0.04 × city nitric oxide concentration + (-0.12 × average rate from the housing) + 0.254 × urban crime
Two examples above, we see the establishment of a relationship between the characteristic value and the target value, this relationship can be understood as a linear model .
Analysis of the relationship with the target of 2.2 Characteristics linear regression
There are two main linear regression model which, ** one is a linear relationship, the other is a non-linear relationship. ** Here we can only draw a plane to be better understood, the features are for example a single or two sub-features.
-
Linear relationship
- Univariate linear relationship:
-
Multivariate linear relationship
NOTE: Relation between the target characteristics and a linear relationship, or wherein the target value exhibits two planar relationship
The higher dimensions we do not have to think, you can remember this relationship
-
Non-linear relationship
Comment: Why is this relationship? what is the reason?
If the non-linear relationship, the regression equation can be understood as: w 1 x 1 + w 2 x 2 2 + w3x3 2