Quantcast
Channel: SCN : All Content - All Communities
Viewing all articles
Browse latest Browse all 3523

Custom R Component - Confusion Matrix

$
0
0

This component extends the capabilities of SAP Predictive Analysis and adds an stand-alone confusion matrix. Such a chart can be helpful to understand the strength of a classification model.

 

Out-of-the box SAP Predictive Analysis already displays a confusion matrix for the data the model was trained on. However, to understand the quality of a model, it is also important to verify the model against data that was not used to create the model in the first place. You can use this Custom R Component for that purpose. You can also use it to visualise the predictions of other classification methods you might have added yourself to the SAP Predictive Analysis framework.

 

Confusion04_Multi.JPG

Disclaimer

Please note that this component is provided as-is without any guarantee or support.

 

 

Prerequisites

The dataset must include the actual and predicted classification.

The R-libraries caret, lattice and ggplot2 have to be installed.

 

Usage

 

These parameters can be set by the user.

ParameterDescription
ActualsName of categorical column that holds the actual classification.
PredictionsName of categorical column that holds the predicted classification.

 

Output Columns: Unchanged input data.

 

How to Implement

The component can be downloaded as .spar file from GitHub. Then deploy it as described here. You just need to import it through the option "Import/Model Component", which you will find by clicking on the plus-sign at the bottom of the list of the available algorithms.

 

 

Example

In this analysis the Confusion Matrix is used to display how accurately a trained decision tree predicts the classification on some test data, for which the actual classification is already known.

 

Confusion01.JPG

 

The Confusion Matrix is configured as follows:

Confusion02_Config.JPG

 

And the confusion matrix itself:

Confusion03_Matrix.jpg

 

Disclaimer

Please note that this component is provided as-is without any guarantee or support.


Viewing all articles
Browse latest Browse all 3523

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>