Documentation
¶
Index ¶
- func LabelCount(labels []int, k int) []int
- type KMeans
- func (kmeans *KMeans) AddPoint(point Point)
- func (kmeans *KMeans) AddPointList(points []Point)
- func (kmeans *KMeans) CentroidsToString() string
- func (kmeans *KMeans) ComputeLabels() []int
- func (kmeans *KMeans) ComputeSSE() float64
- func (kmeans *KMeans) Fit(pointList []Point) bool
- func (kmeans *KMeans) GetPointIdxOfCentroid(centroidIdx int) []int
- func (kmeans *KMeans) InitCentroids() bool
- func (kmeans *KMeans) LabelCount() []int
- func (kmeans *KMeans) LabelsToString() string
- func (kmeans *KMeans) PointsToString() string
- type Point
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LabelCount ¶ added in v0.1.2
LabelCount - Returns the number of points per centroid
Types ¶
type KMeans ¶
type KMeans struct {
// contains filtered or unexported fields
}
KMeans - Struct for KMeans Algorithm
func (*KMeans) AddPoint ¶ added in v0.1.2
AddPoint - Add a new Point to the list and recalculate centroids
func (*KMeans) AddPointList ¶ added in v0.1.2
AddPointList - Add a list of Points to the list and recalculate centroids
func (*KMeans) CentroidsToString ¶ added in v0.1.2
CentroidsToString - returns the string of centroids
func (*KMeans) ComputeLabels ¶ added in v0.1.2
ComputeLabels - Computes labels of the points
func (*KMeans) ComputeSSE ¶ added in v0.1.2
ComputeSSE - computes Sum of Squared Erros
func (*KMeans) GetPointIdxOfCentroid ¶ added in v0.1.2
GetPointIdxOfCentroid - return indexes of points of a certain centroid
func (*KMeans) InitCentroids ¶ added in v0.1.2
InitCentroids - Inits the Centroids for random
func (*KMeans) LabelCount ¶ added in v0.1.2
LabelCount - Returns the number of points per centroid
func (*KMeans) LabelsToString ¶ added in v0.1.2
LabelsToString - Returns the string of Labels
func (*KMeans) PointsToString ¶ added in v0.1.2
PointsToString - Returns the String of the Points
type Point ¶
type Point []float64
Point - Slice of Float64 Values
func ComputeCentroids ¶ added in v0.1.2
ComputeCentroids - Recalculates centroids position
func (Point) PointEqual ¶ added in v0.1.2
PointEqual - Checks if a point is equal to another