im using the
Code: Select all
ReadFile(fileName)
// parser detects int variables as discrete
// set to continous if there are too much states
string id;
// iterate over all variables
for(int i=0; i< m_trainData.GetNumberOfVariables(); ++i)
{
int numberOfStates = m_trainData.GetVariableInfo(i).stateNames.size();
if(m_trainData.IsDiscrete(i) && numberOfStates == 0)
{
// add new float variable
if(m_trainData.AddFloatVar( "tmp") != DSL_OKAY)
return 1;
// copy content into float variable
for(int j=0; j<m_trainData.GetNumberOfRecords(); ++j)
m_trainData.SetFloat( m_trainData.FindVariable("tmp"), j, (double) m_trainData.GetInt(i,j) );
// delete old int variable
id = m_trainData.GetId(i);
if( m_trainData.RemoveVar(i) != DSL_OKAY )
return 1;
// set id
if(m_trainData.SetId(m_trainData.FindVariable("tmp"), id) != DSL_OKAY)
return 1;
}
}
So how you can see, my current criterio to detect variables who are discrete, but have to be continous is that they donÄt have any statenames..But is this really correct? Or it's just a fluke? I read the Documentation about the dsl_dataset type, but it seems to be out of date...
Thanks in advance,
nordic