ctrace2

package
v0.0.0-...-f1eeddb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 24, 2024 License: BSD-3-Clause Imports: 4 Imported by: 1

Documentation

Overview

ctrace makes Traces into ClusterableTraces which can then be used in kmeans.

Index

Constants

View Source
const (
	// CENTROID_KEY is the name for the centroid when it appears as a trace in a DataFrame.
	CENTROID_KEY = "special_centroid"
)

Variables

This section is empty.

Functions

func CalculateCentroid

func CalculateCentroid(members []kmeans.Clusterable) kmeans.Centroid

CalculateCentroid implements kmeans.CalculateCentroid.

Types

type ClusterableTrace

type ClusterableTrace struct {
	Key    string
	Values []float32
}

ClusterableTrace contains Trace data and implements kmeans.Clusterable and kmeans.Centroid.

func NewFullTrace

func NewFullTrace(key string, values []float32, minStdDev float32) *ClusterableTrace

NewFullTrace takes data you would find in a Trace and returns a ClusterableTrace usable for kmeans clustering.

func (*ClusterableTrace) AsClusterable

func (t *ClusterableTrace) AsClusterable() kmeans.Clusterable

See kmeans.Centroid.

func (*ClusterableTrace) Distance

func (t *ClusterableTrace) Distance(c kmeans.Clusterable) float64

See kmeans.Centroid.

func (*ClusterableTrace) Dup

func (t *ClusterableTrace) Dup(newKey string) *ClusterableTrace

func (*ClusterableTrace) String

func (t *ClusterableTrace) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL