Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Challenge | Building and Training Model
Explore the Linear Regression Using Python
course content

Course Content

Explore the Linear Regression Using Python

Explore the Linear Regression Using Python

1. What is the Linear Regression?
2. Correlation
3. Building and Training Model
4. Metrics to Evaluate the Model
5. Multivariate Linear Regression

Challenge

Let’s combine our knowledge!

Task

In this task, you build, train and fit your model and make predictions based on it. This time you will make predictions about total_phenols, based on flavanoids. It means that your target now is total_phenols.

Your plan:

  1. [Line #18] Define the target (in this task it's total_phenols).
  2. [Line #25] Split the data 70-30 (70% of the data is for training and 30% is for testing) and insert 1 as a random parameter.
  3. [Line #26] Initialize linear regression model .
  4. [Line #27] Fit the model using your tain data.
  5. [Line #30] Assign np.array() to the variable new_flavanoids if their number is 1 (don't forget to use function .reshape(-1,1)).
  6. [Line #31] Predict and assign the amount of flavanoids to the variable predicted_value.
  7. [Line #32] Print the predicted amount of flavanoids.

Task

In this task, you build, train and fit your model and make predictions based on it. This time you will make predictions about total_phenols, based on flavanoids. It means that your target now is total_phenols.

Your plan:

  1. [Line #18] Define the target (in this task it's total_phenols).
  2. [Line #25] Split the data 70-30 (70% of the data is for training and 30% is for testing) and insert 1 as a random parameter.
  3. [Line #26] Initialize linear regression model .
  4. [Line #27] Fit the model using your tain data.
  5. [Line #30] Assign np.array() to the variable new_flavanoids if their number is 1 (don't forget to use function .reshape(-1,1)).
  6. [Line #31] Predict and assign the amount of flavanoids to the variable predicted_value.
  7. [Line #32] Print the predicted amount of flavanoids.

Switch to desktop for real-world practiceContinue from where you are using one of the options below

Everything was clear?

Section 3. Chapter 4
toggle bottom row

Challenge

Let’s combine our knowledge!

Task

In this task, you build, train and fit your model and make predictions based on it. This time you will make predictions about total_phenols, based on flavanoids. It means that your target now is total_phenols.

Your plan:

  1. [Line #18] Define the target (in this task it's total_phenols).
  2. [Line #25] Split the data 70-30 (70% of the data is for training and 30% is for testing) and insert 1 as a random parameter.
  3. [Line #26] Initialize linear regression model .
  4. [Line #27] Fit the model using your tain data.
  5. [Line #30] Assign np.array() to the variable new_flavanoids if their number is 1 (don't forget to use function .reshape(-1,1)).
  6. [Line #31] Predict and assign the amount of flavanoids to the variable predicted_value.
  7. [Line #32] Print the predicted amount of flavanoids.

Task

In this task, you build, train and fit your model and make predictions based on it. This time you will make predictions about total_phenols, based on flavanoids. It means that your target now is total_phenols.

Your plan:

  1. [Line #18] Define the target (in this task it's total_phenols).
  2. [Line #25] Split the data 70-30 (70% of the data is for training and 30% is for testing) and insert 1 as a random parameter.
  3. [Line #26] Initialize linear regression model .
  4. [Line #27] Fit the model using your tain data.
  5. [Line #30] Assign np.array() to the variable new_flavanoids if their number is 1 (don't forget to use function .reshape(-1,1)).
  6. [Line #31] Predict and assign the amount of flavanoids to the variable predicted_value.
  7. [Line #32] Print the predicted amount of flavanoids.

Switch to desktop for real-world practiceContinue from where you are using one of the options below

Everything was clear?

Section 3. Chapter 4
toggle bottom row

Challenge

Let’s combine our knowledge!

Task

In this task, you build, train and fit your model and make predictions based on it. This time you will make predictions about total_phenols, based on flavanoids. It means that your target now is total_phenols.

Your plan:

  1. [Line #18] Define the target (in this task it's total_phenols).
  2. [Line #25] Split the data 70-30 (70% of the data is for training and 30% is for testing) and insert 1 as a random parameter.
  3. [Line #26] Initialize linear regression model .
  4. [Line #27] Fit the model using your tain data.
  5. [Line #30] Assign np.array() to the variable new_flavanoids if their number is 1 (don't forget to use function .reshape(-1,1)).
  6. [Line #31] Predict and assign the amount of flavanoids to the variable predicted_value.
  7. [Line #32] Print the predicted amount of flavanoids.

Task

In this task, you build, train and fit your model and make predictions based on it. This time you will make predictions about total_phenols, based on flavanoids. It means that your target now is total_phenols.

Your plan:

  1. [Line #18] Define the target (in this task it's total_phenols).
  2. [Line #25] Split the data 70-30 (70% of the data is for training and 30% is for testing) and insert 1 as a random parameter.
  3. [Line #26] Initialize linear regression model .
  4. [Line #27] Fit the model using your tain data.
  5. [Line #30] Assign np.array() to the variable new_flavanoids if their number is 1 (don't forget to use function .reshape(-1,1)).
  6. [Line #31] Predict and assign the amount of flavanoids to the variable predicted_value.
  7. [Line #32] Print the predicted amount of flavanoids.

Switch to desktop for real-world practiceContinue from where you are using one of the options below

Everything was clear?

Let’s combine our knowledge!

Task

In this task, you build, train and fit your model and make predictions based on it. This time you will make predictions about total_phenols, based on flavanoids. It means that your target now is total_phenols.

Your plan:

  1. [Line #18] Define the target (in this task it's total_phenols).
  2. [Line #25] Split the data 70-30 (70% of the data is for training and 30% is for testing) and insert 1 as a random parameter.
  3. [Line #26] Initialize linear regression model .
  4. [Line #27] Fit the model using your tain data.
  5. [Line #30] Assign np.array() to the variable new_flavanoids if their number is 1 (don't forget to use function .reshape(-1,1)).
  6. [Line #31] Predict and assign the amount of flavanoids to the variable predicted_value.
  7. [Line #32] Print the predicted amount of flavanoids.

Switch to desktop for real-world practiceContinue from where you are using one of the options below
Section 3. Chapter 4
Switch to desktop for real-world practiceContinue from where you are using one of the options below
We're sorry to hear that something went wrong. What happened?
some-alt