Discretizer & Missing values

The engine.
Post Reply
kile
Posts: 19
Joined: Sat Apr 25, 2009 3:36 pm

Discretizer & Missing values

Post by kile »

Hi all, yes it's me again hehehe :)

I'm trying to read a data file and automatically discretize the parameters that are continuous, I've been reading the tutorial about discretization but it gaves the following code:

Code: Select all

  DSL_discretizer disc(d.GetVariableData(0));
  disc.Discretize(3,DSL_discretizer::MethodType::Hierarch);
But now the method GetVariableData it's not available anymore. Which one should I use if I dont know before reading the kind of data that is coming?

I was thinking in something like the next:

Code: Select all

for (int i=0;i<m_dataSet->GetNumberOfVariables();i++)
{
    if (!m_dataSet->GetVariableInfo(i).discrete)
   {
        DSL_discretizer disc(m_dataSet->GetVariableData(i));
        disc.Discretize(8);
   }
}
I dont know if I get wrong way how it's work.

Another question is regarding how I could include also automatic missing values replacement like in Genie -> Replace using average value. Is there any built functionality to make it? or it should be made by hand?

Thank u very much as usual
shooltz[BayesFusion]
Site Admin
Posts: 1417
Joined: Mon Nov 26, 2007 5:51 pm

Re: Discretizer & Missing values

Post by shooltz[BayesFusion] »

kile wrote:But now the method GetVariableData it's not available anymore. Which one should I use if I dont know before reading the kind of data that is coming?
GetVariableData was replaced by GetIntData/GetFloatData. To check the type of the dataset column use IsDiscrete method.
Another question is regarding how I could include also automatic missing values replacement like in Genie -> Replace using average value. Is there any built functionality to make it? or it should be made by hand?
This functionality is implemented in GeNIe, so you'd have to write it yourself. Note that vectors returned from Get[Int|Float]Data are const, so you'll need to make a copy before filling in missing values and passing it on to discretizer.
Post Reply