12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- /**
- * @file SCInformationGain.h
- * @brief the information gain splitting criterion
- * @author Sven Sickert
- * @date 01/12/2017
- */
- #ifndef SCInformationGainINCLUDE
- #define SCInformationGainINCLUDE
- #include "SplittingCriterion.h"
- namespace OBJREC {
- class SCInformationGain : public SplittingCriterion
- {
- protected:
- double entropy_left,
- entropy_right,
- count_left,
- count_right;
- bool use_shannon_entropy;
- public:
- /* default constructor */
- SCInformationGain();
- /* simple constructor */
- SCInformationGain( int _min_examples );
- /** config constructor */
- SCInformationGain( const NICE::Config *conf );
- /** copy constructor */
- SCInformationGain( const SCInformationGain &obj );
- /* simple destructor */
- virtual ~SCInformationGain();
- /* cloning function */
- virtual SplittingCriterion* clone();
- /**
- * @brief evaluate the split and return if split is possible
- * @param values unsorted list of feature values of a certain dimension
- * @param threshold threshold for current feature dimension
- * @param distribution_left class distribution for left child node after splitting
- * @param distribution_right class distribution for right child node after splitting
- * @param maxClassNo maximum class number
- * @return possible split or not
- */
- virtual bool evaluateSplit(
- const FeatureValuesUnsorted & values,
- double threshold,
- double* distribution_left,
- double* distribution_right,
- int maxClassNo );
- /**
- * @brief compute purity based on given split
- * @return purity value
- */
- double computePurity() const;
- };
-
- } // namespace
- #endif
|