BookmarkSubscribeRSS Feed
WWD
Obsidian | Level 7 WWD
Obsidian | Level 7

This is a follow-up to a previously posted question.  I needed to add some additional information to help the reader locate the area/topic that I have a question about.

 

Module: AI&ML Professional
Class/Title: Machine Learning Specialist
Lesson: Lesson 4 Neural Networks
Section: Build a Neural Network using Default Settings
Video, Demo or Practice Title: At the 1 minute and 50 second mark of the video.

 

subject: The neural network is being used to approximate the logit function.

 

In the Output Table, there exists a row titled "output nodes". For this example, SAS is reporting two (2) output nodes. When you look at the neural-network diagram within the results, there is a single output node.

 

Will someone help me and explain to me what the two outputs represent and where those nodes appear in the diagram, please?

 

Thank you,

 

Bill Donaldson

 

1 REPLY 1
AriZitin
SAS Employee

Hi!

 

This is a great question and I can see how the discrepancy could be confusing! Conceptually the answer is simple (see the Short Answer), but the reason you see the discrepancy is a bit more complicated, and relates to how Model Studio works (code is executed behind the scenes); this is explained in the Long Answer.

 

Short Answer: The neural network is fit with a binary target, so it really only outputs one probability (the probability of customer churn being equal to 1, P_churn1), but since we have a binary target there is an implied probability of customer churn being equal to 0 (P_churn0) which of course is just equal to 1-P_churn1. The neural network diagram only shows 1 output node (when I ran it had a node named “churn=0’ so it is outputting P_churn0), but there is a second implicit output node (churn=1 to output P_churn1), but this is unnecessary since P_churn1 = 1 – P_churn0.

 

Long Answer: In Model Studio you have the option to select either a ‘Binary’ target level or a ‘Nominal’ target level. A binary target is an example of a nominal target, but not all nominal targets are binary. Since we have selected ‘Churn Flag’ as our target and set the level to ‘Binary’ the Model Studio graphical interface knows that we only have two levels to our target, and the probability of target = 0 (or 1) is just 1 minus the probability of target = 1 (or 0). Behind the scenes in Model Studio the software is generating and submitting SAS Code. In this case for the Neural Network Node it uses the procedure PROC NNET, which doesn’t have the option to specify a Binary target, it only has the option to specify a Nominal target (you can see this in the training code box in the Neural Network Node results if you scroll to the bottom where PROC NNET is listed). The Output Table in the SAS output is generated by the PROC NNET procedure, so it treats the target as nominal with two levels. PROC NNET creates an output node for each target event level when the target is nominal, thus PROC NNET creates 2 output nodes for a binary target. Although there are two output nodes in the neural network, Model Studio only plots 1 in the Network Diagram since it knows the target is binary (it even does this if the target level is set to nominal and you only have 2 levels since it determined how many target levels you have), and the second output node is just 1 minus the first output node. Basically in the actual neural network that is fit we have 2 output nodes (one for P_churn1 and one for P_churn0) but since P_churn1 = 1 – P_churn0 the Network Diagram only shows 1 of the output nodes (the other is redundant).

 

-Ari Zitin