Skip to content

TrainTestSplit should be inside MLContext.Data #2337

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
artidoro opened this issue Jan 30, 2019 · 1 comment · Fixed by #2907
Closed

TrainTestSplit should be inside MLContext.Data #2337

artidoro opened this issue Jan 30, 2019 · 1 comment · Fixed by #2907
Assignees
Labels
API Issues pertaining the friendly API usability Smoothing user interaction or experience
Milestone

Comments

@artidoro
Copy link
Contributor

artidoro commented Jan 30, 2019

Currently TrainTestSplit can be found in the various training tasks in MLContext:

// Split the data 90:10 into train and test sets, train and evaluate.
var (trainData, testData) = mlContext.MulticlassClassification.TrainTestSplit(data, testFraction: 0.1);

Since that is a data operation that only involves splitting data and since it is independent on the training task, it would make more sense to have it in mlContext.Data. The previous line would look like:

var (trainData, testData) = mlContext.Data.TrainTestSplit(data, testFraction: 0.1);
@artidoro artidoro added API Issues pertaining the friendly API usability Smoothing user interaction or experience labels Jan 30, 2019
@TomFinley
Copy link
Contributor

since it is independent on the training task,

Well, not exactly. In the case of ranking, for example, it is critical that the split be stratified on a sort of group ID. But we might consider that we expect that having the stratification is an option, and if someone doesn't realize stratification is important for a task like ranking, well... that's just too bad.

But I would at least be aware of this issue.

Also this does imply a breaking change, so I'm adding it to Project 13.

@ganik ganik self-assigned this Feb 19, 2019
@shauheen shauheen added this to the 0219 milestone Feb 20, 2019
@shauheen shauheen modified the milestones: 0219, 0319 Mar 5, 2019
@ghost ghost locked as resolved and limited conversation to collaborators Mar 25, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
API Issues pertaining the friendly API usability Smoothing user interaction or experience
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants