Changeset 8065:b1256c6f51a9 in orange


Ignore:
Timestamp:
07/04/11 10:31:23 (3 years ago)
Author:
jzbontar <jure.zbontar@…>
Branch:
default
Convert:
643857ab4838d1f4fefb38163ca90a851241086f
Message:

SimpleTree: added paramater skipProb

Location:
source/orange
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • source/orange/tdidt_simple.cpp

    r8064 r8065  
    4141struct Args { 
    4242    int minExamples, maxDepth; 
    43     float maxMajority; 
     43    float maxMajority, skipProb; 
    4444 
    4545    int *attr_split_so_far; 
     
    238238 
    239239                /* select random subset of attributes - CHANGE ME */ 
    240                 if ((double)rand() / RAND_MAX < 0.8)  
     240                if ((double)rand() / RAND_MAX < args->skipProb) 
    241241                    continue; 
    242242             
     
    337337} 
    338338 
    339 TSimpleTreeLearner::TSimpleTreeLearner(const int &weight, float maxMajority, int minExamples, int maxDepth) : 
     339TSimpleTreeLearner::TSimpleTreeLearner(const int &weight, float maxMajority, int minExamples, int maxDepth, float skipProb) : 
    340340    maxMajority(maxMajority), 
    341341    minExamples(minExamples), 
    342     maxDepth(maxDepth) 
     342    maxDepth(maxDepth), 
     343    skipProb(skipProb) 
    343344{ 
    344345} 
     
    365366    args.maxMajority = maxMajority; 
    366367    args.maxDepth = maxDepth; 
     368    args.skipProb = skipProb; 
    367369 
    368370    tree = build_tree(examples, ogen->numberOfExamples(), 0, &args); 
  • source/orange/tdidt_simple.hpp

    r8063 r8065  
    4242    int minExamples; //P 
    4343    int maxDepth; //P 
     44    float skipProb; //P 
    4445 
    45     TSimpleTreeLearner(const int & =0, float=1.0, int=1, int=INT_MAX); 
     46    TSimpleTreeLearner(const int & =0, float=1.0, int=1, int=INT_MAX, float=0.0); 
    4647    PClassifier operator()(PExampleGenerator, const int & =0); 
    4748}; 
Note: See TracChangeset for help on using the changeset viewer.