sjwhitworth / golearn

Machine Learning for Go
MIT License
9.28k stars 1.19k forks source link

data normalization #179

Open frozenkp opened 7 years ago

frozenkp commented 7 years ago

Is there any way to normalize data with golearn? If so, how can I do it?

Sentimentron commented 7 years ago

For anybody else that comes across this issue, it's possible I think (?) with the https://godoc.org/github.com/sjwhitworth/golearn/base#Filter and the https://godoc.org/github.com/sjwhitworth/golearn/base#LazilyFilteredInstances type. Basically, you create a function which takes a []byte, unpacks it to float64, transforms it, and then returns a float64 marshalled back as a []byte. In terms of standard scaling etc, we don't have any utility functions which can do this at the moment.