Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

any example and document(english)? #18

Open
andyyuan78 opened this issue Jul 29, 2015 · 3 comments
Open

any example and document(english)? #18

andyyuan78 opened this issue Jul 29, 2015 · 3 comments

Comments

@andyyuan78
Copy link

thanks

@godai0519
Copy link
Owner

Thank you for your issue.

Sorry that I can't live up to your expectations.
I cannot write them for a while, because I don't have enough time.
If I feel like myself later, I will write. so, this issue will not close.

However, code below might be helpful.

thanks,

@cookiengineer
Copy link

@godai0519 Can you please add an example.csv file to the example?

This example is hard to understand when you don't know how the data (CSV file) looks like.

It would be awesome to just have a simple CSV file with 10 lines in it, doesn't have to be complicated. That would ease up understanding the usage much much more.

@godai0519
Copy link
Owner

Sorry, that example is old.
Please use the following instead.

bn::sampler sampler;
sampler.set_filename("samples.csv");
sampler.load_sample(graph.vertex_list());
sampler.make_cpt(graph);

A example of CSV which has 10 nodes is below:

14816 2 1 1 0 2 2 1 1 1 1
41 2 0 0 0 1 2 1 0 2 1
39139 2 2 2 1 2 2 1 1 1 1
1737 2 0 1 0 1 2 1 1 1 2
14601 2 1 2 0 2 2 2 1 1 1
6260 2 0 1 0 1 2 2 1 1 1
60475 0 0 1 0 2 2 1 1 1 1

The first line of the example indicates that there are 14816 samples with X1=2, X2=1, ..., X10=1, where X1,...,X10 are random variables (node) in graph.

Please feel free to reply if there is anything that you don't understand.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants