Hello
I'm using SMILE.NET wrapper (Academic version). I have problem with structure bayesian network learning using Naive Bayes algorithm (if I'm using Greedy Thick Thinning algorithm it happens too). When I try to learn my network - .NET throws SmileException with error code -1.
I import my dataset to database from CSV file. I attached example of dataset in attachment (it contains variables names in header too but I think it does not matter in this case). Star(*) values are replaced for -1 at runtime and it symbolizes missing value.
Using the opportunity I'd like to draw attention to the fact that Bayesian Search algorithm is missing in .NET wrapper - only NB and Greedy Think Thinning is available. Should it be like that?
I'd be grateful for your quick response. Thanks in advance.
Problem with structure learning
-
- Site Admin
- Posts: 1417
- Joined: Mon Nov 26, 2007 5:51 pm
Re: Problem with structure learning
How did you select the class variable?I have problem with structure bayesian network learning using Naive Bayes algorithm. When I try to learn my network - .NET throws SmileException with error code -1.
SMILE.NET will support Bayesian Search in version 1.3. We plan to release it within 4 to 6 weeks.Using the opportunity I'd like to draw attention to the fact that Bayesian Search algorithm is missing in .NET wrapper - only NB and Greedy Think Thinning is available. Should it be like that?
Re: Problem with structure learning
Could you clarify more your question?shooltz[BayesFusion] wrote: ↑Thu Jan 17, 2019 9:59 pmHow did you select the class variable?I have problem with structure bayesian network learning using Naive Bayes algorithm. When I try to learn my network - .NET throws SmileException with error code -1.
-
- Site Admin
- Posts: 1417
- Joined: Mon Nov 26, 2007 5:51 pm
Re: Problem with structure learning
Naive Bayes algorithm needs to know which variable in your dataset is a class variable. In SMILE.NET you can specify the class variable by setting the NaiveBayes.ClassVariableId property. The class variable identifier should be matched by one of the variables in the dataset passed as a parameter to NaiveBayes.Learn. However, your data file has no header with variable identifiers; you'll need to add this before proceeding.
Also, make sure your dataset has variables with at least two distinct values (missing entries do not count as distinct).
You may want to use Naive Bayes in GeNIe before proceeding with SMILE.NET. Its implementation shares the code included in SMILE.NET. You'll need to add these variable identifiers as a header to your .csv before loading it into GeNIe.
Also, make sure your dataset has variables with at least two distinct values (missing entries do not count as distinct).
You may want to use Naive Bayes in GeNIe before proceeding with SMILE.NET. Its implementation shares the code included in SMILE.NET. You'll need to add these variable identifiers as a header to your .csv before loading it into GeNIe.
Re: Problem with structure learning
I switched to using Greedy Thick Thinning algorithm. I set MaxParents property to 8 and it still throw SmileException with error code -1. I tried my dataset with GeNIe and Greedy Thick Thinning algorithm and it works pretty well. I still don't know why it's not working. Any thoughts?shooltz[BayesFusion] wrote: ↑Fri Jan 18, 2019 1:16 pm Naive Bayes algorithm needs to know which variable in your dataset is a class variable. In SMILE.NET you can specify the class variable by setting the NaiveBayes.ClassVariableId property. The class variable identifier should be matched by one of the variables in the dataset passed as a parameter to NaiveBayes.Learn. However, your data file has no header with variable identifiers; you'll need to add this before proceeding.
Also, make sure your dataset has variables with at least two distinct values (missing entries do not count as distinct).
You may want to use Naive Bayes in GeNIe before proceeding with SMILE.NET. Its implementation shares the code included in SMILE.NET. You'll need to add these variable identifiers as a header to your .csv before loading it into GeNIe.
-
- Site Admin
- Posts: 1417
- Joined: Mon Nov 26, 2007 5:51 pm
Re: Problem with structure learning
Your data file contains columns with missing values, which are not compatible with Greedy Thick Thinning. Unless you've switched to another data file, GeNIe should tell you about the problems with your data.I tried my dataset with GeNIe and Greedy Thick Thinning algorithm and it works pretty well