Icon

04 Decision Tree Model - Solution

04 Decision Tree Model - Exercise (Solution)

This workflow shows a solution to a hands-on exercise in the L2-DW Introduction to KNIME Analytics Platform for Data Wranglers - Advanced course

Annotations and comments
  • Exercise: Train a Decision Tree Model The provided metanode contains a workflow that accesses and preprocesses demographics, geo coordinates, and travel risk information in different countries/territories. Specifically, it creates a binomial column Travel with two values "Travel safely" and "Travel with care" based on the travel risk categories. Your task is to predict this travel risk category via the following steps: 1. Partition the data into a training set (70%) and a test set (30%). Apply stratified sampling on the Travel column. 2. Build a decision tree model to predict the travel risk category (Travel column). Apply the model to the test set. 3. Evaluate the model's performance. Use the Scorer or Scorer (JavaScript) node.
  • Exclude country columns and columns related to the travel risk
  • Two categories "Travel" and "Don't travel"
  • Handle missing values in the Female column
  • Handle missing values in the Male column
  • Read JoinedCountryData.table
  • Predict Travel
  • 70/30 split Stratified sampling on the Travel column
  • Evaluate model accuracy

Nodes

Extensions

Links