Create a DSL_dataset dataset with strings

The engine.
Post Reply
oscarpc
Posts: 33
Joined: Mon Jun 04, 2012 1:17 am

Create a DSL_dataset dataset with strings

Post by oscarpc »

Hello all,

I am creating a dataset from the scratch. So far, I am familiar with the functions AddIntVar/SetInt and AddFloatVar/SetFloat, but in addition, I would like to add some fields that are strings.
Do you know how I could do this?

In addition, how the BN is going to interpret a string field? Maybe my mind is set up in a way that I can understand only what happens with numeric values so I have problems to visualize what is going on with string fields.

Thank you very much in advance.
Kind regards,

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

Re: Create a DSL_dataset dataset with strings

Post by shooltz[BayesFusion] »

oscarpc wrote:I am creating a dataset from the scratch. So far, I am familiar with the functions AddIntVar/SetInt and AddFloatVar/SetFloat, but in addition, I would like to add some fields that are strings.
Add an integer variable, then use DSL_dataset::SetStateNames to provide the strings. The element at the index J in the string vector passed to SetStateNames is used as text representation of integer J in the dataset. In other words, if the integers in your column are within 5..42 range, you'll need to use vector with size 43; entries 0..4 will be ignored.
In addition, how the BN is going to interpret a string field?
I'm not sure I understand the question. BN does not interpret the dataset contents in any way. Did you mean EM?
Post Reply