Skip to content
time-series clustering implemented in Go
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
examples
.gitignore
LICENSE
README.md
distance.go
kmedoids.go
tscluster.go
utils.go

README.md

tscluster

tscluster is time-series clustering implemented in Go.

Usage

Installation

$ go get github.com/tsurubee/tscluster

Example

func main() {
	var dataset [][]float64
	dataset = append(dataset, []float64{1, 1, 1, 1, 1, 1})
	dataset = append(dataset, []float64{1, 1, 1, 1, 1, 1, 1})
	dataset = append(dataset, []float64{2, 2, 2, 2, 2})
	dataset = append(dataset, []float64{2, 2, 2, 2, 2, 2, 2})

	tc := tscluster.NewTscluster(tscluster.DTW)
	labels, err := tc.Kmedoids(dataset, 2, 20)
	if err != nil {
	log.Fatal(err)
	}
	fmt.Println(labels)
}

#=>
[0 0 2 2]

It returns the label of the result of clustering on the given data array.
The numerical value of the label returns the index number of medoid of the cluster to which the data belongs.

License

MIT

Author

tsurubee

You can’t perform that action at this time.