# Constructing a Bayesian network from the beginning

I am trying to construct a bayesian network which detects fraud. I have got a huge data set, with elements such as country, top spend merchant just to name a couple. The first part of my problem is to use a test set of data which is about 11,000 rows in excel and use this to firstly use Bayes formula to see the $P(\text{Fraud}|\text{each variable})$.

After I have done this I have to perform this on the rest of the data and see if it is a good algorithm. This is the first part that I am confused with. How do I do this?

I know $P(\text{Fraud}|X_1)=P(X_1|\text{Fraud})\frac{P(\text{Fraud})}{P(X_1)}$ and I dont understand why I have been told to do this on a test set of data.

• @kjetilbhalvorsen, please don't approve the spam edits w/o proper discussion on meta.CV. It may well be that the tag should be changed. I'm indifferent to that. However, this should be discussed on meta, & the tag would be made a synonym, rather than have a person arbitrarily decide that a tag encoding nearly 100 threads be changed all at once. – gung - Reinstate Monica May 1 '16 at 20:34