Class ientropy

Inheritance Relationships

Base Type

Class Documentation

class ientropy : public rcppsw::math::expression<double>

Calculates the informational entropy of a cluster (Shannon’s definition).

Uses the formula:

H(S) = - SUM( p_i * log2(p_i)) over all i in m.

Public Functions

inline double operator()(const std::vector<double> &groups)

Calculate the informational entropy.

Parameters:

groups[in] A vector of the proportional representation of each group within the cluster. Should sum to 1, though this is not checked.