* setup_metrics.do -- the three-frame metrics quoted in the "Setting up the H2O * frames" section of the blog. * * Same construction and same model as figures.do, which produced figure 1. clear all set more off set seed 20260729 set obs 4000 gen double x1 = runiform(-3,3) gen double x2 = rnormal() gen double x3 = 0.9*x2 + sqrt(1-0.9^2)*rnormal() gen double x4 = runiform(-2,2) gen byte g = runiform()<0.5 gen double x5 = runiform() gen byte x6 = runiform()<0.5 gen double y = 4*sin(1.5*x1) + 2*x2 + 3*x4*(2*g-1) + rnormal(0,1.5) h2o init _h2oframe put, into(all) _h2oframe split all, into(train valid test) split(0.6 0.2 0.2) rseed(19) _h2oframe change train quietly h2oml gbregress y x1 x2 x3 x4 g x5 x6, validframe(valid) /// ntrees(500) maxdepth(12) minobsleaf(1) lrate(0.1) h2orseed(19) di _n "===== TRAINING =====" h2omlpostestframe _train h2omlestat metrics di _n "===== VALIDATION =====" h2omlpostestframe valid h2omlestat metrics di "----setup_metrics.do successful----"