Hello everyone,
I am trying to run a simple prediction model and save the result in the original dataframe. When first running the regression, it works, yet after accessing the h2o and predicting the class probabilities, I instead receive a "no observations r(2000)". A quick look tells me that the variables still exist and that a probability column was added. The code itself is only a slight modification of the example code.
----
h2o clear
use "$temp\Pre_reg", clear
gen d_time = (time_tuli > 90)
label define dtime 0 "Short Stay" 1 "Long Stay"
label values d_time dtime
reg age pre_20
_h2oframe put, into(auto)
_h2oframe change auto
_h2oframe split auto, into(train valid) split(0.8 0.2) rseed(19)
_h2oframe change train
global predictors sexe age
h2oml rfbinclass d_time $predictors, ///
cv(2) h2orseed(123) ///
ntrees(100) maxdepth(6) ///
balanceclasses minobsleaf(5)
_h2oframe change auto
h2omlpredict foreignhat_tpr, pr
clear
_h2oframe get auto
reg age pre_20
----
Thanks in advance for your help!
Best,
Gregor
I am trying to run a simple prediction model and save the result in the original dataframe. When first running the regression, it works, yet after accessing the h2o and predicting the class probabilities, I instead receive a "no observations r(2000)". A quick look tells me that the variables still exist and that a probability column was added. The code itself is only a slight modification of the example code.
----
h2o clear
use "$temp\Pre_reg", clear
gen d_time = (time_tuli > 90)
label define dtime 0 "Short Stay" 1 "Long Stay"
label values d_time dtime
reg age pre_20
_h2oframe put, into(auto)
_h2oframe change auto
_h2oframe split auto, into(train valid) split(0.8 0.2) rseed(19)
_h2oframe change train
global predictors sexe age
h2oml rfbinclass d_time $predictors, ///
cv(2) h2orseed(123) ///
ntrees(100) maxdepth(6) ///
balanceclasses minobsleaf(5)
_h2oframe change auto
h2omlpredict foreignhat_tpr, pr
clear
_h2oframe get auto
reg age pre_20
----
Thanks in advance for your help!
Best,
Gregor
Comment