Skip to content

Commit ea0f94a

Browse files
committed
Updated README to include missing results
1 parent 26099a2 commit ea0f94a

1 file changed

Lines changed: 26 additions & 2 deletions

File tree

tutorials/ensembles-stacking/README.md

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -344,10 +344,30 @@ fit <- h2o.ensemble(x = x, y = y,
344344
cvControl = list(V = 5))
345345

346346
perf <- h2o.ensemble_performance(fit, newdata = test)
347-
perf
348347
```
349348

350-
We actually lose performance by removing the weak learners! This demonstrates the power of stacking.
349+
We actually lose ensemble performance by removing the weak learners! This demonstrates the power of stacking with a large and diverse set of base learners.
350+
351+
352+
```r
353+
> perf
354+
355+
Base learner performance, sorted by specified metric:
356+
learner AUC
357+
1 h2o.randomForest.1 0.7668024
358+
2 h2o.randomForest.2 0.7697849
359+
3 h2o.gbm.1 0.7751240
360+
5 h2o.gbm.8 0.7752852
361+
4 h2o.gbm.6 0.7771115
362+
363+
364+
H2O Ensemble Performance on <newdata>:
365+
----------------
366+
Family: binomial
367+
368+
Ensemble performance (AUC): 0.778853964308554
369+
370+
```
351371

352372
At first thought, you may assume that removing less performant models would increase the perforamnce of the ensemble. However, each learner has it's own unique contribution to the ensemble and the added diversity among learners usually improves performance. The Super Learner algorithm learns the optimal way of combining all these learners together in a way that is superior to other combination/blending methods.
353373

@@ -372,8 +392,12 @@ family <- "binomial"
372392
#For binary classification, response should be a factor
373393
train[,y] <- as.factor(train[,y])
374394
test[,y] <- as.factor(test[,y])
395+
```
375396

376397

398+
Cross-validate and train a handful of base learners and then use the `h2o.stack()` function to create the ensemble:
399+
400+
```r
377401
# The h2o.stack function is an alternative to the h2o.ensemble function, which
378402
# allows the user to specify H2O models individually and then stack them together
379403
# at a later time. Saved models, re-loaded from disk, can also be stacked.

0 commit comments

Comments
 (0)