Skip to content

Commit

Permalink
ht/built gradle
Browse files Browse the repository at this point in the history
  • Loading branch information
hannah-tillman authored and valenad1 committed Aug 14, 2024
1 parent 8dd67d2 commit 8cc37b2
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions h2o-py/h2o/estimators/decision_tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ def ignore_const_cols(self):
>>> prostate = h2o.import_file("http://s3.amazonaws.com/h2o-public-test-data/smalldata/prostate/prostate.csv")
>>> target_variable = 'CAPSULE'
>>> prostate[target_variable] = prostate[target_variable].asfactor()
>>> prostate["const_1"] = 6
>>> train, test = prostate.split_frame(ratios=[0.7])
>>> sdt_h2o = H2ODecisionTreeEstimator(model_id="decision_tree.hex",
... max_depth=5,
Expand Down Expand Up @@ -145,11 +146,12 @@ def categorical_encoding(self):
>>> h2o.init()
>>> prostate = h2o.import_file("http://s3.amazonaws.com/h2o-public-test-data/smalldata/prostate/prostate.csv")
>>> target_variable = 'CAPSULE'
>>> prostate["RACE"] = prostate["RACE"].asfactor()
>>> prostate[target_variable] = prostate[target_variable].asfactor()
>>> train, test = prostate.split_frame(ratios=[0.7])
>>> sdt_h2o = H2ODecisionTreeEstimator(model_id="decision_tree.hex",
... max_depth=5,
... categorical_encoding="auto")
... categorical_encoding="binary")
>>> sdt_h2o.train(y=target_variable, training_frame=train)
>>> pred_test = sdt_h2o.predict(test)
"""
Expand Down Expand Up @@ -205,8 +207,7 @@ def max_depth(self):
>>> prostate[target_variable] = prostate[target_variable].asfactor()
>>> train, test = prostate.split_frame(ratios=[0.7])
>>> sdt_h2o = H2ODecisionTreeEstimator(model_id="decision_tree.hex",
... max_depth=5,
... max_depth=20)
... max_depth=5)
>>> sdt_h2o.train(y=target_variable, training_frame=train)
>>> pred_test = sdt_h2o.predict(test)
"""
Expand Down Expand Up @@ -235,7 +236,7 @@ def min_rows(self):
>>> train, test = prostate.split_frame(ratios=[0.7])
>>> sdt_h2o = H2ODecisionTreeEstimator(model_id="decision_tree.hex",
... max_depth=5,
... min_rows=10)
... min_rows=20)
>>> sdt_h2o.train(y=target_variable, training_frame=train)
>>> pred_test = sdt_h2o.predict(test)
"""
Expand Down

0 comments on commit 8cc37b2

Please sign in to comment.