{"action":"created","comment":{"url":"https://api.github.com/repos/ironmussa/Optimus/pulls/comments/224977347","pull_request_review_id":164482475,"id":224977347,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyNDk3NzM0Nw==","diff_hunk":"@@ -113,10 +120,90 @@ def gbt(df, columns, input_col):\n         df = string_to_index(df, input_cols=input_col)\n         df = vector_assembler(df, input_cols=feats)\n \n-        model = GBTClassifier()\n+        model = GBTClassifier(**kargs)\n \n         df = df.cols.rename([(input_col + \"_index\", \"label\")])\n \n         gbt_model = model.fit(df)\n         df_model = gbt_model.transform(df)\n         return df_model, gbt_model\n+\n+    @staticmethod\n+    def h2o_automl(df, label, columns, **kargs):\n+\n+        H2OContext.getOrCreate(spark)\n+\n+        df_sti = string_to_index(df, input_cols=label)\n+        df_va = vector_assembler(df_sti, input_cols=columns)\n+        automl = H2OAutoML(convertUnknownCategoricalLevelsToNa=True,\n+                           maxRuntimeSecs=60,  # 1 minutes\n+                           seed=1,\n+                           maxModels=3,\n+                           predictionCol=label + \"_index\",\n+                           **kargs)\n+\n+        model = automl.fit(df_va)\n+        df_raw = model.transform(df_va)\n+\n+        df_pred = df_raw.withColumn(\"prediction\", when(df_raw.prediction_output[\"value\"] > 0.5, 1.0).otherwise(0.0))\n+\n+        return df_pred, model\n+    ","path":"optimus/ml/models.py","position":92,"original_position":92,"commit_id":"1caae06abd2ee8b4c49a54f1516c8afb1a4cd440","original_commit_id":"1caae06abd2ee8b4c49a54f1516c8afb1a4cd440","user":{"login":"codacy-bot","id":19940114,"node_id":"MDQ6VXNlcjE5OTQwMTE0","avatar_url":"https://avatars1.githubusercontent.com/u/19940114?v=4","gravatar_id":"","url":"https://api.github.com/users/codacy-bot","html_url":"https://github.com/codacy-bot","followers_url":"https://api.github.com/users/codacy-bot/followers","following_url":"https://api.github.com/users/codacy-bot/following{/other_user}","gists_url":"https://api.github.com/users/codacy-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/codacy-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codacy-bot/subscriptions","organizations_url":"https://api.github.com/users/codacy-bot/orgs","repos_url":"https://api.github.com/users/codacy-bot/repos","events_url":"https://api.github.com/users/codacy-bot/events{/privacy}","received_events_url":"https://api.github.com/users/codacy-bot/received_events","type":"User","site_admin":false},"body":"![Codacy](https://app.codacy.com/assets/images/favicon.png) Issue found: [Trailing whitespace](https://app.codacy.com/app/favio.vazquezp/Optimus/pullRequest?prid=2345901)","created_at":"2018-10-14T02:49:48Z","updated_at":"2018-10-14T02:49:48Z","html_url":"https://github.com/ironmussa/Optimus/pull/359#discussion_r224977347","pull_request_url":"https://api.github.com/repos/ironmussa/Optimus/pulls/359","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/ironmussa/Optimus/pulls/comments/224977347"},"html":{"href":"https://github.com/ironmussa/Optimus/pull/359#discussion_r224977347"},"pull_request":{"href":"https://api.github.com/repos/ironmussa/Optimus/pulls/359"}}},"pull_request":{"url":"https://api.github.com/repos/ironmussa/Optimus/pulls/359","id":222209143,"node_id":"MDExOlB1bGxSZXF1ZXN0MjIyMjA5MTQz","html_url":"https://github.com/ironmussa/Optimus/pull/359","diff_url":"https://github.com/ironmussa/Optimus/pull/359.diff","patch_url":"https://github.com/ironmussa/Optimus/pull/359.patch","issue_url":"https://api.github.com/repos/ironmussa/Optimus/issues/359","number":359,"state":"open","locked":false,"title":"Add support and helpers for H2O ","user":{"login":"FavioVazquez","id":10162068,"node_id":"MDQ6VXNlcjEwMTYyMDY4","avatar_url":"https://avatars2.githubusercontent.com/u/10162068?v=4","gravatar_id":"","url":"https://api.github.com/users/FavioVazquez","html_url":"https://github.com/FavioVazquez","followers_url":"https://api.github.com/users/FavioVazquez/followers","following_url":"https://api.github.com/users/FavioVazquez/following{/other_user}","gists_url":"https://api.github.com/users/FavioVazquez/gists{/gist_id}","starred_url":"https://api.github.com/users/FavioVazquez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FavioVazquez/subscriptions","organizations_url":"https://api.github.com/users/FavioVazquez/orgs","repos_url":"https://api.github.com/users/FavioVazquez/repos","events_url":"https://api.github.com/users/FavioVazquez/events{/privacy}","received_events_url":"https://api.github.com/users/FavioVazquez/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-10-11T16:53:43Z","updated_at":"2018-10-14T02:49:48Z","closed_at":null,"merged_at":null,"merge_commit_sha":"62a0dddea9db22a7e819295938fb259be8bf704b","assignee":{"login":"FavioVazquez","id":10162068,"node_id":"MDQ6VXNlcjEwMTYyMDY4","avatar_url":"https://avatars2.githubusercontent.com/u/10162068?v=4","gravatar_id":"","url":"https://api.github.com/users/FavioVazquez","html_url":"https://github.com/FavioVazquez","followers_url":"https://api.github.com/users/FavioVazquez/followers","following_url":"https://api.github.com/users/FavioVazquez/following{/other_user}","gists_url":"https://api.github.com/users/FavioVazquez/gists{/gist_id}","starred_url":"https://api.github.com/users/FavioVazquez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FavioVazquez/subscriptions","organizations_url":"https://api.github.com/users/FavioVazquez/orgs","repos_url":"https://api.github.com/users/FavioVazquez/repos","events_url":"https://api.github.com/users/FavioVazquez/events{/privacy}","received_events_url":"https://api.github.com/users/FavioVazquez/received_events","type":"User","site_admin":false},"assignees":[{"login":"FavioVazquez","id":10162068,"node_id":"MDQ6VXNlcjEwMTYyMDY4","avatar_url":"https://avatars2.githubusercontent.com/u/10162068?v=4","gravatar_id":"","url":"https://api.github.com/users/FavioVazquez","html_url":"https://github.com/FavioVazquez","followers_url":"https://api.github.com/users/FavioVazquez/followers","following_url":"https://api.github.com/users/FavioVazquez/following{/other_user}","gists_url":"https://api.github.com/users/FavioVazquez/gists{/gist_id}","starred_url":"https://api.github.com/users/FavioVazquez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FavioVazquez/subscriptions","organizations_url":"https://api.github.com/users/FavioVazquez/orgs","repos_url":"https://api.github.com/users/FavioVazquez/repos","events_url":"https://api.github.com/users/FavioVazquez/events{/privacy}","received_events_url":"https://api.github.com/users/FavioVazquez/received_events","type":"User","site_admin":false}],"requested_reviewers":[{"login":"argenisleon","id":37144,"node_id":"MDQ6VXNlcjM3MTQ0","avatar_url":"https://avatars0.githubusercontent.com/u/37144?v=4","gravatar_id":"","url":"https://api.github.com/users/argenisleon","html_url":"https://github.com/argenisleon","followers_url":"https://api.github.com/users/argenisleon/followers","following_url":"https://api.github.com/users/argenisleon/following{/other_user}","gists_url":"https://api.github.com/users/argenisleon/gists{/gist_id}","starred_url":"https://api.github.com/users/argenisleon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/argenisleon/subscriptions","organizations_url":"https://api.github.com/users/argenisleon/orgs","repos_url":"https://api.github.com/users/argenisleon/repos","events_url":"https://api.github.com/users/argenisleon/events{/privacy}","received_events_url":"https://api.github.com/users/argenisleon/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[{"id":645896929,"node_id":"MDU6TGFiZWw2NDU4OTY5Mjk=","url":"https://api.github.com/repos/ironmussa/Optimus/labels/enhancement","name":"enhancement","color":"84b6eb","default":true},{"id":721871911,"node_id":"MDU6TGFiZWw3MjE4NzE5MTE=","url":"https://api.github.com/repos/ironmussa/Optimus/labels/testing","name":"testing","color":"d93f0b","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/ironmussa/Optimus/pulls/359/commits","review_comments_url":"https://api.github.com/repos/ironmussa/Optimus/pulls/359/comments","review_comment_url":"https://api.github.com/repos/ironmussa/Optimus/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ironmussa/Optimus/issues/359/comments","statuses_url":"https://api.github.com/repos/ironmussa/Optimus/statuses/1caae06abd2ee8b4c49a54f1516c8afb1a4cd440","head":{"label":"ironmussa:develop","ref":"develop","sha":"1caae06abd2ee8b4c49a54f1516c8afb1a4cd440","user":{"login":"ironmussa","id":30134402,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMwMTM0NDAy","avatar_url":"https://avatars2.githubusercontent.com/u/30134402?v=4","gravatar_id":"","url":"https://api.github.com/users/ironmussa","html_url":"https://github.com/ironmussa","followers_url":"https://api.github.com/users/ironmussa/followers","following_url":"https://api.github.com/users/ironmussa/following{/other_user}","gists_url":"https://api.github.com/users/ironmussa/gists{/gist_id}","starred_url":"https://api.github.com/users/ironmussa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ironmussa/subscriptions","organizations_url":"https://api.github.com/users/ironmussa/orgs","repos_url":"https://api.github.com/users/ironmussa/repos","events_url":"https://api.github.com/users/ironmussa/events{/privacy}","received_events_url":"https://api.github.com/users/ironmussa/received_events","type":"Organization","site_admin":false},"repo":{"id":97071697,"node_id":"MDEwOlJlcG9zaXRvcnk5NzA3MTY5Nw==","name":"Optimus","full_name":"ironmussa/Optimus","private":false,"owner":{"login":"ironmussa","id":30134402,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMwMTM0NDAy","avatar_url":"https://avatars2.githubusercontent.com/u/30134402?v=4","gravatar_id":"","url":"https://api.github.com/users/ironmussa","html_url":"https://github.com/ironmussa","followers_url":"https://api.github.com/users/ironmussa/followers","following_url":"https://api.github.com/users/ironmussa/following{/other_user}","gists_url":"https://api.github.com/users/ironmussa/gists{/gist_id}","starred_url":"https://api.github.com/users/ironmussa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ironmussa/subscriptions","organizations_url":"https://api.github.com/users/ironmussa/orgs","repos_url":"https://api.github.com/users/ironmussa/repos","events_url":"https://api.github.com/users/ironmussa/events{/privacy}","received_events_url":"https://api.github.com/users/ironmussa/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/ironmussa/Optimus","description":":truck: Agile Data Science Workflows made easy with Python and Spark.","fork":false,"url":"https://api.github.com/repos/ironmussa/Optimus","forks_url":"https://api.github.com/repos/ironmussa/Optimus/forks","keys_url":"https://api.github.com/repos/ironmussa/Optimus/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ironmussa/Optimus/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ironmussa/Optimus/teams","hooks_url":"https://api.github.com/repos/ironmussa/Optimus/hooks","issue_events_url":"https://api.github.com/repos/ironmussa/Optimus/issues/events{/number}","events_url":"https://api.github.com/repos/ironmussa/Optimus/events","assignees_url":"https://api.github.com/repos/ironmussa/Optimus/assignees{/user}","branches_url":"https://api.github.com/repos/ironmussa/Optimus/branches{/branch}","tags_url":"https://api.github.com/repos/ironmussa/Optimus/tags","blobs_url":"https://api.github.com/repos/ironmussa/Optimus/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ironmussa/Optimus/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ironmussa/Optimus/git/refs{/sha}","trees_url":"https://api.github.com/repos/ironmussa/Optimus/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ironmussa/Optimus/statuses/{sha}","languages_url":"https://api.github.com/repos/ironmussa/Optimus/languages","stargazers_url":"https://api.github.com/repos/ironmussa/Optimus/stargazers","contributors_url":"https://api.github.com/repos/ironmussa/Optimus/contributors","subscribers_url":"https://api.github.com/repos/ironmussa/Optimus/subscribers","subscription_url":"https://api.github.com/repos/ironmussa/Optimus/subscription","commits_url":"https://api.github.com/repos/ironmussa/Optimus/commits{/sha}","git_commits_url":"https://api.github.com/repos/ironmussa/Optimus/git/commits{/sha}","comments_url":"https://api.github.com/repos/ironmussa/Optimus/comments{/number}","issue_comment_url":"https://api.github.com/repos/ironmussa/Optimus/issues/comments{/number}","contents_url":"https://api.github.com/repos/ironmussa/Optimus/contents/{+path}","compare_url":"https://api.github.com/repos/ironmussa/Optimus/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ironmussa/Optimus/merges","archive_url":"https://api.github.com/repos/ironmussa/Optimus/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ironmussa/Optimus/downloads","issues_url":"https://api.github.com/repos/ironmussa/Optimus/issues{/number}","pulls_url":"https://api.github.com/repos/ironmussa/Optimus/pulls{/number}","milestones_url":"https://api.github.com/repos/ironmussa/Optimus/milestones{/number}","notifications_url":"https://api.github.com/repos/ironmussa/Optimus/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ironmussa/Optimus/labels{/name}","releases_url":"https://api.github.com/repos/ironmussa/Optimus/releases{/id}","deployments_url":"https://api.github.com/repos/ironmussa/Optimus/deployments","created_at":"2017-07-13T02:31:18Z","updated_at":"2018-10-14T02:47:29Z","pushed_at":"2018-10-14T02:48:15Z","git_url":"git://github.com/ironmussa/Optimus.git","ssh_url":"git@github.com:ironmussa/Optimus.git","clone_url":"https://github.com/ironmussa/Optimus.git","svn_url":"https://github.com/ironmussa/Optimus","homepage":"https://hioptimus.com","size":8170,"stargazers_count":367,"watchers_count":367,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":95,"mirror_url":null,"archived":false,"open_issues_count":14,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":95,"open_issues":14,"watchers":367,"default_branch":"master"}},"base":{"label":"ironmussa:master","ref":"master","sha":"824f7680c0789c14680887d301c51bcba9cae90b","user":{"login":"ironmussa","id":30134402,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMwMTM0NDAy","avatar_url":"https://avatars2.githubusercontent.com/u/30134402?v=4","gravatar_id":"","url":"https://api.github.com/users/ironmussa","html_url":"https://github.com/ironmussa","followers_url":"https://api.github.com/users/ironmussa/followers","following_url":"https://api.github.com/users/ironmussa/following{/other_user}","gists_url":"https://api.github.com/users/ironmussa/gists{/gist_id}","starred_url":"https://api.github.com/users/ironmussa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ironmussa/subscriptions","organizations_url":"https://api.github.com/users/ironmussa/orgs","repos_url":"https://api.github.com/users/ironmussa/repos","events_url":"https://api.github.com/users/ironmussa/events{/privacy}","received_events_url":"https://api.github.com/users/ironmussa/received_events","type":"Organization","site_admin":false},"repo":{"id":97071697,"node_id":"MDEwOlJlcG9zaXRvcnk5NzA3MTY5Nw==","name":"Optimus","full_name":"ironmussa/Optimus","private":false,"owner":{"login":"ironmussa","id":30134402,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMwMTM0NDAy","avatar_url":"https://avatars2.githubusercontent.com/u/30134402?v=4","gravatar_id":"","url":"https://api.github.com/users/ironmussa","html_url":"https://github.com/ironmussa","followers_url":"https://api.github.com/users/ironmussa/followers","following_url":"https://api.github.com/users/ironmussa/following{/other_user}","gists_url":"https://api.github.com/users/ironmussa/gists{/gist_id}","starred_url":"https://api.github.com/users/ironmussa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ironmussa/subscriptions","organizations_url":"https://api.github.com/users/ironmussa/orgs","repos_url":"https://api.github.com/users/ironmussa/repos","events_url":"https://api.github.com/users/ironmussa/events{/privacy}","received_events_url":"https://api.github.com/users/ironmussa/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/ironmussa/Optimus","description":":truck: Agile Data Science Workflows made easy with Python and Spark.","fork":false,"url":"https://api.github.com/repos/ironmussa/Optimus","forks_url":"https://api.github.com/repos/ironmussa/Optimus/forks","keys_url":"https://api.github.com/repos/ironmussa/Optimus/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ironmussa/Optimus/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ironmussa/Optimus/teams","hooks_url":"https://api.github.com/repos/ironmussa/Optimus/hooks","issue_events_url":"https://api.github.com/repos/ironmussa/Optimus/issues/events{/number}","events_url":"https://api.github.com/repos/ironmussa/Optimus/events","assignees_url":"https://api.github.com/repos/ironmussa/Optimus/assignees{/user}","branches_url":"https://api.github.com/repos/ironmussa/Optimus/branches{/branch}","tags_url":"https://api.github.com/repos/ironmussa/Optimus/tags","blobs_url":"https://api.github.com/repos/ironmussa/Optimus/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ironmussa/Optimus/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ironmussa/Optimus/git/refs{/sha}","trees_url":"https://api.github.com/repos/ironmussa/Optimus/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ironmussa/Optimus/statuses/{sha}","languages_url":"https://api.github.com/repos/ironmussa/Optimus/languages","stargazers_url":"https://api.github.com/repos/ironmussa/Optimus/stargazers","contributors_url":"https://api.github.com/repos/ironmussa/Optimus/contributors","subscribers_url":"https://api.github.com/repos/ironmussa/Optimus/subscribers","subscription_url":"https://api.github.com/repos/ironmussa/Optimus/subscription","commits_url":"https://api.github.com/repos/ironmussa/Optimus/commits{/sha}","git_commits_url":"https://api.github.com/repos/ironmussa/Optimus/git/commits{/sha}","comments_url":"https://api.github.com/repos/ironmussa/Optimus/comments{/number}","issue_comment_url":"https://api.github.com/repos/ironmussa/Optimus/issues/comments{/number}","contents_url":"https://api.github.com/repos/ironmussa/Optimus/contents/{+path}","compare_url":"https://api.github.com/repos/ironmussa/Optimus/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ironmussa/Optimus/merges","archive_url":"https://api.github.com/repos/ironmussa/Optimus/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ironmussa/Optimus/downloads","issues_url":"https://api.github.com/repos/ironmussa/Optimus/issues{/number}","pulls_url":"https://api.github.com/repos/ironmussa/Optimus/pulls{/number}","milestones_url":"https://api.github.com/repos/ironmussa/Optimus/milestones{/number}","notifications_url":"https://api.github.com/repos/ironmussa/Optimus/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ironmussa/Optimus/labels{/name}","releases_url":"https://api.github.com/repos/ironmussa/Optimus/releases{/id}","deployments_url":"https://api.github.com/repos/ironmussa/Optimus/deployments","created_at":"2017-07-13T02:31:18Z","updated_at":"2018-10-14T02:47:29Z","pushed_at":"2018-10-14T02:48:15Z","git_url":"git://github.com/ironmussa/Optimus.git","ssh_url":"git@github.com:ironmussa/Optimus.git","clone_url":"https://github.com/ironmussa/Optimus.git","svn_url":"https://github.com/ironmussa/Optimus","homepage":"https://hioptimus.com","size":8170,"stargazers_count":367,"watchers_count":367,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":95,"mirror_url":null,"archived":false,"open_issues_count":14,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":95,"open_issues":14,"watchers":367,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ironmussa/Optimus/pulls/359"},"html":{"href":"https://github.com/ironmussa/Optimus/pull/359"},"issue":{"href":"https://api.github.com/repos/ironmussa/Optimus/issues/359"},"comments":{"href":"https://api.github.com/repos/ironmussa/Optimus/issues/359/comments"},"review_comments":{"href":"https://api.github.com/repos/ironmussa/Optimus/pulls/359/comments"},"review_comment":{"href":"https://api.github.com/repos/ironmussa/Optimus/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ironmussa/Optimus/pulls/359/commits"},"statuses":{"href":"https://api.github.com/repos/ironmussa/Optimus/statuses/1caae06abd2ee8b4c49a54f1516c8afb1a4cd440"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"codacy-bot"}}