Using BN to make predictions for many new cases

The front end.
Post Reply
cstokes
Posts: 4
Joined: Mon Dec 07, 2015 11:06 am

Using BN to make predictions for many new cases

Post by cstokes »

Hi,

I've developed a BN using a data set of 7 beach related variables, in an attempt to model the number of visitors to each beach. I intend to use the BN to predict beach visitor numbers (in a cattegorical sense) at beaches outside the model training data set. Having developed a sensible network of discretised variables that I am happy with, and validating it against the known beach visitor numbers using the "validate" functionality in GeNIe, I would now like to enter new evidence for a number of the variables in the network and see what the predicted beach visitor numbers are for a large database of previously unseen beaches (much like a regression model).

I can use the "Copy Cases" command in the "Data" menu to copy the predictor data from the unseen external dataset and then use the "Case Manager" pane to set the evidence for each new case. What I can't figure out is how to use GeNIe to automatically apply the evidence to predict the final unknown beach visitor variable without having to go through each case, clicking "apply case", updating the network, and then writing down the predicted category of beach visitors. Is there a way to use the BN to automatically predict one target variable using the other variables for many new cases?

Your help with this is greatly appreciated.

Kit.
shooltz[BayesFusion]
Site Admin
Posts: 1417
Joined: Mon Nov 26, 2007 5:51 pm

Re: Using BN to make predictions for many new cases

Post by shooltz[BayesFusion] »

GeNIe does not implement the case-to-dataset copy.
I can use the "Copy Cases" command in the "Data" menu to copy the predictor data from the unseen external dataset and then use the "Case Manager" pane to set the evidence for each new case
Is there a problem with using the "unseen" dataset with GeNIe's Validate command?
cstokes
Posts: 4
Joined: Mon Dec 07, 2015 11:06 am

Re: Using BN to make predictions for many new cases

Post by cstokes »

Hi Shooltz,

Thanks for your reply. I tried using the unseen data with the validate command, but as there is no data for the variable I am interested in predicting, it does not work as a target variable. The validation will complete (but will obviously not show any validation results, as there is no data to validate against) but in the output file the predicted values columns are empty. Any ideas how to get it to work?
shooltz[BayesFusion]
Site Admin
Posts: 1417
Joined: Mon Nov 26, 2007 5:51 pm

Re: Using BN to make predictions for many new cases

Post by shooltz[BayesFusion] »

I'd add a column representing your missing variable containing a fixed value (one of the outcomes). Ignore the accuracy scores at the end of validation and use only the output file with the predicted probabilities.
cstokes
Posts: 4
Joined: Mon Dec 07, 2015 11:06 am

Re: Using BN to make predictions for many new cases

Post by cstokes »

Brilliant, thank you, that seems to work. Can you explain briefly how GeNIe runs it's validation, as I had imagined that validating with a data set that was not used to develop the network would have caused the network to re-learn the parameters in the network?
shooltz[BayesFusion]
Site Admin
Posts: 1417
Joined: Mon Nov 26, 2007 5:51 pm

Re: Using BN to make predictions for many new cases

Post by shooltz[BayesFusion] »

Can you explain briefly how GeNIe runs it's validation
That depend on your choice of "Validation method" parameter. "Test only" does not run parameter learning at all (sets the evidence for each data row, runs inference and compares the prediction with actual value) , while "Leave one out" and "K-fold" perform EM on the subset of data, then test on the remaining part.
cstokes
Posts: 4
Joined: Mon Dec 07, 2015 11:06 am

Re: Using BN to make predictions for many new cases

Post by cstokes »

Brilliant, that's really helped me understand how to use GeNIe for prediction. Thank you for your help.
ÇAKAL
Posts: 2
Joined: Tue Dec 08, 2015 1:37 pm

Re: Using BN to make predictions for many new cases

Post by ÇAKAL »

hello, i have 2 data files , test and training. firtsyly i used training for learining naive bayes. after i want to test my data . how can ı do this?
marek [BayesFusion]
Site Admin
Posts: 430
Joined: Tue Dec 11, 2007 4:24 pm

Re: Using BN to make predictions for many new cases

Post by marek [BayesFusion] »

You should run "Test only" on your test data set. This will be precisely what you want. An alternative that you may want to consider is combining the two files into one and running one of the cross-validation methods (leave-one-out or k-fold cross-validation). This approach uses your data more efficiently. I hope this helps -- Marek
Post Reply