Icon

01.02 Logistic Regression exercise

Logistic Regression - exercise

Introduction to Machine Learning Algorithms course - Session 2
Exercise 4
- Train a logistic regression model
- Apply the model to the test set
- Evaluate the model performance with the Scorer node

URL: Logistic Regression https://www.knime.com/knime-introductory-course/chapter6/section2/logistic-regression
URL: Regularization for Logistic Regression: L1, L2, Gauss or Laplace? https://www.knime.com/blog/regularization-for-logistic-regression-l1-l2-gauss-or-laplace
URL: Description of the Ames Iowa Housing Data https://rdrr.io/cran/AmesHousing/man/ames_raw.html
URL: Ames Housing Dataset on kaggle https://www.kaggle.com/prevek18/ames-housing-dataset
URL: Slides (Introduction to ML Algorithms course) https://www.knime.com/form/material-download-registration

01 - Classification Models

01.02 Logistic 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. Logistic Regression Learner

Train a Logistic Regression model to predict the overall condition of a house (high/low) (Logistic Regression Learner node)

  • Select the rank column as the target column

  • Select low as the reference category

  • Leave other settings to their defaults


Step 2. Logistic Regression Predictor

Use the trained model to predict the rank of the houses in the test set (Logistic Regression Predictor node)


Data Preparation


Step 3. Model evaluation

Evaluate the accuracy of the logistic regression model (Scorer node)

  • Select rank as the actual column and Prediction (rank) as the predicted column

  • What is the accuracy of the model?


Read AmesHousing.csv
CSV Reader
Preprocessing

Nodes

Extensions

Links