Documentation
¶
Overview ¶
Package cluster provides clustering algorithms.
Index ¶
- type KMeans
- func (km *KMeans) Centers() [][]float64
- func (km *KMeans) Fit(X *dataframe.DataFrame) error
- func (km *KMeans) FitPredict(X *dataframe.DataFrame) (*seriesPkg.Series[any], error)
- func (km *KMeans) Inertia() float64
- func (km *KMeans) NIter() int
- func (km *KMeans) Predict(X *dataframe.DataFrame) (*seriesPkg.Series[any], error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type KMeans ¶
type KMeans struct {
// NClusters is the number of clusters (K)
NClusters int
// MaxIter is the maximum number of iterations
MaxIter int
// Tol is the convergence tolerance
Tol float64
// Init specifies initialization method: "k-means++" or "random"
Init string
// Seed for random number generator
Seed int64
// contains filtered or unexported fields
}
KMeans implements the K-Means clustering algorithm. Partitions data into K clusters by minimizing within-cluster variance.
func (*KMeans) FitPredict ¶
FitPredict fits the model and returns cluster labels.
Click to show internal directories.
Click to hide internal directories.