Icon

02.01 Linear Regression exercise

<p>02.01 Linear Regression - exercise<br><br>[L4-ML] Machine Learning Algorithms - Specialization</p><p>02 Regression Models<br>- Partition data into train and test set<br>- Train a linear regression model<br>- Apply the trained model to the test set<br>- Handle missing values<br>- Evaluate the mode performance with the Numeric Scorer</p>

URL: Ames Housing Dataset on Kaggle https://www.kaggle.com/prevek18/ames-housing-dataset
URL: Description on the Ames Iowa Housing Data https://rdrr.io/cran/AmesHousing/man/ames_raw.html

02 - Regression Models

02.01 Linear Regression

Learning objective: In this exercise you'll learn how predict the price of a house in Ames (Iowa, USA) given a number of features: size, neighborhood, heating...


Workflow description: This workflow uses a dataset that describes the sale of individual residential properties in Ames, Iowa from 2006 to 2010. One of the columns is the overall condition ranking, with values between 1 and 10.


You'll find the instructions to the exercises in the yellow annotations.

Step 1. Partitioning

Add Partitioning node to CSV Reader output port:

  • Top port should have 70 % of the rows

  • Draw randomly such rows


Step 2. Linear Regression Learner

Add Linear Regression Learner node to top output port of Partitioning node:

  • Select price column to be learned

  • Execute the node. Which column is most correlated to the price (column selection tab)?


Step 3. Regression Predictor

Add Regression Predictor node:

  • Predict test set (remaining 30% rows) by simply connecting the remaining unconnected output ports


Data Preparation


Step 4. Check Missing Values

Remove rows with missing prediction (Missing Value node)


Step 5. Model evaluation

Add Numeric Scorer node to the Regression Predictor output port:

  • Reference Column: the column you learned

  • Predicted Column: the new column created by the predictor node


Linear Regression Learner
Regression Predictor
housing dataset
CSV Reader
Partitioning
Missing Value
Numeric Scorer

Nodes

Extensions

Links