Quantcast
Channel: SCN : All Content - SAP BusinessObjects Predictive Analytics
Viewing all articles
Browse latest Browse all 836

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 is attached to this article. Download and unzip the file. You will see a Text file. Rename its .txt extension to .zip and unpack the new file as well. The content of the .zip file is the Custom R Component. These steps are needed as SCN does not allow the attachment of the component's original file type.

 

Then deploy the component as described here. You just need to copy the attached content in a folder described in the article and restart SAP Predictive Analysis.

 

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 836

Trending Articles



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