1 #if !defined(_FEATUREVECTOR_) 2 #define _FEATUREVECTOR_ 42 #if !defined(_ClassProbList_Defined_) 73 void BreakTie (
float _breakTie) {breakTie = _breakTie;}
74 void MLClass (MLClassPtr _mlClass) {mlClass = _mlClass;}
76 void MissingData (
bool _missingData) {missingData = _missingData;}
77 void OrigSize (
float _origSize) {origSize = _origSize;}
78 void PredictedClass (MLClassPtr _predictedClass) {predictedClass = _predictedClass;}
79 void Probability (
float _probability) {probability = _probability;}
105 void TrainWeight (
float _trainWeight) {trainWeight = _trainWeight;}
109 void Validated (
bool _validated) {validated = _validated;}
159 KKStr exampleFileName;
164 MLClassPtr predictedClass;
191 #define _FeatureVector_Defined_ 194 class FeatureVectorComparison;
374 float _minSize = -1.0f
547 void ValidateFileDescAndFieldNum (
kkint32 fieldNum,
581 #define _FeatureVectorList_Defined_ __int16 kkint16
16 bit signed integer.
void ExampleFileName(const KKStr &_exampleFileName)
Name of source of feature vector, ex: file name of image that the feature vector was computed from...
void PushOnBack(FeatureVectorPtr image)
Overloading the PushOnBack function in KKQueue so we can monitor the Version and Sort Order...
void Validated(bool _validated)
Indicated whether an expert has validated the class assignment.
void PushOnFront(FeatureVectorPtr image)
Overloading the PushOnFront function in KKQueue so we can monitor the Version and Sort Order...
void AddQueue(const FeatureVectorList &examplesToAdd)
Add the contents of 'examplesToAdd' to the end of this list.
void ResetNumOfFeatures(kkint32 newNumOfFeatures)
KKMLL::AttributeTypeVector CreateAttributeTypeTable() const
FeatureVectorListPtr StratifyAmoungstClasses(kkint32 numOfFolds, RunLog &log)
void BreakTie(float _breakTie)
Update the BreakTie value.
KKStrListPtr ExtractDuplicatesByExampleFileName()
void SortByBreakTie(bool reversedOrder=false)
void AddSingleExample(FeatureVectorPtr _imageFeatures)
Same as PushOnBack.
FeatureVector * FeatureVectorPtr
bool AllFieldsAreNumeric() const
Returns true if all fields are numeric, no nominal fields.
FeatureVectorList(const FeatureVectorList &examples, bool _owner)
Create a duplicate list, depending on the '_owner' parameter may also duplicate the contents...
virtual FeatureVectorListPtr Duplicate(bool _owner) const
Creates a duplicate of list using the same container.
const float * FeatureData() const
Returns as a pointer to the feature data itself.
kkint32 GetClassCount(MLClassPtr c) const
Returns number of examples for a specific Class (MLClass).
FeatureVectorPtr BinarySearchByName(const KKStr &_imageFileName) const
Will search for the example with the same name as '_imageFileName'.
float FeatureData(kkint32 featureNum) const
virtual kkint32 MemoryConsumedEstimated() const
ClassProbListPtr GetClassDistribution() const
Keeps track of selected features.
bool MissingData() const
True indicates that one or more features were missing.
FeatureVector(kkint32 _numOfFeatures)
kkint32 NumOfFeatures() const
Number of features in this FeatureVector.
virtual ~FeatureVectorList()
float OrigSize() const
The value of Feature[0] before normalization.
MLClassListPtr ExtractListOfClasses() const
FeatureNumList AllFeatures()
Will return a FeatureNumList instance with all features selected.
const FileDescPtr FileDesc() const
void PrintClassStatisticsHTML(std::ostream &o) const
float Probability() const
The probability assigned by classifier to the predicted class.
const KKStr & MLClassName() const
Name of class that this example is assigned to.
void RemoveEntriesWithMissingFeatures(RunLog &log)
virtual FeatureVectorListPtr DuplicateListAndContents() const
Creates a duplicate of list and also duplicates it contents.
void TrainWeight(float _trainWeight)
Assign a specific example a higher weight for training purposes.
void SortByProbability(bool reversedOrder=false)
KKMLL::AttributeType FeatureType(kkint32 featureNum) const
Returns the type of attribute for specified 'featureNum'.
virtual FeatureVectorListPtr ManufactureEmptyList(bool _owner) const
Creates an instance of a Empty FeatureVectorList.
void SortByImageFileName(bool reversedOrder=false)
#define _FeatureFileIO_Defined_
unsigned __int32 kkuint32
VectorDouble ExtractMeanFeatureValues()
void AddFeatureData(kkint32 _featureNum, float _featureData)
MLClassPtr PredictedClass() const
float BreakTie() const
The difference in probability between the two most likely classes.
FeatureVectorList(FileDescPtr _fileDesc, bool _owner)
Will create a new empty list of FeatureVector's.
virtual FeatureVectorPtr Duplicate() const
FeatureVector(const FeatureVector &_example)
Container class for FeatureVector derived objects.
void PrintFeatureStatisticsByClass(std::ostream &o) const
void CalcStatsForFeatureNum(kkint32 _featureNum, kkint32 &_count, float &_total, float &_mean, float &_var, float &_stdDev)
const float * FeatureDataConst() const
void AppendToFile(KKStr _fileName, FeatureFileIOPtr _driver, const FeatureNumList &_selFeatures)
kkint32 FeatureCount() const
void AllocateFeatureDataArray()
Used by container classes such as 'FeatureVectorList'. This way they can determine real underlying cl...
FeatureFileIO * FeatureFileIOPtr
FeatureVectorListPtr ExtractExamplesForAGivenClass(MLClassPtr _mlClass, kkint32 _maxToExtract=-1, float _minSize=-1.0f) const
kkint32 NumOfFeatures() const
FeatureVector * FeatureVectorPtr
void SortByRootName(bool reversedOrder=false)
vector< kkint32 > CreateCardinalityTable() const
FeatureVectorList(MLClassList &_mlClasses, FeatureVectorList &_examples)
Will create a list of consisting of the subset of examples in '_examples' which are members of Images...
void ResetFileDesc(FileDescPtr newFileDesc)
void SaveOrderingOfImages(const KKStr &fileName, bool &successful)
Will save into a file the current ordering of FeatureVector instances in list.
static KKStr Concat(const std::vector< std::string > &values)
Concatenates the list of 'std::string' strings.
ClassProbList * ClassProbListPtr
ClassStatisticListPtr GetClassStatistics() const
Returns the number of FeatureVectors per class.
MLClassPtr MLClass() const
Class that is example is assigned to.
FeatureVectorListPtr OrderUsingNamesFromAFile(const KKStr &fileName, RunLog &log)
Using list of ImageFileNames in a file('fileName') create a new FeatureVectorList instance with examp...
void MLClass(MLClassPtr _mlClass)
Assign a class to this example.
void FileName(const KKStr &_fileName)
FeatureVectorListPtr StratifyAmoungstClasses(MLClassListPtr mlClasses, kkint32 maxImagesPerClass, kkint32 numOfFolds, RunLog &log)
bool SameExceptForSymbolicData(const FeatureVectorList &otherData, RunLog &log) const
void FeatureData(kkint32 _featureNum, float _featureValue)
Assign a value to a specific feature number for the feature vector.
float TotalOfFeatureData() const
Returns the total of all Feature Attributes for this feature vector.
ClassStatisticList * ClassStatisticListPtr
FeatureVectorListPtr ExtractRandomSampling(float percentage, kkint32 minClassCount)
Will return a random sampling by class of our FeatureVector's; with a minimum per class of 'minClassC...
void Probability(float _probability)
Assign a prediction probability to this example.
FeatureVectorPtr LookUpByRootName(const KKStr &_rootName)
Returns a pointer to the FeatureVector who's ExampleFileName rootname = _rootName *...
bool operator==(FeatureVector &other_example) const
IFL_SortOrder
Represents the different orders that a list of FeatureVector instances in a FeatureVectorList object ...
FeatureVectorListPtr ExtractExamplesForHierarchyLevel(kkuint32 level)
Will create a list of FeatureVectors where the class assignment will reflect the specified Hierarchy ...
FeatureVectorListPtr ExtractDuplicatesByRootImageFileName()
Returns: a list of 'FeatureVector' objects that have duplicate root file names.
void Version(kkint16 _version)
float MajorityClassFraction() const
void ReSyncSymbolicData(FileDescPtr newFileDesc)
const KKStr & FileName() const
const KKStr & FieldName(kkint32 featureNum) const
Returns name of Attribute Field.
void OrigSize(float _origSize)
The value of Feature[0] before normalization.
void PredictedClass(MLClassPtr _predictedClass)
FeatureVectorListPtr CreateListForAGivenLevel(kkint32 level)
Will create a list of FeatureVectors where the class assignment will reflect the specified Hierarchy ...
KKStr & operator=(const KKStr &src)
IFL_SortOrder CurSortOrder() const
Used for logging messages.
void EncodeProblem(const struct svm_paramater ¶m, struct svm_problem &prob_in, struct svm_problem &prob_out)
kkint32 FeatureCardinality(kkint32 featureNum) const
Returns the number of values defined for a Nominal Field.
const KKStr & PredictedClassName() const
float TrainWeight() const
void RemoveDuplicateEntries(bool allowDupsInSameClass, RunLog &runLog)
const KKStr & ClassName() const
Name of class that this example is assigned to.
KKStr ClassStatisticsStr() const
void SynchronizeSymbolicData(FeatureVectorList &otherData, RunLog &log)
Maintains a list of MLClass instances.
virtual kkint32 MemoryConsumedEstimated() const
FeatureVectorList * FeatureVectorListPtr
Represents a Feature Vector of a single example, labeled or unlabeled.
FeatureVectorPtr LookUpByImageFileName(const KKStr &_imageFileName) const
Returns a pointer to the FeatureVector which has '_imageFileName'.
kkint32 NumEntriesOfAGivenClass(MLClassPtr mlClass) const
FeatureVectorListPtr ExtractExamplesForClassList(MLClassListPtr classes)
float * FeatureDataAlter()
Same as 'FeatureData() except you can modify the data.
void MissingData(bool _missingData)
True indicates that not all the feature data was present when this example was loaded from a data fil...
void Version(kkint16 _version)
void SortByClass(bool reversedOrder=false)
KKStr FeatureTypeStr(kkint32 featureNum) const
std::vector< double > VectorDouble
Vector of doubles.
FeatureVectorList * FeatureVectorListPtr
const KKStr & ExampleFileName() const
Name of file that this FeatureVector was computed from.
void ResetNumOfFeaturs(kkint32 newNumOfFeatures)
void PrintClassStatistics(std::ostream &o) const