Icon

KNIME_​assignment_​part1

1. Data Cleaning & Partitioning

The dataset is imported and cleaned by handling missing values and removing non-predictive columns. The cleaned data is then partitioned into training and testing sets for model development and evaluation.

2. Model Training & Prediction

A Random Forest model is trained using the training data and then used to predict customer churn on the unseen test data.

3. Performance Evaluation & Cost Analysis

The model predictions are evaluated using classification performance metrics and an ROC Curve to assess the model’s ability to distinguish between churn and non-churn customers.

Data Cleaning, Random Forest Classification & Model Evaluation

This workflow demonstrates the process of preparing customer churn data, training a Random Forest classification model, and evaluating its performance using classification metrics and an ROC Curve.

Task

The task is to predict customer churn and evaluate the model’s performance and financial impact of classification errors.

accuracy = TP + TN / TP + TN + FP + FN

= 9 + 158 / 9 + 158 + 2 + 31

= 167 / 200

= 0.835

= 83.5%

precision = TP / TP + FP

= 9 / 9 + 2

= 9 / 11

= 0.8182

= 81.82%

recall = TP / TP + FN

= 9 / 9 + 31

= 9 / 40

= 0.225

= 22.5%

F1-score = 2(precision)(recall) / precision + recall

= 2(0.8182)(0.225) / 0.8182 + 0.225

= 0.3529

= 35.29%

Business Cost

FN = $500

FP = $20

we got , FN = 31

31 X $500 = $15,500

we got , FP = 2

2 X $20 = $40

Total Cost = $15,500 + $40

= $15,540

Calculation for total operational cost of classification errors generated on the test partition

TN = 158

FP = 2

FN = 31

TP = 9

total = 200 (test partition)

Imports the customer churn dataset into KNIME.
CSV Reader
Handles missing values to ensure the dataset is suitable for modelling.
Missing Value
Removes unnecessary or non-predictive attributes from the dataset.
Column Filter
Splits the cleaned dataset into training and testing sets.
Table Partitioner
Trains the Random Forest classification model using the training dataset.
Random Forest Learner
Applies the trained model to the test dataset to generate churn predictions and class probabilities.
Random Forest Predictor
Compares the predicted and actual churn classes to generate the confusion matrix and evaluation metrics.
Scorer
Visualizes the trade-off between the True Positive Rate and False Positive Rate at different probability thresholds.
ROC Curve

Nodes

Extensions

Links