Scorer (JavaScript) Node

Since there is no universal measure to evaluate model performance, we recommend taking a look at different statistics. When you do, you can answer questions such as these:

  • What is the number of correct and incorrect predictions?
  • Are occurrences predicted better in one class than the other?
  • Does an unbalanced target class distribution influence the overall accuracy?

You can find the statistics in the interactive output view of the Scorer (JavaScript) node.

Exercise:

Read the predicted_income.csv dataset.

The “income” column contains people’s actual income class values. The “Prediction (income)” column contains their predicted income class values produced by some classification model based on the other information available in the dataset. The income class has two values: “<=50K” and “>50K”

Evaluate the accuracy of the income class prediction using the Scorer (JavaScript) node.

  • Execute the node, and open the interactive view
  • What is the overall accuracy of the model?

Open the configuration dialog of the Scorer (JavaScript) node.

  • Exclude the following statistics from the class prediction statistics table:
    • True positives
    • False positives
    • True negatives
    • False negatives

Open the interactive view again, and display the number of rows in the confusion matrix.

  • What is the number of rows in the dataset?
Solution

 

Open the configuration dialog of the Scorer (JavaScript) node, and select “income” as the actual column and “Prediction (income)” as the predicted column in the “Scorer Options” tab.

The overall accuracy of the model is 84 %.

Open the configuration dialog, and go to the “Statistics Options” tab. Disable the four first statistics “True positives”, “False positives”, “True negatives” and “False negatives”.

Open the menu in the upper right corner of the interactive view, and select “Display number of rows”. The number of rows in the dataset is 6513.

You can download the solution workflow here*.

* The link will open the workflow directly in KNIME Analytics Platform (requirements: Windows; KNIME Analytics Platform must be installed with the Installer version 3.2.0 or higher)

 

LinkedInTwitterShare