Skip to content

Commit ec49cba

Browse files
committed
DOC: X_argsorted
1 parent 4a76b06 commit ec49cba

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

sklearn/ensemble/weight_boosting.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,14 @@ def _boost(self, iboost, X, y, sample_weight, X_argsorted=None):
167167
sample_weight : array-like of shape = [n_samples]
168168
The current sample weights.
169169
170+
X_argsorted : array-like, shape = [n_samples, n_features] (optional)
171+
Each column of ``X_argsorted`` holds the row indices of ``X``
172+
sorted according to the value of the corresponding feature
173+
in ascending order.
174+
The argument is supported to enable multiple decision trees
175+
to share the data structure and to avoid re-computation in
176+
tree ensembles. For maximum efficiency use dtype np.int32.
177+
170178
Returns
171179
-------
172180
sample_weight : array-like of shape = [n_samples] or None
@@ -397,6 +405,14 @@ def _boost(self, iboost, X, y, sample_weight, X_argsorted=None):
397405
sample_weight : array-like of shape = [n_samples]
398406
The current sample weights.
399407
408+
X_argsorted : array-like, shape = [n_samples, n_features] (optional)
409+
Each column of ``X_argsorted`` holds the row indices of ``X``
410+
sorted according to the value of the corresponding feature
411+
in ascending order.
412+
The argument is supported to enable multiple decision trees
413+
to share the data structure and to avoid re-computation in
414+
tree ensembles. For maximum efficiency use dtype np.int32.
415+
400416
Returns
401417
-------
402418
sample_weight : array-like of shape = [n_samples] or None
@@ -913,6 +929,14 @@ def _boost(self, iboost, X, y, sample_weight, X_argsorted=None):
913929
sample_weight : array-like of shape = [n_samples]
914930
The current sample weights.
915931
932+
X_argsorted : array-like, shape = [n_samples, n_features] (optional)
933+
Each column of ``X_argsorted`` holds the row indices of ``X``
934+
sorted according to the value of the corresponding feature
935+
in ascending order.
936+
The argument is supported to enable multiple decision trees
937+
to share the data structure and to avoid re-computation in
938+
tree ensembles. For maximum efficiency use dtype np.int32.
939+
916940
Returns
917941
-------
918942
sample_weight : array-like of shape = [n_samples] or None
@@ -942,6 +966,7 @@ def _boost(self, iboost, X, y, sample_weight, X_argsorted=None):
942966

943967
# Fit on the bootstrapped sample and obtain a prediction
944968
# for all samples in the training set
969+
# X_argsorted is not used since bootstrap copies are used.
945970
estimator.fit(X[bootstrap_idx], y[bootstrap_idx])
946971
y_predict = estimator.predict(X)
947972

0 commit comments

Comments
 (0)