Icon

Finding an Optimal Classification based on Cost and Profit

This workflow trains a classification model using the Linear Regression algorithm. The class prediction is evaluated by overall accuracy and profit statistics. To calculate the profit statistics, classification results are weighted by the values in a predefined profit matrix. The values in the profit matrix depend on the final goal of the classification model.

URL: How to Optimize the Classification Threshold https://www.knime.com/blog/from-modeling-to-scoring
URL: Scoring Metrics eBook https://www.knime.com/knimepress/scoring-metrics-evaluating-machine-learning-models

Finding an Optimal Classification based on Cost and Profit


This workflow optimizes the classification threshold based on the cost/profit that has been introduced to each classification result.

Data: German Credit Card Data Set provided by University of California Archive for Machine Learning and Intelligent Systems

Read data

Data Preprocessing

Visualize results in an interactive dashboard

Show:

  • overall accuracy

  • average total profit amount

  • average profit per applicant

  • average profit amount per applicant

  • by threshold values

Preproc
german.data 1 -> "credit-worthy" 2 -> "risky"
File Reader
Logistic Regression Predictor
Profit Views
50 training, 50 validation
Partitioning
Distribution of target class
GroupBy
Profit by threshold
Profit Matrix valuesTP = 0, FN = -1; FP = 0, TN = 0.35Average loan amount = 10000Number of applicants = 1000
Table Creator
Logistic Regression Learner

Nodes

Extensions

Links