Template Class entropy_balch2000
Defined in File entropy.hpp
Inheritance Relationships
Base Type
public rcppsw::er::client< entropy_balch2000< T > >
(Template Class client)
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:
Initialize N clusters, one for each datapoint in the input vector.
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.
Discard redundant clusters.
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 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.