You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
tree = H2OTree(model = cars_drf, tree_number=0)
children = []
for i in range(0, len(tree)):
if (tree.left_children[i] == -1):
children.append(tree.node_ids[i])
Jira Issue: PUBDEV-8242
Assignee: Michal Kurka
Reporter: Joseph Granados
State: Resolved
Fix Version: 3.32.1.5
Attachments: N/A
Development PRs: Available
Repro on 3.32.1.2 example:
{code:python}import h2o
from h2o.estimators import H2ORandomForestEstimator
h2o.init()
h2o_df = h2o.import_file("/Users/jgranados/datasets/BNPParibas.csv")
predictors = h2o_df.columns
response = "v58"
predictors.remove(response)
cars_drf = H2ORandomForestEstimator(
ntrees=1,
max_depth=10,
min_rows=1,
nbins=4096,
nbins_top_level=4096,
min_split_improvement=1e-06,
seed=3
)
cars_drf.train(x=predictors,
y=response,
training_frame=h2o_df,
)
from h2o.tree import H2OTree
node_assignments_num = cars_drf.predict_leaf_node_assignment(h2o_df, type="Node_ID")
tree = H2OTree(model = cars_drf, tree_number=0)
children = []
for i in range(0, len(tree)):
if (tree.left_children[i] == -1):
children.append(tree.node_ids[i])
print(len(node_assignments_num.unique()))
print(len(children))
len(node_assignments_num.unique()) == len(children){code}
Output:
{noformat}Parse progress: |█████████████████████████████████████████████████████████| 100%
drf Model Build progress: |███████████████████████████████████████████████| 100%
829
830
False{noformat}
The text was updated successfully, but these errors were encountered: