Template Class entropy_balch2000

Inheritance Relationships

Base Type

Class Documentation

template<typename T>
class entropy_balch2000 : public rcppsw::er::client<entropy_balch2000<T>>

Wrapper class for performing clustering using the event horizon model in which all points within a specified distance (horizon) to a point i are included in its cluster. Implements the following algorithm from Balch2000:

For each value of horizon:

  1. Initialize N clusters, one for each datapoint in the input vector.

  2. For each cluster c_i centered at point p_i, check every point p_j (i != j), and if distance(p_i, p_j) <= horizon, add p_j to c_i.

  3. Discard redundant clusters.

  4. Calculate entropy of remaining non-redundant clusters. Entropy is accumulated across all values of horizon.

Template Parameters:

T – The type of the data that is being clustered. It must support the following operations: +=, /=, = .

Public Types

using cluster_vector = typename base_clustering_impl<T, policy::EH>::cluster_vector
using dist_calc_ftype = typename base_clustering_impl<T, policy::EH>::dist_calc_ftype
using membership_map = std::map<double, membership_type<policy::EH>>
using membership_vector = std::vector<membership_type<policy::EH>>

Public Functions

inline entropy_balch2000(std::unique_ptr<eh_clustering_impl<T>> impl, const math::ranged &horizon, double horizon_delta)
Parameters:
  • impl – The method and policy for clustering.

  • horizon – The min and maximum bounds of distances to use when computing clusters.

  • horizon_delta – The step size for moving between the min and max distance bounds; defines # of overall iterations.

inline double run(const std::vector<T> &data, const dist_calc_ftype &dist_func)

Perform entropy based clustering, returning the accumulated entropy across all horizons.