Created
April 19, 2015 15:12
-
-
Save nivdul/246dbe803a2345b7bf5b to your computer and use it in GitHub Desktop.
Split data sets
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Split data into 2 sets : training (60%) and test (40%). | |
JavaRDD<LabeledPoint>[] splits = data.randomSplit(new double[]{0.6, 0.4}); | |
JavaRDD<LabeledPoint> trainingData = splits[0].cache(); | |
JavaRDD<LabeledPoint> testData = splits[1]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment