class_docstr: Base class for histogram-based gradient boosting estimators.
class_docstr_tok: ["Base","class","for","histogram-based","gradient","boosting","estimators","."]
docstr: Compute the indices of the subsample set and return this set.
  
  For efficiency, we need to subsample the training set to compute scores
  with scorers.
docstr_tok: ["Compute","the","indices","of","the","subsample","set","and","return","this","set",".","For","efficiency",",","we","need","to","subsample","the","training","set","to","compute","scores","with","scorers","."]
code: def _get_small_trainset(
      self, X_binned_train, y_train, sample_weight_train, seed
  ):
      """Compute the indices of the subsample set and return this set.
  
      For efficiency, we need to subsample the training set to compute scores
      with scorers.
      """
      # TODO: incorporate sample_weights here in `resample`
      subsample_size = 10000
      if X_binned_train.shape[0] > subsample_size:
          indices = np.arange(X_binned_train.shape[0])
          stratify = y_train if is_classifier(self) else None
          indices = resample(
              indices,
              n_samples=subsample_size,
              replace=False,
              random_state=seed,
              stratify=stratify,
          )
          X_binned_small_train = X_binned_train[indices]
          y_small_train = y_train[indices]
          if sample_weight_train is not None:
              sample_weight_small_train = sample_weight_train[indices]
          else:
              sample_weight_small_train = None
          X_binned_small_train = np.ascontiguousarray(
              X_binned_small_train
          )
          return (
              X_binned_small_train,
              y_small_train,
              sample_weight_small_train,
          )
      else:
          return X_binned_train, y_train, sample_weight_train
  
imports: import itertools
  from abc import ABC, abstractmethod
  from functools import partial
  from numbers import Integral, Real
  from timeit import default_timer
  import numpy
  from ..._loss.loss import _LOSSES, BaseLoss, HalfBinomialLoss, HalfGammaLoss, HalfMultinomialLoss, HalfPoissonLoss, PinballLoss
  from ...base import BaseEstimator, ClassifierMixin, RegressorMixin, _fit_context, is_classifier
  from ...metrics import check_scoring
  from ...model_selection import train_test_split
  from ...preprocessing import LabelEncoder
  from ...utils import check_random_state, compute_sample_weight, resample
  from ...utils._openmp_helpers import _openmp_effective_n_threads
  from ...utils._param_validation import Interval, RealNotInt, StrOptions
  from ...utils.multiclass import check_classification_targets
  from ...utils.validation import _check_monotonic_cst, _check_sample_weight, check_consistent_length, check_is_fitted
  from ._gradient_boosting import _update_raw_predictions
  from .binning import _BinMapper
  from .common import G_H_DTYPE, X_DTYPE, Y_DTYPE
  from .grower import TreeGrower
label_desc: Use image node_id 9 for calling the BaseHistGradientBoosting obj's underlying member method code with example usage: obj._get_small_trainset(X_binned_train, y_train, sample_weight_train, seed) and returns: X_binned_small_train,  y_small_train,  sample_weight_small_train, X_binned_train,  y_train,  sample_weight_train