Changeset 4627:7ab2b3df3d34 in orange


Ignore:
Timestamp:
05/08/08 23:26:21 (6 years ago)
Author:
janezd <janez.demsar@…>
Branch:
default
Convert:
c115fd1132f606ffb403e13daf526a94c9a7739e
Message:
  • ReliefF now computes a checksum before reusing the neighbourhood structure
  • it also has a flag checkCachedData to disable it where appropriate
Location:
source/orange
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • source/orange/measures.cpp

    r3583 r4627  
    10031003  k(ak), 
    10041004  m(am), 
     1005  checkCachedData(true), 
    10051006  prevExamples(-1), 
    1006   prevWeight(0) 
     1007  prevWeight(0), 
     1008  prevChecksum(0) 
    10071009{} 
    10081010 
     
    11771179    raiseError("class-less domain"); 
    11781180 
    1179   if ((prevExamples != gen->version) || (weightID != prevWeight))  { 
     1181  int newChecksum; 
     1182  bool renew = false; 
     1183  if ((prevExamples != gen->version) || (weightID != prevWeight)) { 
     1184    newChecksum = gen->checkSum(true); 
     1185    renew = true; 
     1186  } 
     1187  else if (checkCachedData) { 
     1188    newChecksum = gen->checkSum(true); 
     1189    renew = newChecksum != prevChecksum; 
     1190  } 
     1191 
     1192  if (renew)  { 
    11801193    measures.clear(); 
    11811194    prepareNeighbours(gen, weightID); 
    11821195    prevExamples = gen->version; 
    11831196    prevWeight = weightID; 
     1197    prevChecksum = newChecksum; 
    11841198  } 
    11851199} 
  • source/orange/relief.hpp

    r3060 r4627  
    9191    float k; //P number of neighbours 
    9292    float m; //P number of reference examples 
     93    bool checkCachedData; //P tells whether to check the checksum of the data before reusing the cached neighbours 
    9394 
    9495    TMeasureAttribute_relief(int ak=5, int am=100); 
     
    107108 
    108109    vector<float> measures; 
    109     int prevExamples, prevWeight; 
     110    int prevExamples, prevWeight, prevChecksum; 
    110111 
    111112    // the first int the index of the reference example 
Note: See TracChangeset for help on using the changeset viewer.