d1.model.horseRace <- function(x,y,training,testSet){
h2o.init()
training = as.h2o(training)
testSet = as.h2o(testSet)
#h2o.gbm
gbm=list()
gbm$model= h2o.gbm(y=y,
x=x,
training_frame=training,
validation_frame=testSet)
preds.gbm = h2o.predict(gbm$model,testSet)
actual = eval(parse(text=paste("testSet",y,sep="")))
predicted = as.vector(preds.gbm)
gbm$cor = d1.stat.cor(predicted,actual)
gbm$mse = d1.stat.MSE(actual,preds.gbm)
gbm$hit = d1.stat.hit(predicted,actual)
gbm$huber = d1.stat.huber(predicted,actual)
gbm$rwMse = d1.stat.MSE(actual,0* preds.gbm *0)
gbm$rwHuber = d1.stat.huber(0* predicted *0,actual)
#DL
dl=list()
dl$model= h2o.deeplearning(y=y,
x=x,
training_frame=training,
validation_frame=testSet)
preds.dl = h2o.predict(dl$model,testSet)
actual = eval(parse(text=paste("testSet",y,sep="")))
predicted = as.vector(preds.dl)
dl$cor = d1.stat.cor(predicted,actual)
dl$mse = d1.stat.MSE(actual,preds.dl)
dl$hit = d1.stat.hit(predicted,actual)
dl$huber = d1.stat.huber(predicted,actual)
dl$rwMse = d1.stat.MSE(actual,0* preds.dl *0)
dl$rwHuber = d1.stat.huber(0* predicted *0,actual)
#bagged trees
#chart MSE
#chart Cor
#Chart Hit
# Chart Backtest
return(list(gbm = gbm,
))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.