Search found 19 matches

by kile
Wed May 20, 2009 9:53 pm
Forum: SMILE
Topic: Discretizer & Missing values
Replies: 1
Views: 5276

Discretizer & Missing values

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:

DSL_discretizer disc(d.GetVariableData(0));
disc.Discretize(3,DSL_discretizer ...
by kile
Wed May 20, 2009 7:27 pm
Forum: SMILE
Topic: Nodes ordering
Replies: 2
Views: 7239

shooltz thank u very much, it works just great ;)
by kile
Mon May 18, 2009 9:50 am
Forum: SMILE
Topic: Nodes ordering
Replies: 2
Views: 7239

Nodes ordering

Hi all!

I'm wondering if could be possible to use the same options that Genie provided us for ordering the nodes (Under layout menu option), to arrange the nodes to use them into our code with Smile.
The reason is that I generate some .xdsl files with networks and after open them in Genie I need to ...
by kile
Thu May 07, 2009 10:44 pm
Forum: SMILE
Topic: More questions about DSL_dataset's ReadFile
Replies: 7
Views: 13583

Ah ok thank u very much shooltz I was confusing about that ;)
by kile
Thu May 07, 2009 10:03 pm
Forum: SMILE
Topic: More questions about DSL_dataset's ReadFile
Replies: 7
Views: 13583

Ok, I answer myself :) I've made the following function:


int findVarState(int varID,std:string stateName)
{
DSL_datasetVarInfo varInfo=m_dataSet->GetVariableInfo(varID);
for(int j=0; j<varInfo.stateNames.size(); j++)
{
std::string currentStateName=m_dataSet->GetStateNames(varID)[j];
if ...
by kile
Thu May 07, 2009 8:42 pm
Forum: SMILE
Topic: More questions about DSL_dataset's ReadFile
Replies: 7
Views: 13583

Hi,

If I've the following file:
NO
YES
YES
NO

And I make read file, the state 0 will be NO and YES will be state 1,
but if you make in different order this will change.
I would like to know how it could be possible to get correctly the index of one read state to be able to use SetEvidence with the ...
by kile
Mon May 04, 2009 10:58 pm
Forum: SMILE
Topic: How to calculate the accuracy?
Replies: 14
Views: 27358

Hi Mark!

I've checked that this node it's exactly the one i need using next sentence too for security:

const char* name=result.GetNode(i)->GetId();


And it gaves me the same order that it's reading (for the variable name). But as you point I think my problem is coming not from the variable ...
by kile
Sat May 02, 2009 12:29 am
Forum: SMILE
Topic: How to calculate the accuracy?
Replies: 14
Views: 27358

Hi Mark!

Here it's the code:


if (m_dataset.ReadFile(filename)!=DSL_OKAY)
ExitProcess(0);

if (greedy.Learn(*crossValid->m_dataSet,result)!=DSL_OKAY)
{
ExitProcess(0);
}

//result.SetTarget(m_studyData->getNumAttributes()-1);
int TARGET_INDEX=result.FindNode("Paliza");
result.SetTarget ...
by kile
Fri May 01, 2009 11:24 pm
Forum: SMILE
Topic: How to calculate the accuracy?
Replies: 14
Views: 27358

Another example X)
The first line of the file is:

No No Yes No Yes

Where the last column is the class

So I go to Genie, and put the evidences of the first 4 nodes, and click Update Beliefs and I get in the class node:

Yes: 85%
No: 15%


But I read the file in my program and call SetEvidence ...
by kile
Fri May 01, 2009 11:01 pm
Forum: SMILE
Topic: How to calculate the accuracy?
Replies: 14
Views: 27358

Hi Mark!

I'll try to explain myself better. (Btw I made mistake it shouldn't be difference<=1 but difference<=0.5)

The Class Node will have 2 values, Yes or No, but they're probability, because they're 2 different states not just one value that can be 0 or 1.
So if I read from the file that the ...
by kile
Fri May 01, 2009 9:31 pm
Forum: SMILE
Topic: How to calculate the accuracy?
Replies: 14
Views: 27358

Hi all,

I'm making a simple test for check the percentage of the bn created.
For testing I just learn with whole data file:

crossValid->readFile("data.txt");
if (greedy.Learn(*crossValid->m_dataSet,result)!=DSL_OKAY)
{
ExitProcess(0);
}

int TARGET_INDEX=result.FindNode("Class");
result ...
by kile
Fri May 01, 2009 9:22 pm
Forum: SMILE
Topic: K-Fold Crossvalidation
Replies: 2
Views: 6566

Thank u very much schooltz, I added it and copyFrom(...) to have a copy function not just in the contructor.

The loop I think I've managed too ^_^

I'll post my version of K-fold when i'll get it working i think will be useful for someone.
by kile
Wed Apr 29, 2009 9:19 pm
Forum: SMILE
Topic: K-Fold Crossvalidation
Replies: 2
Views: 6566

K-Fold Crossvalidation

Hi all,

I was looking thorugh the forum and i found it http://genie.sis.pitt.edu/forum/viewtopic.php?t=181&highlight=cross

I assume any changes since that post so I started to create my own crossvalidation function. The problem is that I was thinking to do something like the following:

DSL ...
by kile
Mon Apr 27, 2009 10:58 pm
Forum: SMILE
Topic: How to calculate the accuracy?
Replies: 14
Views: 27358

I think I could answer myself :)
Instead of using GetEvidence (It's normal as you didn't declare it O:) )

Code: Select all

DSL_Dmatrix* mat=result.GetNode(TARGET)->Value()->GetMatrix() ;
double value_state0=matriz->GetItems().Subscript(0);
by kile
Mon Apr 27, 2009 10:37 pm
Forum: SMILE
Topic: How to calculate the accuracy?
Replies: 14
Views: 27358

Hi

I just looking throw the forum found this topic. I was trying to do something similar, but I don't know what I could be doing wrong.

First I learn my bn using a file dataset and greedy.

greedy.Learn(m_dataset,result)


Once I get the result bn I read the initial file and go through each ...