Skip to content

mjanda/go-dtw

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

DTW

Dynamic time warping in golang

ported from https://github.com/langholz/dtw

Usage

// prepare arrays
a := []float64{1, 1, 1, 2, 2, 2, 3, 3, 3, 2, 2, 4, 4, 4, 4}
b := []float64{1, 1, 2, 2, 3, 3, 2, 4, 4, 4}

dtw := dtw.Dtw{}

// optionally set your own distance function
dtw.DistanceFunction = func(x float64, y float64) float64 {
    difference := x - y
    return math.Sqrt(difference * difference)
}
dtw.ComputeOptimalPathWithWindow(a, b, 5) // 5 = window size
path := dtw.RetrieveOptimalPath()

TODO

Fast / sparse DTW would be nice...PRs welcome

About

Dynamic Time Warp in Golang

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages