forpy 2

Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
forpy::InducedEntropy Class Reference
Impurity Measures

Computes the induced p entropy. More...

`#include <inducedentropy.h>`

Inheritance diagram for forpy::InducedEntropy:

## Public Member Functions
| InducedEntropy (const float &p)
| ~InducedEntropy ()
virtual float | operator() (const float *class_members_numbers, const size_t &n, const float &fsum) const
bool | operator== (const IEntropyFunction &rhs) const
float | get_p () const
Public Member Functions inherited from forpy::IEntropyFunction
virtual | ~IEntropyFunction ()
virtual float | operator() (const std::vector< float > &class_members_numbers, const float &fsum) const
| The interface function that must be implemented. More...
virtual float | operator() (const std::vector< float > &class_members_numbers) const
| Classical entropy calculation function. More...

## Private Member Functions
| InducedEntropy ()
template<class Archive >
void | serialize (Archive &ar, const uint &)
| DISALLOW_COPY_AND_ASSIGN (InducedEntropy)

## Private Attributes
float | p

## Friends
class | cereal::access
std::ostream & | operator<< (std::ostream &stream, const InducedEntropy &self)

## Additional Inherited Members
Protected Member Functions inherited from forpy::IEntropyFunction
| IEntropyFunction ()

## Detailed Description

Computes the induced p entropy.

Works correctly up to a total sum of elements of numeric_limits<float>::max().

This is the induced p-metric of the vector of \(n\) class probabilities and the point of maximum unorder (the vector with all entries \(\frac{1}{n}\)) in the n-dimensional space without applying the root. It is equal to the Gini-measure for \(p=2\).

The definition for \(c\) classes:

\[\sum_{i=1}^{c} \left\Vert p_i - \frac{1}{c}\right\Vert ^p\]

.

The differential entropy for a normal distribution with covariance matrix \(\Sigma\) in \(n\) dimensions is defined as:

\[\frac{1}{\sqrt{p^n}}\cdot\left(\sqrt{2\pi}^n\cdot\sqrt{\left|\Sigma\right|}\right)^{-(p-1)}\]

In the differential normal case, the most useful values for \(p\) are very close to 1 (e.g. 1.00001)! \(p=2\) is already equivalent to the infinite norm!

Definition at line 42 of file inducedentropy.h.

## Constructor & Destructor Documentation

## ◆ InducedEntropy() [1/2]

forpy::InducedEntropy::InducedEntropy | ( | const float & | p | ) |
| inline explicit

Definition at line 44 of file inducedentropy.h.

## ◆ ~InducedEntropy()

forpy::InducedEntropy::~InducedEntropy | ( |  | ) |
| inline

Definition at line 49 of file inducedentropy.h.

## ◆ InducedEntropy() [2/2]

forpy::InducedEntropy::InducedEntropy | ( |  | ) |
| inline private

Definition at line 105 of file inducedentropy.h.

## Member Function Documentation

## ◆ DISALLOW_COPY_AND_ASSIGN()

forpy::InducedEntropy::DISALLOW_COPY_AND_ASSIGN | ( | InducedEntropy |  | ) |
| private

## ◆ get_p()

float forpy::InducedEntropy::get_p | ( |  | ) | const
| inline

Definition at line 102 of file inducedentropy.h.

## ◆ operator()()

virtual float forpy::InducedEntropy::operator() | ( | const float * | class_members_numbers,
|  | const size_t & | n,
|  | const float & | fsum
| ) |  | const
| inline virtual

Reimplemented from forpy::IEntropyFunction.

Definition at line 51 of file inducedentropy.h.

## ◆ operator==()

bool forpy::InducedEntropy::operator== | ( | const IEntropyFunction & | rhs | ) | const
| inline virtual

Deep equality comparison.

Reimplemented from forpy::IEntropyFunction.

Definition at line 92 of file inducedentropy.h.

## ◆ serialize()

template<class Archive >

void forpy::InducedEntropy::serialize | ( | Archive & | ar,
|  | const uint & |
| ) |  |
| inline private

Definition at line 109 of file inducedentropy.h.

## Friends And Related Function Documentation

## ◆ cereal::access

friend class cereal::access
| friend

Definition at line 105 of file inducedentropy.h.

## ◆ operator<<

std::ostream& operator<< | ( | std::ostream & | stream,
|  | const InducedEntropy & | self
| ) |  |
| friend

Definition at line 86 of file inducedentropy.h.

## Member Data Documentation

## ◆ p

float forpy::InducedEntropy::p
| private

Definition at line 114 of file inducedentropy.h.

The documentation for this class was generated from the following file:

- /Users/classner/git/forpy/include/forpy/impurities/inducedentropy.h