04 Simple linear regression actual combat

table of Contents

​​​​​​​​Scene Description

1. Import data

2. Data is divided into training set and test set

3. Train the model

4. Verify and test the model

Loss function explanation​



Scene description

According to the correspondence table of working years and wages, find out the relationship between the two, and predict how much wages will be when the working years are "unknown"?

1. Import data




We created a CSV reader, But something went wrong?


we  open SalaryData.csv file,we find the row 9 and row 10 has the same YearsExperience data 

we open knime,CSV Reader think YearsExperience is unique, Because it requires a unique ID ,so let's turn off it

We can research the data in two waysFirst kind Chart mode
1.First kind
Chart mode


2.The second 
scatter diagram(use scatter Plot)



2. Data is divided into training set and test set


  

3. Train the model



coeff: polynomial
intercept: intercept



4. Verify and test the model



Loss function explanation

Guess you like

Origin blog.csdn.net/weixin_43135178/article/details/114934907