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
Create a DSL_dataset dataset with strings
-
- Site Admin
- Posts: 1417
- Joined: Mon Nov 26, 2007 5:51 pm
Re: Create a DSL_dataset dataset with 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.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.
I'm not sure I understand the question. BN does not interpret the dataset contents in any way. Did you mean EM?In addition, how the BN is going to interpret a string field?