{"action":"created","comment":{"url":"https://api.github.com/repos/h2oai/h2o-3/pulls/comments/165457515","pull_request_review_id":93401199,"id":165457515,"diff_hunk":"@@ -0,0 +1,119 @@\n+setwd(normalizePath(dirname(R.utils::commandArgs(asValues=TRUE)$\"f\")))\n+source(\"../../../scripts/h2o-r-test-setup.R\")\n+\n+stackedensemble.custom.metalearner.test <- function() {\n+\n+    # This test checks the following (for binomial classification):\n+    #\n+    # 1) That h2o.stackedEnsemble `metalearner_algorithm` and `metalearner_params` work correctly\n+    # 2) That h2o.stackedEnsemble `metalearner_algorithm` works in concert with `metalearner_nfolds`\n+\n+\n+    train <- h2o.uploadFile(locate(\"smalldata/testng/higgs_train_5k.csv\"),\n+    destination_frame = \"higgs_train_5k\")\n+    test <- h2o.uploadFile(locate(\"smalldata/testng/higgs_test_5k.csv\"),\n+    destination_frame = \"higgs_test_5k\")\n+    y <- \"response\"\n+    x <- setdiff(names(train), y)\n+    train[,y] <- as.factor(train[,y])\n+    test[,y] <- as.factor(test[,y])\n+    nfolds <- 3  #number of folds for base learners\n+\n+    #Metalearner params for gbm, drf, glm, and deep deeplearning\n+    gbm_params <- list(ntrees=100, max_depth = 6)\n+    drf_params <- list(ntrees=100, max_depth = 6)\n+    glm_params <- list(alpha=0, lambda=0)\n+    dl_params  <- list(hidden=c(32,32,32), epochs = 20) ## small network, runs faster\n+\n+\n+    # Train & Cross-validate a GBM\n+    my_gbm <- h2o.gbm(x = x,","path":"h2o-r/tests/testdir_algos/stackedensemble/runit_stackedensemble_custom_metalearner_params.R","position":30,"original_position":30,"commit_id":"93a577c5c3e1c3032da71c740782a51cb4b3dde9","original_commit_id":"0c73780c04e926142b97f7234b915ee690b026f5","user":{"login":"navdeep-G","id":10055668,"avatar_url":"https://avatars2.githubusercontent.com/u/10055668?v=4","gravatar_id":"","url":"https://api.github.com/users/navdeep-G","html_url":"https://github.com/navdeep-G","followers_url":"https://api.github.com/users/navdeep-G/followers","following_url":"https://api.github.com/users/navdeep-G/following{/other_user}","gists_url":"https://api.github.com/users/navdeep-G/gists{/gist_id}","starred_url":"https://api.github.com/users/navdeep-G/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/navdeep-G/subscriptions","organizations_url":"https://api.github.com/users/navdeep-G/orgs","repos_url":"https://api.github.com/users/navdeep-G/repos","events_url":"https://api.github.com/users/navdeep-G/events{/privacy}","received_events_url":"https://api.github.com/users/navdeep-G/received_events","type":"User","site_admin":false},"body":"This is done","created_at":"2018-02-01T19:10:50Z","updated_at":"2018-02-01T19:10:50Z","html_url":"https://github.com/h2oai/h2o-3/pull/1993#discussion_r165457515","pull_request_url":"https://api.github.com/repos/h2oai/h2o-3/pulls/1993","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/h2oai/h2o-3/pulls/comments/165457515"},"html":{"href":"https://github.com/h2oai/h2o-3/pull/1993#discussion_r165457515"},"pull_request":{"href":"https://api.github.com/repos/h2oai/h2o-3/pulls/1993"}},"in_reply_to_id":165286216},"pull_request":{"url":"https://api.github.com/repos/h2oai/h2o-3/pulls/1993","id":165851917,"html_url":"https://github.com/h2oai/h2o-3/pull/1993","diff_url":"https://github.com/h2oai/h2o-3/pull/1993.diff","patch_url":"https://github.com/h2oai/h2o-3/pull/1993.patch","issue_url":"https://api.github.com/repos/h2oai/h2o-3/issues/1993","number":1993,"state":"open","locked":false,"title":"PUBDEV-5086 Stacked Ensemble should allow user to pass in a customized metalearner","user":{"login":"navdeep-G","id":10055668,"avatar_url":"https://avatars2.githubusercontent.com/u/10055668?v=4","gravatar_id":"","url":"https://api.github.com/users/navdeep-G","html_url":"https://github.com/navdeep-G","followers_url":"https://api.github.com/users/navdeep-G/followers","following_url":"https://api.github.com/users/navdeep-G/following{/other_user}","gists_url":"https://api.github.com/users/navdeep-G/gists{/gist_id}","starred_url":"https://api.github.com/users/navdeep-G/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/navdeep-G/subscriptions","organizations_url":"https://api.github.com/users/navdeep-G/orgs","repos_url":"https://api.github.com/users/navdeep-G/repos","events_url":"https://api.github.com/users/navdeep-G/events{/privacy}","received_events_url":"https://api.github.com/users/navdeep-G/received_events","type":"User","site_admin":false},"body":"* Added customized metalearner for stacked ensembles.\r\n* User passes in a dictionary/list of parameters to the argument `metalearner_params`, which are passed to `metalearner_algorithm`.\r\n* Example in R: \r\n```\r\n#Metalearner params for gbm\r\ngbm_params <- list(ntrees=100, max_depth = 6)\r\nstack_gbm <- h2o.stackedEnsemble(x = x,\r\n    y = y,\r\n    training_frame = train,\r\n    base_models = list(my_gbm, my_rf),\r\n    metalearner_algorithm = \"gbm\",\r\n    metalearner_params = gbm_params)\r\n```\r\n* Example in Python:\r\n```\r\ngbm_params = {\"ntrees\" : 100, \"max_depth\" : 6}\r\nstack_gbm = H2OStackedEnsembleEstimator(base_models=[my_gbm, my_rf], \r\n                                            metalearner_algorithm=\"gbm\",\r\n                                            metalearner_params = gbm_params)\r\n```\r\n* Note, the field `metalearner_params` is a `String` field in Java. I convert the string to a map which gets processed in the SE impl.\r\n* Added a Metalearner class to store all compute methods for metalearners","created_at":"2018-01-29T23:57:37Z","updated_at":"2018-02-01T19:10:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"44dd3499be0c2f592590a9a1e39d38de2f827164","assignee":{"login":"navdeep-G","id":10055668,"avatar_url":"https://avatars2.githubusercontent.com/u/10055668?v=4","gravatar_id":"","url":"https://api.github.com/users/navdeep-G","html_url":"https://github.com/navdeep-G","followers_url":"https://api.github.com/users/navdeep-G/followers","following_url":"https://api.github.com/users/navdeep-G/following{/other_user}","gists_url":"https://api.github.com/users/navdeep-G/gists{/gist_id}","starred_url":"https://api.github.com/users/navdeep-G/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/navdeep-G/subscriptions","organizations_url":"https://api.github.com/users/navdeep-G/orgs","repos_url":"https://api.github.com/users/navdeep-G/repos","events_url":"https://api.github.com/users/navdeep-G/events{/privacy}","received_events_url":"https://api.github.com/users/navdeep-G/received_events","type":"User","site_admin":false},"assignees":[{"login":"navdeep-G","id":10055668,"avatar_url":"https://avatars2.githubusercontent.com/u/10055668?v=4","gravatar_id":"","url":"https://api.github.com/users/navdeep-G","html_url":"https://github.com/navdeep-G","followers_url":"https://api.github.com/users/navdeep-G/followers","following_url":"https://api.github.com/users/navdeep-G/following{/other_user}","gists_url":"https://api.github.com/users/navdeep-G/gists{/gist_id}","starred_url":"https://api.github.com/users/navdeep-G/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/navdeep-G/subscriptions","organizations_url":"https://api.github.com/users/navdeep-G/orgs","repos_url":"https://api.github.com/users/navdeep-G/repos","events_url":"https://api.github.com/users/navdeep-G/events{/privacy}","received_events_url":"https://api.github.com/users/navdeep-G/received_events","type":"User","site_admin":false}],"requested_reviewers":[{"login":"mmalohlava","id":597582,"avatar_url":"https://avatars3.githubusercontent.com/u/597582?v=4","gravatar_id":"","url":"https://api.github.com/users/mmalohlava","html_url":"https://github.com/mmalohlava","followers_url":"https://api.github.com/users/mmalohlava/followers","following_url":"https://api.github.com/users/mmalohlava/following{/other_user}","gists_url":"https://api.github.com/users/mmalohlava/gists{/gist_id}","starred_url":"https://api.github.com/users/mmalohlava/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mmalohlava/subscriptions","organizations_url":"https://api.github.com/users/mmalohlava/orgs","repos_url":"https://api.github.com/users/mmalohlava/repos","events_url":"https://api.github.com/users/mmalohlava/events{/privacy}","received_events_url":"https://api.github.com/users/mmalohlava/received_events","type":"User","site_admin":false},{"login":"michalkurka","id":20690218,"avatar_url":"https://avatars2.githubusercontent.com/u/20690218?v=4","gravatar_id":"","url":"https://api.github.com/users/michalkurka","html_url":"https://github.com/michalkurka","followers_url":"https://api.github.com/users/michalkurka/followers","following_url":"https://api.github.com/users/michalkurka/following{/other_user}","gists_url":"https://api.github.com/users/michalkurka/gists{/gist_id}","starred_url":"https://api.github.com/users/michalkurka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michalkurka/subscriptions","organizations_url":"https://api.github.com/users/michalkurka/orgs","repos_url":"https://api.github.com/users/michalkurka/repos","events_url":"https://api.github.com/users/michalkurka/events{/privacy}","received_events_url":"https://api.github.com/users/michalkurka/received_events","type":"User","site_admin":false}],"requested_teams":[],"milestone":null,"commits_url":"https://api.github.com/repos/h2oai/h2o-3/pulls/1993/commits","review_comments_url":"https://api.github.com/repos/h2oai/h2o-3/pulls/1993/comments","review_comment_url":"https://api.github.com/repos/h2oai/h2o-3/pulls/comments{/number}","comments_url":"https://api.github.com/repos/h2oai/h2o-3/issues/1993/comments","statuses_url":"https://api.github.com/repos/h2oai/h2o-3/statuses/93a577c5c3e1c3032da71c740782a51cb4b3dde9","head":{"label":"h2oai:NG/custom-metalearner","ref":"NG/custom-metalearner","sha":"93a577c5c3e1c3032da71c740782a51cb4b3dde9","user":{"login":"h2oai","id":1402695,"avatar_url":"https://avatars2.githubusercontent.com/u/1402695?v=4","gravatar_id":"","url":"https://api.github.com/users/h2oai","html_url":"https://github.com/h2oai","followers_url":"https://api.github.com/users/h2oai/followers","following_url":"https://api.github.com/users/h2oai/following{/other_user}","gists_url":"https://api.github.com/users/h2oai/gists{/gist_id}","starred_url":"https://api.github.com/users/h2oai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/h2oai/subscriptions","organizations_url":"https://api.github.com/users/h2oai/orgs","repos_url":"https://api.github.com/users/h2oai/repos","events_url":"https://api.github.com/users/h2oai/events{/privacy}","received_events_url":"https://api.github.com/users/h2oai/received_events","type":"Organization","site_admin":false},"repo":{"id":17371412,"name":"h2o-3","full_name":"h2oai/h2o-3","owner":{"login":"h2oai","id":1402695,"avatar_url":"https://avatars2.githubusercontent.com/u/1402695?v=4","gravatar_id":"","url":"https://api.github.com/users/h2oai","html_url":"https://github.com/h2oai","followers_url":"https://api.github.com/users/h2oai/followers","following_url":"https://api.github.com/users/h2oai/following{/other_user}","gists_url":"https://api.github.com/users/h2oai/gists{/gist_id}","starred_url":"https://api.github.com/users/h2oai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/h2oai/subscriptions","organizations_url":"https://api.github.com/users/h2oai/orgs","repos_url":"https://api.github.com/users/h2oai/repos","events_url":"https://api.github.com/users/h2oai/events{/privacy}","received_events_url":"https://api.github.com/users/h2oai/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/h2oai/h2o-3","description":"Open Source Fast Scalable Machine Learning Platform For Smarter Applications (Deep Learning, Gradient Boosting, Random Forest, Generalized Linear Modeling (Logistic Regression, Elastic Net), K-Means, PCA, Stacked Ensembles, Automatic Machine Learning (AutoML), ...)","fork":false,"url":"https://api.github.com/repos/h2oai/h2o-3","forks_url":"https://api.github.com/repos/h2oai/h2o-3/forks","keys_url":"https://api.github.com/repos/h2oai/h2o-3/keys{/key_id}","collaborators_url":"https://api.github.com/repos/h2oai/h2o-3/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/h2oai/h2o-3/teams","hooks_url":"https://api.github.com/repos/h2oai/h2o-3/hooks","issue_events_url":"https://api.github.com/repos/h2oai/h2o-3/issues/events{/number}","events_url":"https://api.github.com/repos/h2oai/h2o-3/events","assignees_url":"https://api.github.com/repos/h2oai/h2o-3/assignees{/user}","branches_url":"https://api.github.com/repos/h2oai/h2o-3/branches{/branch}","tags_url":"https://api.github.com/repos/h2oai/h2o-3/tags","blobs_url":"https://api.github.com/repos/h2oai/h2o-3/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/h2oai/h2o-3/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/h2oai/h2o-3/git/refs{/sha}","trees_url":"https://api.github.com/repos/h2oai/h2o-3/git/trees{/sha}","statuses_url":"https://api.github.com/repos/h2oai/h2o-3/statuses/{sha}","languages_url":"https://api.github.com/repos/h2oai/h2o-3/languages","stargazers_url":"https://api.github.com/repos/h2oai/h2o-3/stargazers","contributors_url":"https://api.github.com/repos/h2oai/h2o-3/contributors","subscribers_url":"https://api.github.com/repos/h2oai/h2o-3/subscribers","subscription_url":"https://api.github.com/repos/h2oai/h2o-3/subscription","commits_url":"https://api.github.com/repos/h2oai/h2o-3/commits{/sha}","git_commits_url":"https://api.github.com/repos/h2oai/h2o-3/git/commits{/sha}","comments_url":"https://api.github.com/repos/h2oai/h2o-3/comments{/number}","issue_comment_url":"https://api.github.com/repos/h2oai/h2o-3/issues/comments{/number}","contents_url":"https://api.github.com/repos/h2oai/h2o-3/contents/{+path}","compare_url":"https://api.github.com/repos/h2oai/h2o-3/compare/{base}...{head}","merges_url":"https://api.github.com/repos/h2oai/h2o-3/merges","archive_url":"https://api.github.com/repos/h2oai/h2o-3/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/h2oai/h2o-3/downloads","issues_url":"https://api.github.com/repos/h2oai/h2o-3/issues{/number}","pulls_url":"https://api.github.com/repos/h2oai/h2o-3/pulls{/number}","milestones_url":"https://api.github.com/repos/h2oai/h2o-3/milestones{/number}","notifications_url":"https://api.github.com/repos/h2oai/h2o-3/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/h2oai/h2o-3/labels{/name}","releases_url":"https://api.github.com/repos/h2oai/h2o-3/releases{/id}","deployments_url":"https://api.github.com/repos/h2oai/h2o-3/deployments","created_at":"2014-03-03T16:08:07Z","updated_at":"2018-02-01T10:22:28Z","pushed_at":"2018-02-01T19:09:46Z","git_url":"git://github.com/h2oai/h2o-3.git","ssh_url":"git@github.com:h2oai/h2o-3.git","clone_url":"https://github.com/h2oai/h2o-3.git","svn_url":"https://github.com/h2oai/h2o-3","homepage":"http://h2o.ai","size":383277,"stargazers_count":2820,"watchers_count":2820,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1112,"mirror_url":null,"archived":false,"open_issues_count":59,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":1112,"open_issues":59,"watchers":2820,"default_branch":"master"}},"base":{"label":"h2oai:master","ref":"master","sha":"88884c29dad45a981945298cb39e76bcf0f0ec22","user":{"login":"h2oai","id":1402695,"avatar_url":"https://avatars2.githubusercontent.com/u/1402695?v=4","gravatar_id":"","url":"https://api.github.com/users/h2oai","html_url":"https://github.com/h2oai","followers_url":"https://api.github.com/users/h2oai/followers","following_url":"https://api.github.com/users/h2oai/following{/other_user}","gists_url":"https://api.github.com/users/h2oai/gists{/gist_id}","starred_url":"https://api.github.com/users/h2oai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/h2oai/subscriptions","organizations_url":"https://api.github.com/users/h2oai/orgs","repos_url":"https://api.github.com/users/h2oai/repos","events_url":"https://api.github.com/users/h2oai/events{/privacy}","received_events_url":"https://api.github.com/users/h2oai/received_events","type":"Organization","site_admin":false},"repo":{"id":17371412,"name":"h2o-3","full_name":"h2oai/h2o-3","owner":{"login":"h2oai","id":1402695,"avatar_url":"https://avatars2.githubusercontent.com/u/1402695?v=4","gravatar_id":"","url":"https://api.github.com/users/h2oai","html_url":"https://github.com/h2oai","followers_url":"https://api.github.com/users/h2oai/followers","following_url":"https://api.github.com/users/h2oai/following{/other_user}","gists_url":"https://api.github.com/users/h2oai/gists{/gist_id}","starred_url":"https://api.github.com/users/h2oai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/h2oai/subscriptions","organizations_url":"https://api.github.com/users/h2oai/orgs","repos_url":"https://api.github.com/users/h2oai/repos","events_url":"https://api.github.com/users/h2oai/events{/privacy}","received_events_url":"https://api.github.com/users/h2oai/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/h2oai/h2o-3","description":"Open Source Fast Scalable Machine Learning Platform For Smarter Applications (Deep Learning, Gradient Boosting, Random Forest, Generalized Linear Modeling (Logistic Regression, Elastic Net), K-Means, PCA, Stacked Ensembles, Automatic Machine Learning (AutoML), ...)","fork":false,"url":"https://api.github.com/repos/h2oai/h2o-3","forks_url":"https://api.github.com/repos/h2oai/h2o-3/forks","keys_url":"https://api.github.com/repos/h2oai/h2o-3/keys{/key_id}","collaborators_url":"https://api.github.com/repos/h2oai/h2o-3/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/h2oai/h2o-3/teams","hooks_url":"https://api.github.com/repos/h2oai/h2o-3/hooks","issue_events_url":"https://api.github.com/repos/h2oai/h2o-3/issues/events{/number}","events_url":"https://api.github.com/repos/h2oai/h2o-3/events","assignees_url":"https://api.github.com/repos/h2oai/h2o-3/assignees{/user}","branches_url":"https://api.github.com/repos/h2oai/h2o-3/branches{/branch}","tags_url":"https://api.github.com/repos/h2oai/h2o-3/tags","blobs_url":"https://api.github.com/repos/h2oai/h2o-3/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/h2oai/h2o-3/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/h2oai/h2o-3/git/refs{/sha}","trees_url":"https://api.github.com/repos/h2oai/h2o-3/git/trees{/sha}","statuses_url":"https://api.github.com/repos/h2oai/h2o-3/statuses/{sha}","languages_url":"https://api.github.com/repos/h2oai/h2o-3/languages","stargazers_url":"https://api.github.com/repos/h2oai/h2o-3/stargazers","contributors_url":"https://api.github.com/repos/h2oai/h2o-3/contributors","subscribers_url":"https://api.github.com/repos/h2oai/h2o-3/subscribers","subscription_url":"https://api.github.com/repos/h2oai/h2o-3/subscription","commits_url":"https://api.github.com/repos/h2oai/h2o-3/commits{/sha}","git_commits_url":"https://api.github.com/repos/h2oai/h2o-3/git/commits{/sha}","comments_url":"https://api.github.com/repos/h2oai/h2o-3/comments{/number}","issue_comment_url":"https://api.github.com/repos/h2oai/h2o-3/issues/comments{/number}","contents_url":"https://api.github.com/repos/h2oai/h2o-3/contents/{+path}","compare_url":"https://api.github.com/repos/h2oai/h2o-3/compare/{base}...{head}","merges_url":"https://api.github.com/repos/h2oai/h2o-3/merges","archive_url":"https://api.github.com/repos/h2oai/h2o-3/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/h2oai/h2o-3/downloads","issues_url":"https://api.github.com/repos/h2oai/h2o-3/issues{/number}","pulls_url":"https://api.github.com/repos/h2oai/h2o-3/pulls{/number}","milestones_url":"https://api.github.com/repos/h2oai/h2o-3/milestones{/number}","notifications_url":"https://api.github.com/repos/h2oai/h2o-3/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/h2oai/h2o-3/labels{/name}","releases_url":"https://api.github.com/repos/h2oai/h2o-3/releases{/id}","deployments_url":"https://api.github.com/repos/h2oai/h2o-3/deployments","created_at":"2014-03-03T16:08:07Z","updated_at":"2018-02-01T10:22:28Z","pushed_at":"2018-02-01T19:09:46Z","git_url":"git://github.com/h2oai/h2o-3.git","ssh_url":"git@github.com:h2oai/h2o-3.git","clone_url":"https://github.com/h2oai/h2o-3.git","svn_url":"https://github.com/h2oai/h2o-3","homepage":"http://h2o.ai","size":383277,"stargazers_count":2820,"watchers_count":2820,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1112,"mirror_url":null,"archived":false,"open_issues_count":59,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":1112,"open_issues":59,"watchers":2820,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/h2oai/h2o-3/pulls/1993"},"html":{"href":"https://github.com/h2oai/h2o-3/pull/1993"},"issue":{"href":"https://api.github.com/repos/h2oai/h2o-3/issues/1993"},"comments":{"href":"https://api.github.com/repos/h2oai/h2o-3/issues/1993/comments"},"review_comments":{"href":"https://api.github.com/repos/h2oai/h2o-3/pulls/1993/comments"},"review_comment":{"href":"https://api.github.com/repos/h2oai/h2o-3/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/h2oai/h2o-3/pulls/1993/commits"},"statuses":{"href":"https://api.github.com/repos/h2oai/h2o-3/statuses/93a577c5c3e1c3032da71c740782a51cb4b3dde9"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"navdeep-G"}}