forked from h2oai/h2o-2
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:0xdata/h2o
- Loading branch information
Showing
10 changed files
with
188 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
setwd(normalizePath(dirname(R.utils::commandArgs(asValues=TRUE)$"-f"))) | ||
source('../findNSourceUtils.R') | ||
|
||
test.gbmMSEgauss.golden <- function(H2Oserver) { | ||
|
||
#Import data: | ||
Log.info("Importing smtrees data...") | ||
smtreesH2O<- h2o.uploadFile(H2Oserver, locate("../../smalldata/smtrees.csv"), key="smtreesH2O") | ||
smtreesR<- read.csv(locate("../../smalldata/smtrees.csv")) | ||
|
||
#Log.info("Test H2O generation of MSE for GBM") | ||
fith2o<- h2o.gbm(x=c("girth", "height"), y="vol", n.trees=10, interaction.depth=1, distribution="gaussian", n.minobsinnode=2, shrinkage=.1, data=smtreesH2O) | ||
|
||
#Reported MSE from H2O through R | ||
err<- as.data.frame(fith2o@model$err) | ||
REPMSE<- err[11,] | ||
|
||
#MSE Calculated by hand From H2O predicted values | ||
pred<- as.data.frame(h2o.predict(fith2o, newdata=smtreesH2O)) | ||
diff<- pred-smtreesR[,4] | ||
diff<- diff[-1,] | ||
diffsq<- diff^2 | ||
EXPMSE<- mean(diffsq) | ||
|
||
Log.info("Print model MSE... \n") | ||
Log.info(paste("Length of H2O MSE Vec: ", length(fith2o@model$err), "\t\t", "Expected Length : ", 10)) | ||
Log.info(paste("H2O Reported MSE : ", REPMSE, "\t\t", "R Expected MSE : ", EXPMSE)) | ||
|
||
Log.info("Compare model statistics in R to model statistics in H2O") | ||
expect_equal(length(fith2o@model$err), 10) | ||
expect_equal(REPMSE, EXPMSE, tolerance = 0.01) | ||
|
||
testEnd() | ||
} | ||
|
||
doTest("GBM Test: Golden GBM - MSE for GBM Regression", test.gbmMSEgauss.golden) | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
"","girth","height","vol" | ||
"1",17.9,85,51.5 | ||
"2",14.2,83,21.4 | ||
"3",8.6,70,15.6 | ||
"4",11.7,82,77 | ||
"5",20.6,81,24.2 | ||
"6",8.3,77,42.6 | ||
"7",18,78,24.9 | ||
"8",18,81,55.7 | ||
"9",16,76,31.7 | ||
"10",17.3,80,21 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.