Changeset 4035:dab2e0abe64d in orange


Ignore:
Timestamp:
08/03/07 13:02:17 (7 years ago)
Author:
janezd <janez.demsar@…>
Branch:
default
Convert:
cabfec78d79ee31881549cb09d9dec13a0bed962
Message:

domain depot's prepareDomain now doesn't accept sourceDomain, sourceVariables, dontCheckStored etc. Instead it searches through all existing attributes and decides which can be reused.
Assistant and Retis readers were being reprogrammed when I decided to drop them altogether. Nobody uses them, so they are just an unnecessary maintenance burden.

This is a commit of the changes already made, but these versions do not necessarily compile.

Location:
source/orange
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • source/orange/assistant.cpp

    r3997 r4035  
    134134 
    135135 
    136 PDomain TAssistantExampleGenerator::readDomain(const string &stem, PVarList sourceVars, PDomain sourceDomain, bool dontCheckStored, bool dontStore) 
     136PDomain TAssistantExampleGenerator::readDomain(const string &stem, const int createNewOn, vector<int> &status, vector<int> &metaStatus) 
    137137{  
    138138  ifstream str(stem.c_str(), ios::binary); 
     
    185185  } 
    186186 
    187   return domainDepot.prepareDomain(&attributeDescriptions, true, NULL, sourceVars, NULL, dontStore, dontCheckStored); 
     187  return domainDepot.prepareDomain(&attributeDescriptions, true, NULL, createNewOn, status, metaStatus); 
    188188} 
    189189 
  • source/orange/assistant.hpp

    r1337 r4035  
    3636  vector<vector<float> *> intervals; 
    3737 
    38   TAssistantExampleGenerator(const string &datafile, const string &domainfile, PVarList sourceVars = PVarList(), PDomain sourceDomain = PDomain(), bool dontCheckStored = false, bool dontStore = false); 
     38  TAssistantExampleGenerator(const string &datafile, const string &domainfile, const int createNewOn, vector<int> &status, vector<int> &metaStatus); 
    3939  TAssistantExampleGenerator(const TAssistantExampleGenerator &old); 
    4040  ~TAssistantExampleGenerator(); 
     
    4343  virtual bool readExample (TFileExampleIteratorData &, TExample &); 
    4444 
    45   PDomain readDomain(const string &stem, PVarList sourceVars, PDomain sourceDomain, bool dontCheckStored, bool dontStore); 
     45  PDomain readDomain(const string &stem, const int createNewOn, vector<int> &status, vector<int> &metaStatus); 
    4646 
    4747private: 
  • source/orange/retisinter.cpp

    r3997 r4035  
    3434TDomainDepot TRetisExampleGenerator::domainDepot; 
    3535 
    36 TRetisExampleGenerator::TRetisExampleGenerator(const string &datafile, const string &domainfile, PVarList sourceVars, PDomain sourceDomain, bool dontCheckStored, bool dontStore) 
    37 : TFileExampleGenerator(datafile, readDomain(domainfile, sourceVars, sourceDomain, dontCheckStored, dontStore)) 
     36TRetisExampleGenerator::TRetisExampleGenerator(const string &datafile, const string &domainfile, const int createNewOn, vector<int> &status, vector<int> &metaStatus) 
     37: TFileExampleGenerator(datafile, readDomain(domainfile, createNewOn, status, metaStatus)) 
    3838{} 
    3939   
     
    115115 
    116116// Reads the .names file. The format allow using different delimiters, not just those specified by the original format 
    117 PDomain TRetisExampleGenerator::readDomain(const string &stem, PVarList sourceVars, PDomain sourceDomain, bool dontCheckStored, bool dontStore) 
     117PDomain TRetisExampleGenerator::readDomain(const string &stem, const int createNewOn, vector<int> &status, vector<int> &metaStatus) 
    118118{ ifstream str(stem.c_str(), ios::binary); 
    119119  if (!str.is_open()) 
     
    146146  attributeDescriptions.push_back(TDomainDepot::TAttributeDescription(className, TValue::FLOATVAR)); 
    147147 
    148   if (sourceDomain) { 
    149     if (!domainDepot.checkDomain(sourceDomain.AS(TDomain), &attributeDescriptions, true, NULL)) 
    150       raiseError("given domain does not match the file"); 
    151     else 
    152       return sourceDomain; 
    153   } 
    154  
    155   return domainDepot.prepareDomain(&attributeDescriptions, true, NULL, sourceVars, NULL, dontStore, dontCheckStored); 
     148  return domainDepot.prepareDomain(&attributeDescriptions, true, NULL, createNewOn, status, metaStatus); 
    156149} 
    157150 
  • source/orange/retisinter.hpp

    r2637 r4035  
    3434  __REGISTER_CLASS 
    3535 
    36   TRetisExampleGenerator(const string &datafile, const string &domainfile, PVarList sourceVars, PDomain sourceDomain, bool dontCheckStored, bool dontStore); 
     36  TRetisExampleGenerator(const string &datafile, const string &domainfile, const int createNewOn, vector<int> &status, vector<int> &metaStatus); 
    3737  TExampleIterator begin(); 
    3838  virtual bool readExample(TFileExampleIteratorData &, TExample &); 
    3939 
    40   PDomain readDomain(const string &stem, PVarList sourceVars, PDomain sourceDomain, bool dontCheckStored, bool dontStore); 
     40  PDomain readDomain(const string &stem, const int createNewOn, vector<int> &status, vector<int> &metaStatus); 
    4141 
    4242private: 
Note: See TracChangeset for help on using the changeset viewer.