@@ -24,6 +24,7 @@ class calls the ``fit`` method of the ``ForestRegressor`` and creates a
24
24
25
25
import numbers
26
26
import random
27
+ import warnings
27
28
from math import ceil
28
29
from warnings import warn
29
30
@@ -190,7 +191,9 @@ def _get_y_train_leaves(self, X, sorter=None, sample_weight=None):
190
191
"" .format (type (self .max_samples_leaf ))
191
192
)
192
193
193
- X_leaves = self .apply (X )
194
+ with warnings .catch_warnings ():
195
+ warnings .simplefilter ("ignore" , UserWarning )
196
+ X_leaves = self .apply (X )
194
197
195
198
shape = (n_samples , self .n_estimators )
196
199
bootstrap_indices = np .empty (shape , dtype = np .int64 )
@@ -473,7 +476,9 @@ def predict(
473
476
"to compute any reliable OOB estimates."
474
477
)
475
478
else :
476
- X_leaves = self .apply (X )
479
+ with warnings .catch_warnings ():
480
+ warnings .simplefilter ("ignore" , UserWarning )
481
+ X_leaves = self .apply (X )
477
482
X_indices = None
478
483
479
484
y_pred = self .forest_ .predict (
@@ -579,7 +584,9 @@ def quantile_ranks(
579
584
"to compute any reliable OOB estimates."
580
585
)
581
586
else :
582
- X_leaves = self .apply (X )
587
+ with warnings .catch_warnings ():
588
+ warnings .simplefilter ("ignore" , UserWarning )
589
+ X_leaves = self .apply (X )
583
590
X_indices = None
584
591
585
592
y_ranks = self .forest_ .quantile_ranks (
@@ -672,7 +679,9 @@ def proximity_counts(
672
679
"to compute any reliable OOB estimates."
673
680
)
674
681
else :
675
- X_leaves = self .apply (X )
682
+ with warnings .catch_warnings ():
683
+ warnings .simplefilter ("ignore" , UserWarning )
684
+ X_leaves = self .apply (X )
676
685
X_indices = None
677
686
678
687
proximities = self .forest_ .proximity_counts (
0 commit comments