August 2017
Beginner to intermediate
340 pages
8h 42m
English
As with most supervised learning tasks, we will create a split in our dataset so that we teach a model on one subset and then test its ability to generalize on new data against the holdout set. For the purposes of this example, we split the data 80/20 but there is no hard rule on what the ratio for a split should be - or for that matter - how many splits there should be in the first place:
// Create Train & Test Splits val trainTestSplits = higgs.randomSplit(Array(0.8, 0.2)) val (trainingData, testData) = (trainTestSplits(0), trainTestSplits(1))
By creating our 80/20 split on the dataset, we are taking a random sample of 8.8 million examples as our training set and the remaining 2.2 million as our testing ...
Read now
Unlock full access