3 #ifndef FORPY_GAINS_ENTROPYGAIN_H_ 4 #define FORPY_GAINS_ENTROPYGAIN_H_ 8 #include "../util/serialization/basics.h" 15 #include "../impurities/impurities.h" 16 #include "../util/checks.h" 45 float approx(
const std::vector<float> &members_numbers_left,
46 const std::vector<float> &members_numbers_right);
50 const std::vector<float> &members_numbers_left,
51 const std::vector<float> &members_numbers_right);
54 float operator()(
const std::vector<float> &members_numbers_left,
55 const std::vector<float> &members_numbers_right);
68 template <
class Archive>
70 ar(cereal::make_nvp(
"base", cereal::base_class<IGainCalculator>(
this)),
77 #endif // FORPY_GAINS_ENTROPYGAIN_H_ Interface for a gain calculator class.
std::shared_ptr< IEntropyFunction > getEntropy_function() const
float operator()(const float ¤t_entropy, const std::vector< float > &members_numbers_left, const std::vector< float > &members_numbers_right)
CEREAL_REGISTER_TYPE(forpy::EntropyGain)
EntropyGain(const std::shared_ptr< IEntropyFunction > &entropy_function)
friend class cereal::access
std::shared_ptr< IEntropyFunction > entropy_function
Calculates the gain as difference of current entropy and the weighted sum of subgroup entropies...
bool operator==(const IGainCalculator &rhs) const
float approx(const std::vector< float > &members_numbers_left, const std::vector< float > &members_numbers_right)
void serialize(Archive &ar, const uint &)
unsigned int uint
Convenience typedef for unsigned int.