liveBook · Manning

Scikit-learn transformer class

As explained in Machine Learning for Tabular Data: XGBoost, Deep Learning, and AI

A transformer is a Scikit-learn object that learns a data transformation and applies it to return transformed data.

A transformer is a Scikit-learn object that learns a transformation from data and applies it to return transformed data. Instantiate it with configuration parameters, fit it on data, then transform that data or later data. section 4.1.2

The common workflow separates configuration, learning, and transformation:

  • Instantiate the transformer and assign it to a variable. section 4.1.2
  • Call fit(data) to learn parameters from the data. section 4.1.2
  • Call transform(data) to map data using the learned transformation. section 4.1.2

Fitting and applying a transformer

A StandardScaler instance illustrates the pattern: processing = StandardScaler().fit(X), followed by processing.transform(X). The fitted object retains information needed for the transformation.

How Machine Learning for Tabular Data: XGBoost, Deep Learning, and AI covers it

How deep it goes
Defines the common fit-and-transform interface but does not explain transformation-specific algorithms or learned parameters.
Examples
Uses StandardScaler with fit, transform, and fit_transform calls on tabular data.
What you can do after
Apply it via Scikit-learn's fit, transform, and fit_transform methods.
How it connects
Connects transformers with estimators, predictors, models, fit, transform, and hyperparameters.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Machine Learning for Tabular Data: XGBoost, Deep Learning, and AI. The section links point to the parts of the book it draws on.