I think we can port this to https://github.com/sjwhitworth/golearn/blob/master/cross_validation/cross_validation.go#L39