class_docstr: Transformer that preprocesses data to be ready before EBM.
class_docstr_tok: ["Transformer","that","preprocesses","data","to","be","ready","before","EBM","."]
docstr: Transform on provided samples.
  
  Args:
      X: Numpy array for samples.
  
  Returns:
      Transformed numpy array.
docstr_tok: ["Transform","on","provided","samples",".","Args",":","X",":","Numpy","array","for","samples",".","Returns",":","Transformed","numpy","array","."]
code: def transform(self, X):
      """Transform on provided samples.
  
      Args:
          X: Numpy array for samples.
  
      Returns:
          Transformed numpy array.
      """
      check_is_fitted(self, "has_fitted_")
  
      X, n_samples = preclean_X(
          X, self.feature_names_in_, self.feature_types_in_
      )
  
      X_binned = np.empty(
          (n_samples, len(self.feature_names_in_)), np.int64, order="F"
      )
  
      if 0 < n_samples:
          native = Native.get_native_singleton()
          category_iter = (
              category if isinstance(category, dict) else None
              for category in self.bins_
          )
          requests = zip(count(), category_iter)
          cols = unify_columns(
              X,
              requests,
              self.feature_names_in_,
              self.feature_types_in_,
              None,
              False,
          )
          for feature_idx, bins, (_, X_col, _, _) in zip(
              count(), self.bins_, cols
          ):
              if n_samples != len(X_col):
                  msg = "The columns of X are mismatched in the number of of samples"
                  _log.error(msg)
                  raise ValueError(msg)
  
              if not isinstance(bins, dict):
                  # continuous feature
  
                  if not X_col.flags.c_contiguous:
                      # X_col could be a slice that has a stride.  We need contiguous for caling into C
                      X_col = X_col.copy()
  
                  X_col = native.discretize(X_col, bins)
  
              if np.count_nonzero(X_col) != len(X_col):
                  msg = "missing values in X not supported in transform"
                  _log.error(msg)
                  raise ValueError(msg)
  
              X_binned[:, feature_idx] = X_col
  
      return X_binned
  
imports: import logging
  import math
  from itertools import count, repeat, groupby
  from warnings import warn
  import numpy
  from sklearn.base import BaseEstimator, TransformerMixin
  from sklearn.utils.validation import check_is_fitted
  from ._clean_x import unify_columns, preclean_X, unify_feature_names
  from ._clean_simple import clean_dimensions
  from ._seed import normalize_seed, increment_seed
  from ._native import Native
  from ._privacy import validate_eps_delta, calc_classic_noise_multi, calc_gdp_noise_multi, private_numeric_binning, private_categorical_binning
label_desc: Use image node_id 3 for calling the EBMPreprocessor obj's underlying member method code with example usage: obj.transform(X) and returns: X_binned