21 #define GRT_DLL_EXPORTS 27 UINT FeatureExtraction::numFeatureExtractionInstances = 0;
29 std::string FeatureExtraction::getFeatureExtractionType()
const {
return MLBase::getId(); }
35 StringFeatureExtractionMap::iterator iter = getMap()->find(
id );
36 if( iter == getMap()->end() ){
39 return iter->second();
49 featureDataReady =
false;
50 numInputDimensions = 0;
51 numOutputDimensions = 0;
52 inputType = DATA_TYPE_VECTOR;
53 outputType = DATA_TYPE_VECTOR;
54 numFeatureExtractionInstances++;
58 if( --numFeatureExtractionInstances == 0 ){
59 delete stringFeatureExtractionMap;
60 stringFeatureExtractionMap = NULL;
66 if( featureExtractionModule == NULL ){
67 errorLog <<
"copyBaseVariables(const FeatureExtraction *featureExtractionModule) - featureExtractionModule pointer is NULL!" << std::endl;
75 this->featureExtractionType = featureExtractionModule->featureExtractionType;
76 this->initialized = featureExtractionModule->initialized;
77 this->featureDataReady = featureExtractionModule->featureDataReady;
78 this->numInputDimensions = featureExtractionModule->numInputDimensions;
79 this->numOutputDimensions = featureExtractionModule->numOutputDimensions;
80 this->featureVector = featureExtractionModule->featureVector;
81 this->featureMatrix = featureExtractionModule->featureMatrix;
88 if( numOutputDimensions == 0 ){
89 errorLog <<
"init() - Failed to init module, the number of output dimensions is zero!" << std::endl;
95 featureDataReady =
false;
98 featureVector.
resize(numOutputDimensions,0);
112 featureDataReady =
false;
113 featureVector.clear();
120 if( !file.is_open() ){
121 errorLog <<
"saveFeatureExtractionSettingsToFile(fstream &file) - The file is not open!" << std::endl;
127 file <<
"Initialized: " << initialized << std::endl;
134 if( !file.is_open() ){
135 errorLog <<
"loadFeatureExtractionSettingsFromFile(fstream &file) - The file is not open!" << std::endl;
148 if( word !=
"Initialized:" ){
149 errorLog <<
"loadPreProcessingSettingsFromFile(fstream &file) - Failed to read Initialized header!" << std::endl;
168 return featureDataReady;
172 return featureVector;
176 return featureMatrix;
bool saveBaseSettingsToFile(std::fstream &file) const
std::string getId() const
virtual bool resize(const unsigned int size)
bool copyMLBaseVariables(const MLBase *mlBase)
bool loadBaseSettingsFromFile(std::fstream &file)
This is the main base class that all GRT machine learning algorithms should inherit from...