https://github.com/tsurubee/tscluster
time-series clustering implemented in Go
https://github.com/tsurubee/tscluster
clustering data-science golang machine-learning time-series
Last synced: 4 months ago
JSON representation
time-series clustering implemented in Go
- Host: GitHub
- URL: https://github.com/tsurubee/tscluster
- Owner: tsurubee
- License: mit
- Created: 2019-02-11T06:03:57.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-02-17T06:57:13.000Z (over 7 years ago)
- Last Synced: 2025-12-18T09:25:16.815Z (7 months ago)
- Topics: clustering, data-science, golang, machine-learning, time-series
- Language: Go
- Homepage:
- Size: 11.7 KB
- Stars: 2
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# tscluster
tscluster is time-series clustering implemented in Go.
## Usage
### Installation
```
$ go get github.com/tsurubee/tscluster
```
### Example
```go
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](https://github.com/tsurubee/tscluster/blob/master/LICENSE)
## Author
[tsurubee](https://github.com/tsurubee)