forpy
2
|
Calculates the gain as difference of current entropy and the weighted sum of subgroup entropies. More...
#include <entropygain.h>
Public Member Functions | |
EntropyGain (const std::shared_ptr< IEntropyFunction > &entropy_function) | |
float | approx (const std::vector< float > &members_numbers_left, const std::vector< float > &members_numbers_right) |
float | operator() (const float ¤t_entropy, const std::vector< float > &members_numbers_left, const std::vector< float > &members_numbers_right) |
float | operator() (const std::vector< float > &members_numbers_left, const std::vector< float > &members_numbers_right) |
bool | operator== (const IGainCalculator &rhs) const |
std::shared_ptr< IEntropyFunction > | getEntropy_function () const |
![]() | |
virtual | ~IGainCalculator () |
Protected Member Functions | |
EntropyGain () | |
![]() | |
IGainCalculator () | |
Private Member Functions | |
template<class Archive > | |
void | serialize (Archive &ar, const uint &) |
Private Attributes | |
std::shared_ptr< IEntropyFunction > | entropy_function |
Friends | |
class | cereal::access |
Calculates the gain as difference of current entropy and the weighted sum of subgroup entropies.
Works correctly up to a total sum of elements of min(numeric_limits<float>::max(), numeric_limits<input_dtype>::max()) and the limitations of the selected entropy function. Speed optimized function that does no checks in release mode!
input_dtype | The datatype for counting class members. This might be a float if sample weights are used. |
Definition at line 34 of file entropygain.h.
|
inlineexplicit |
entropy_function | shared(IEntropyFunction) The entropy to use for gain calculation. |
Definition at line 40 of file entropygain.h.
|
inlineprotected |
Definition at line 62 of file entropygain.h.
|
virtual |
Gets a gain approximation that can be used inside an argmax
function.
Reimplemented from forpy::IGainCalculator.
std::shared_ptr<IEntropyFunction> forpy::EntropyGain::getEntropy_function | ( | ) | const |
|
virtual |
Calculates the information gain.
Reimplemented from forpy::IGainCalculator.
|
virtual |
Calculates the information gain.
Reimplemented from forpy::IGainCalculator.
|
virtual |
Deep equality comparison.
Reimplemented from forpy::IGainCalculator.
|
inlineprivate |
Definition at line 69 of file entropygain.h.
|
friend |
Definition at line 67 of file entropygain.h.
|
private |
Definition at line 65 of file entropygain.h.