Github user feynmanliang commented on the pull request:
https://github.com/apache/spark/pull/7337#issuecomment-120479329
`CrossValidator` currently doesn't take `numFolds = 1` because it uses
`MLUtils#kfolds` which does splits using `trainRatio = 1 - 1/numFolds`, which
in this case would mean nothing goes into the training set.
If we give a `trainRatio` param to `CrossValidator` and modify
`MLUtils#kfold` accordingly, then each fold could be split using your set
`trainRatio` so setting `numFolds = 1, trainRatio = x` would achieve the same
functionality as `TrainValidationSplit` with `trainRatio = x`.
Note that in this case we would have to change the default `trainRatio = 1
- 1/numFolds` behavior for the special case `numFolds = 1` to avoid the error
case described in my first paragraph.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]