Course Content
Explore the Linear Regression Using Python
Explore the Linear Regression Using Python
Challenge
Task
Let’s indicate the number of nonflavanoid phenols based on the number of flavanoids, total phenols and evaluate our model.
Your plan:
- [Line #24] Split the data 70-30 (70% of the data is for training and 30% is for testing) and insert 1 as a random parameter.
- [Line #25-26] Initialize and fit the model (assign the model to the variable
model2
). - [Line #30-31] Calculate the MAE and assign the result to the variable
MAE
. - [Line #34-35] Calculate the R-squared and assign the result to the variable
r_squared
. - [Line #38] Print the intercept, the MAE and the R-squared in this order and round each value to second digit.
Thanks for your feedback!
Challenge
Task
Let’s indicate the number of nonflavanoid phenols based on the number of flavanoids, total phenols and evaluate our model.
Your plan:
- [Line #24] Split the data 70-30 (70% of the data is for training and 30% is for testing) and insert 1 as a random parameter.
- [Line #25-26] Initialize and fit the model (assign the model to the variable
model2
). - [Line #30-31] Calculate the MAE and assign the result to the variable
MAE
. - [Line #34-35] Calculate the R-squared and assign the result to the variable
r_squared
. - [Line #38] Print the intercept, the MAE and the R-squared in this order and round each value to second digit.
Thanks for your feedback!
Challenge
Task
Let’s indicate the number of nonflavanoid phenols based on the number of flavanoids, total phenols and evaluate our model.
Your plan:
- [Line #24] Split the data 70-30 (70% of the data is for training and 30% is for testing) and insert 1 as a random parameter.
- [Line #25-26] Initialize and fit the model (assign the model to the variable
model2
). - [Line #30-31] Calculate the MAE and assign the result to the variable
MAE
. - [Line #34-35] Calculate the R-squared and assign the result to the variable
r_squared
. - [Line #38] Print the intercept, the MAE and the R-squared in this order and round each value to second digit.
Thanks for your feedback!
Task
Let’s indicate the number of nonflavanoid phenols based on the number of flavanoids, total phenols and evaluate our model.
Your plan:
- [Line #24] Split the data 70-30 (70% of the data is for training and 30% is for testing) and insert 1 as a random parameter.
- [Line #25-26] Initialize and fit the model (assign the model to the variable
model2
). - [Line #30-31] Calculate the MAE and assign the result to the variable
MAE
. - [Line #34-35] Calculate the R-squared and assign the result to the variable
r_squared
. - [Line #38] Print the intercept, the MAE and the R-squared in this order and round each value to second digit.