Skip to content

Commit d1d20cc

Browse files
committed
Fix docstring
Signed-off-by: Adam Li <[email protected]>
1 parent f2136f4 commit d1d20cc

File tree

1 file changed

+27
-19
lines changed

1 file changed

+27
-19
lines changed

sklearn/tree/_classes.py

Lines changed: 27 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2131,26 +2131,34 @@ def _build_tree(
21312131
21322132
Parameters
21332133
----------
2134-
X : _type_
2135-
_description_
2136-
y : _type_
2137-
_description_
2138-
sample_weight : _type_
2139-
_description_
2134+
X : {array-like, sparse matrix} of shape (n_samples, n_features)
2135+
The training input samples. Internally, it will be converted to
2136+
``dtype=np.float32`` and if a sparse matrix is provided
2137+
to a sparse ``csc_matrix``.
2138+
y : array-like of shape (n_samples,) or (n_samples, n_outputs)
2139+
The target values (class labels) as integers or strings.
2140+
sample_weight : array-like of shape (n_samples,), default=None
2141+
Sample weights. If None, then samples are equally weighted. Splits
2142+
that would create child nodes with net zero or negative weight are
2143+
ignored while searching for a split in each node. Splits are also
2144+
ignored if they would result in any single class carrying a
2145+
negative weight in either child node.
21402146
is_classification : bool
2141-
_description_
2142-
min_samples_leaf : _type_
2143-
_description_
2144-
min_weight_leaf : _type_
2145-
_description_
2146-
max_leaf_nodes : _type_
2147-
_description_
2148-
min_samples_split : _type_
2149-
_description_
2150-
max_depth : _type_
2151-
_description_
2152-
random_state : _type_
2153-
_description_
2147+
Whether or not is classification.
2148+
min_samples_leaf : int or float
2149+
The minimum number of samples required to be at a leaf node.
2150+
min_weight_leaf : float, default=0.0
2151+
The minimum weighted fraction of the sum total of weights.
2152+
max_leaf_nodes : int, default=None
2153+
Grow a tree with ``max_leaf_nodes`` in best-first fashion.
2154+
min_samples_split : int or float, default=2
2155+
The minimum number of samples required to split an internal node:
2156+
max_depth : int, default=None
2157+
The maximum depth of the tree. If None, then nodes are expanded until
2158+
all leaves are pure or until all leaves contain less than
2159+
min_samples_split samples.
2160+
random_state : int, RandomState instance or None, default=None
2161+
Controls the randomness of the estimator.
21542162
"""
21552163

21562164
n_samples = X.shape[0]

0 commit comments

Comments
 (0)