Solved
Contributor
Posts: 47

# How to set a class as a Positive class

Hi,

I am performing analysis of SVM, Decision Trees, Neural Network and Random Forest in EM and getting True Positve Rate, False Positive Rate etc for each of these 4 algos, I have a binary target variable called category with 1 for allergic and 0 for non allergic.

I know roughly that if i get TPR then it means allergic and FPR means false alarm of non allergic treated as allergic. (Dont know whether I am right or wrong)

could anyone tell me how can i declare allergic =1 as my positive class so that I can say for sure that this definitly means allergic.

And where should I declare this?

Regards

Accepted Solutions
Solution
‎05-23-2017 11:04 PM
SAS Super FREQ
Posts: 306

## Re: How to set a class as a Positive class

In the Enterprise Miner Reference Help, Model Comparison node chapter, the section Comparing Models with Binary Targets gives a nice chart showing what exactly these rates represent (shown below, but not formatted well).  It mentions that typically the value 1 is treated as the target event, and 0 as the non-event.  This is controlled by the Order that is set for the target variable in the Input Data node or a Metadata node. For a binary target, the order by default is Descending, which means the first value when sorting the target levels in descending order is used as the event (hence 1 if values are 0 and 1).  Hope that helps...

### Binary targets are targets whose states can be classified as event and non-event. Typically, event is associated with a value of 1 for the target variable, and non-event is associated with a value of 0 for the target variable. The following table describes the predictive relationships between event and non-event.

Predicted Non-Event

Predicted Event

Total Actual Probability

Non-Event

A (true negative)

B (false positive)

(A + B) / (A + B + C + D )

Event

C (false negative)

D (true positive)

(C + D) / (A + B + C + D )

Total Predicted

A + C

B + D

A + B + C + D

The following classification measures are derived from the relationships in the table:

• Classification (Accuracy) Rate: 100 * (A + D) / (A + B + C + D)
• Misclassification Rate: 100 * (1 - ((A + D) / (A + B + C + D)))
• Sensitivity (True Positive Rate): 100 * D / (C + D)
• Specificity (True Negative Rate): 100 * A / (A + B)
• 1 – Specificity (False Positive Rate): 100 * B / (A + B)

All Replies
Solution
‎05-23-2017 11:04 PM
SAS Super FREQ
Posts: 306

## Re: How to set a class as a Positive class

In the Enterprise Miner Reference Help, Model Comparison node chapter, the section Comparing Models with Binary Targets gives a nice chart showing what exactly these rates represent (shown below, but not formatted well).  It mentions that typically the value 1 is treated as the target event, and 0 as the non-event.  This is controlled by the Order that is set for the target variable in the Input Data node or a Metadata node. For a binary target, the order by default is Descending, which means the first value when sorting the target levels in descending order is used as the event (hence 1 if values are 0 and 1).  Hope that helps...

### Binary targets are targets whose states can be classified as event and non-event. Typically, event is associated with a value of 1 for the target variable, and non-event is associated with a value of 0 for the target variable. The following table describes the predictive relationships between event and non-event.

Predicted Non-Event

Predicted Event

Total Actual Probability

Non-Event

A (true negative)

B (false positive)

(A + B) / (A + B + C + D )

Event

C (false negative)

D (true positive)

(C + D) / (A + B + C + D )

Total Predicted

A + C

B + D

A + B + C + D

The following classification measures are derived from the relationships in the table:

• Classification (Accuracy) Rate: 100 * (A + D) / (A + B + C + D)
• Misclassification Rate: 100 * (1 - ((A + D) / (A + B + C + D)))
• Sensitivity (True Positive Rate): 100 * D / (C + D)
• Specificity (True Negative Rate): 100 * A / (A + B)
• 1 – Specificity (False Positive Rate): 100 * B / (A + B)
Contributor
Posts: 47

## Re: How to set a class as a Positive class

Hi,

Cleared my concept further.

Regards

☑ This topic is solved.