6. Dataset transformations¶
scikit-learn provides a library of transformers, which may clean (see Preprocessing data), reduce (see Unsupervised dimensionality reduction), expand (see Kernel Approximation) or generate (see Feature extraction) feature representations.
Like other estimators, these are represented by classes with a fit
method,
which learns model parameters (e.g. mean and standard deviation for
normalization) from a training set, and a transform
method which applies
this transformation model to unseen data. fit_transform
may be more
convenient and efficient for modelling and transforming the training data
simultaneously.
Combining such transformers, either in parallel or series is covered in Pipelines and composite estimators. Pairwise metrics, Affinities and Kernels covers transforming feature spaces into affinity matrices, while Transforming the prediction target (y) considers transformations of the target space (e.g. categorical labels) for use in scikit-learn.
- 6.1. Pipelines and composite estimators
- 6.2. Feature extraction
- 6.3. Preprocessing data
- 6.4. Imputation of missing values
- 6.5. Unsupervised dimensionality reduction
- 6.6. Random Projection
- 6.7. Kernel Approximation
- 6.8. Pairwise metrics, Affinities and Kernels
- 6.9. Transforming the prediction target (
y
)