Documentation ¶
Overview ¶
This package implements clustering algorithms
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
Types ¶
type ClusterMap ¶
ClusterMap contains the cluster identifier as a key, followed by a vector of point indices that cluster contains.
func DBSCAN ¶
func DBSCAN(inst base.FixedDataGrid, params DBSCANParameters) (ClusterMap, error)
DBSCAN clusters inst using the parameters allowed in and produces a ClusterId->[RowId] map
func (ClusterMap) Equals ¶
func (ref ClusterMap) Equals(other ClusterMap) (bool, error)
Equals checks whether a bijection exists between two ClusterMaps (i.e. the clusters in one can be re-labelled to become the clusters of another)
type ClusterParameters ¶
type ClusterParameters struct { // Attributes represents the set of Attributes which // can be used for clustering Attributes []base.Attribute // Metric is used to compute pairwise distance Metric pairwise.PairwiseDistanceFunc }
type DBSCANParameters ¶
type DBSCANParameters struct { ClusterParameters // Eps represents the "reachability", or the maximum // distance any point can be before being considered for // inclusion. Eps float64 // MinCount represents how many points need to be // in a cluster before it is considered one. MinCount int }
DBSCANParameters describes the parameters of the density-based clustering algorithm DBSCAN
type ExpectationMaximization ¶
type ExpectationMaximization struct { Params Params // contains filtered or unexported fields }
func NewExpectationMaximization ¶
func NewExpectationMaximization(n_comps int) (*ExpectationMaximization, error)
Number of Gaussians to fit in the mixture
func (*ExpectationMaximization) Fit ¶
func (em *ExpectationMaximization) Fit(inst base.FixedDataGrid) error
Fit method - generates the component parameters (means and covariance matrices)
func (*ExpectationMaximization) Predict ¶
func (em *ExpectationMaximization) Predict(inst base.FixedDataGrid) (ClusterMap, error)
Predict method - returns a ClusterMap of components and row ids