The HPBNET Procedure
Example 4.1 Naive Bayesian Network
This example shows how you can use PROC HPBNET to learn a naive Bayesian network for the Iris data available in the Sashelp library. The following statements specify MAXPARENTS=1, PRESCREENING=0, and VARSELECT=0 to request that PROC HPBNET use only one parent for each node and use all the input variables.
proc hpbnet data=sashelp.Iris numbin=3 structure=Naive maxparents=1
prescreening=0 varselect=0;
target Species;
input PetalWidth PetalLength SepalLength SepalWidth/level=INT;
output network=network;
run;
The following statements produce Figure 4, which shows the network structure. In the structure, Species is the parent of PetalWidth, PetalLength, SepalLength, and SepalWidth.
proc print data=network noobs label;
var _parentnode_ _childnode_;
where _type_="STRUCTURE";
run;
Figure 4: Naive Bayesian Network Structure
| Parent Node | Child Node |
|---|---|
| Species | PetalLength |
| Species | PetalWidth |
| Species | SepalLength |
| Species | SepalWidth |
Last updated: May 25, 2022