Icon

Exercise1

<p><strong>Chapter 4/Exercise 1</strong></p><p>This workflow is an exercise for model training and model evaluation. Based on the <em>wine.csv</em> dataset, this workflow trains a Decision Tree model to predict the wine class. It performs the following steps:</p><ol><li><p><strong>Data access:</strong> Reading wine.csv from the KBLdata folder (<em>CSV Reader</em> node)</p></li><li><p><strong>Data preprocessing:</strong> Converting the "Class" column from integer to string (<em>Number to String</em> node) and then partitions the data into training set (80%) and test set (20%) (<em>Table Partitioner</em> node).</p></li><li><p><strong>Model training:</strong> Training a Decision Tree (<em>Decision Tree Learner</em> node) to predict the wine class based on the other attributes in the dataset. Then, applying the trained model to the test set (<em>Decision Tree Predictor</em> node).</p></li><li><p><strong>Model evaluation:</strong> Comparing predicted class values to original values to understand how good/bad the model is performing.</p></li></ol>

URL: KNIME Beginner's Luck (Book Homepage) https://www.knime.com/knimepress/beginners-luck

Workflow: Chapter 4/Exercise 1


This workflow is an exercise for model training and model evaluation. Based on the wine.csv dataset, this workflow trains a Decision Tree model to predict the wine class. It performs the following steps:

  1. Data access: Reading wine.csv from the KBLdata folder (CSV Reader node)

  2. Data preprocessing: Converting the "Class" column from integer to string (Number to String node) and then partitions the data into training set (80%) and test set (20%) (Table Partitioner node).

  3. Model training: Training a Decision Tree (Decision Tree Learner node) to predict the wine class based on the other attributes in the dataset. Then, applying the trained model to the test set (Decision Tree Predictor node).

  4. Model evaluation: Comparing predicted class values to original values to understand how good/bad the model is performing.

Reading data

Transforming data

Training model

Applying trained model

Evaluating model

Decision Tree Predictor
Target value: "Class"
Decision Tree Learner
80% vs. 20%
Table Partitioner
wine.csv
CSV Reader
Convert "Class"to String
Number to String
Confusion matrixClass vs. Prediction (Class)
Scorer

Nodes

Extensions

Links