Building the Stream
- Add a Statistics File source node pointing to telco_Jan.sav in the
Demos folder.
Figure 1. Bayesian Network sample stream Previous analysis has shown you that several data fields are of little importance when predicting churn. These fields can be filtered from your data set to increase the speed of processing when you are building and scoring models.
- Add a Filter node to the Source node.
- Exclude all fields except address, age, churn, custcat, ed, employ, gender, marital, reside, retire, and tenure.
- Click OK.
Figure 2. Filtering unnecessary fields - Add a Type node to the Filter node.
- Open the Type node and click the Read Values button to populate the Values column.
- In order that the Evaluation node can assess which value is true and which
is false, set the measurement level for the churn field to Flag, and
set its role to Target. Click OK.
Figure 3. Selecting the target field You can build several different types of Bayesian networks; however, for this example you are going to build a Tree Augmented Naïve Bayes (TAN) model. This creates a large network and ensures that you have included all possible links between data variables, thereby building a robust initial model.
- Attach a Bayesian Network node to the Type node.
- On the Model tab, for Model name, select Custom and enter Jan in the text box.
- For Parameter learning method, select Bayes adjustment for small cell counts.
- Click Run. The model nugget is added to the stream,
and also to the Models palette in the upper-right corner.
Figure 4. Creating a Tree Augmented Naïve Bayes model - Add a Statistics File source node pointing to telco_Feb.sav in the Demos folder.
- Attach this new source node to the Filter node (on the warning dialog,
choose Replace to replace the connection to the previous source node).
Figure 5. Adding the second month's data - On the Model tab of the Bayesian Network node, for Model name, select Custom and enter Jan-Feb in the text box.
- Select Continue training existing model.
- Click Run. The model nugget overwrites the existing one in the stream, but is also added to the Models palette in the upper-right corner.
