Changeset 9042:b1bf4dea43f3 in orange


Ignore:
Timestamp:
09/29/11 11:02:13 (3 years ago)
Author:
jzbontar <jure.zbontar@…>
Branch:
default
Convert:
d15262246323717ea2f3da08aa40d43c0bc30a0b
Message:

SimpleTreeLearner: dodal argument seed

Location:
source/orange
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • source/orange/tdidt_simple.cpp

    r8905 r9042  
    589589} 
    590590 
    591 TSimpleTreeLearner::TSimpleTreeLearner(const int &weight, float maxMajority, int minInstances, int maxDepth, float skipProb) : 
     591TSimpleTreeLearner::TSimpleTreeLearner(const int &weight, float maxMajority, int minInstances, int maxDepth, float skipProb, unsigned int seed) : 
    592592    maxMajority(maxMajority), 
    593593    minInstances(minInstances), 
    594594    maxDepth(maxDepth), 
    595     skipProb(skipProb) 
     595    skipProb(skipProb), 
     596    seed(seed) 
    596597{ 
    597598} 
     
    624625    args.type = ogen->domain->classVar->varType == TValue::INTVAR ? Classification : Regression; 
    625626 
     627    srand(seed); 
    626628    tree = build_tree(examples, ogen->numberOfExamples(), 0, NULL, &args); 
    627629 
  • source/orange/tdidt_simple.hpp

    r8905 r9042  
    4242    int maxDepth; //P 
    4343    float skipProb; //P 
     44    int seed; //P 
    4445 
    45     TSimpleTreeLearner(const int & =0, float=1.0, int=0, int=INT_MAX, float=0.0); 
     46    TSimpleTreeLearner(const int & =0, float=1.0, int=0, int=INT_MAX, float=0.0, unsigned int=0); 
    4647    PClassifier operator()(PExampleGenerator, const int & =0); 
    4748}; 
     
    5657 
    5758    TSimpleTreeClassifier(); 
    58     TSimpleTreeClassifier(const PVariable &, struct SimpleTreeNode *tree, int type); 
     59    TSimpleTreeClassifier(const PVariable &, struct SimpleTreeNode *, int); 
    5960    ~TSimpleTreeClassifier(); 
    6061 
Note: See TracChangeset for help on using the changeset viewer.