January 2018
Intermediate to advanced
470 pages
11h 9m
English
Up to this point, our DataFrame (that is, t4) is in Spark DataFrame. But it cannot be consumed by the H2O model. So, we have to convert it to an H2O frame. So let's do it:
val creditcard_hf: H2OFrame = h2oContext.asH2OFrame(t4.orderBy(rand()))
We split the dataset to, say, 40% supervised training, 40% unsupervised training, and 20% test using H2O built-in splitter called FrameSplitter:
val sf = new FrameSplitter(creditcard_hf, Array(.4, .4), Array("train_unsupervised", "train_supervised", "test") .map(Key.make[Frame](_)), null)water.H2O.submitTask(sf)val splits = sf.getResultval (train_unsupervised, train_supervised, test) = (splits(0), splits(1), splits(2))
In the above code segment, Key.make[Frame](_) ...
Read now
Unlock full access