class_docstr: Transformer that preprocesses data to be ready before EBM.
class_docstr_tok: ["Transformer","that","preprocesses","data","to","be","ready","before","EBM","."]
docstr: Fits and Transform on provided samples.
  
  Args:
      X: Numpy array for samples.
      y: Unused. Only included for scikit-learn compatibility
      sample_weight: Per-sample weights
  
  Returns:
      Transformed numpy array.
docstr_tok: ["Fits","and","Transform","on","provided","samples",".","Args",":","X",":","Numpy","array","for","samples",".","y",":","Unused",".","Only","included","for","scikit-learn","compatibility","sample_weight",":","Per-sample","weights","Returns",":","Transformed","numpy","array","."]
code: def fit_transform(self, X, y=None, sample_weight=None):
      """Fits and Transform on provided samples.
  
      Args:
          X: Numpy array for samples.
          y: Unused. Only included for scikit-learn compatibility
          sample_weight: Per-sample weights
  
      Returns:
          Transformed numpy array.
      """
  
      n_samples = None
      if y is not None:
          y = clean_dimensions(y, "y")
          if y.ndim != 1:
              raise ValueError("y must be 1 dimensional")
          n_samples = len(y)
  
      if sample_weight is not None:
          sample_weight = clean_dimensions(
              sample_weight, "sample_weight"
          )
          if sample_weight.ndim != 1:
              raise ValueError("sample_weight must be 1 dimensional")
          if n_samples is not None and n_samples != len(sample_weight):
              msg = f"y has {n_samples} samples and sample_weight has {len(sample_weight)} samples"
              _log.error(msg)
              raise ValueError(msg)
          n_samples = len(sample_weight)
          sample_weight = sample_weight.astype(np.float64, copy=False)
  
      # materialize any iterators first
      X, _ = preclean_X(
          X, self.feature_names, self.feature_types, n_samples
      )
      return self.fit(X, y, sample_weight).transform(X)
  
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 4 for calling the EBMPreprocessor obj's underlying member method code with example usage: obj.fit_transform(X, y, sample_weight) and returns: self