A single step in a machine learning pipeline that wraps a scikit-learn estimator.
This class represents an individual processing step that can either transform data (transformers like StandardScaler, SelectKBest) or make predictions (classifiers like KNeighborsClassifier, LinearSVC). Steps can be combined into Pipeline objects to create complex ML workflows.
In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook. On GitHub, the HTML representation is unable to render, please try loading this page with nbviewer.org.
In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook. On GitHub, the HTML representation is unable to render, please try loading this page with nbviewer.org.
Parameters
n_neighbors
5
weights
'uniform'
algorithm
'auto'
leaf_size
30
p
2
metric
'minkowski'
metric_params
None
n_jobs
None
Notes
The Step class is frozen (immutable) using attrs.
All estimators must inherit from sklearn.base.BaseEstimator.
Parameter tuples are automatically sorted for hash consistency.
Steps can be fitted to data using the fit() method which returns a FittedStep.