Model.get_tree¶
In [ ]:
Model.get_tree(tree_id: int = 0)
Returns a table with all the input tree information.
Parameters¶
| Name | Type | Optional | Description |
|---|---|---|---|
tree_id | int | ✓ | Unique tree identifier. It is an integer between 0 and n_estimators - 1 |
Returns¶
tablesample : An object containing the result. For more information, see utilities.tablesample.
Example¶
In [51]:
from verticapy.learn.ensemble import RandomForestClassifier
model = RandomForestClassifier(name = "public.RF_iris",
n_estimators = 20,
max_features = "auto",
max_leaf_nodes = 32,
sample = 0.7,
max_depth = 3,
min_samples_leaf = 5,
min_info_gain = 0.0,
nbins = 32)
model.fit("public.iris",
["PetalLengthCm", "PetalWidthCm"],
"Species")
model.get_tree(tree_id = 2)
Out[51]:
