Wrappers
You can find an introduction to Wrappers in our Getting Started section.
Wrapper-kind pdpipe pipeline stages.
Classes
FitOnly
Bases: PdPipelineStage
A wrapper that applies a stage to input data only when fitting.
In other words, the input data is not transformed if the stage has already been fitted once.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
stage |
PdPipelineStage
|
The pipeline stage to operate on input data only when fitting. |
required |
**kwargs |
object
|
All PdPipelineStage constructor parameters are supported. |
{}
|
Examples:
>>> import pandas as pd; import pdpipe as pdp;
>>> df = pd.DataFrame([[8,'a'],[5,'b']], [1,2], ['num', 'char'])
>>> stage = pdp.FitOnly(pdp.ColDrop('num'))
>>> stage(df)
char
1 a
2 b
>>> df2 = pd.DataFrame([[8,'a'],[5,'b']], [1,2], ['num', 'char'])
>>> stage(df2)
num char
1 8 a
2 5 b
Source code in pdpipe/wrappers.py
Last update:
2022-01-23