Note
This page is a reference documentation. It only explains the class signature, and not how to use it. Please refer to the What you really need to know section for the big picture.
julearn.pipeline.JuTargetPipeline¶
- class julearn.pipeline.JuTargetPipeline(steps)¶
Class for pipelines that work on the target.
Unlike the
sklearn.pipeline.Pipeline, this pipeline fits and transforms using both X and y. This is useful for pipelines that work on the target but require information from the input data, such as thejulearn.transformers.target.TargetConfoundRemoveror a target encoder that requires one of the features to be present.IMPORTANT: Using any of the transformers that transforms the target based on the input data will result in data leakage if the features are not dropped after the transformation.
- Parameters:
steps (
list[tuple[str,JuTargetTransformer|TransformerLike]]) – List of steps to be performed on the target.
- __init__(steps)¶
- fit_transform(X, y)¶
Fit and transform the target.
- fit(X, y)¶
Fit the target pipeline.
- transform(X, y)¶
Transform the target.
- inverse_transform(X, y)¶
Inverse transform the target.
- can_inverse_transform()¶
Check if the pipeline can inverse transform.
- Returns:
True if the pipeline can inverse transform.
- property needed_types¶
Get the needed types for the pipeline.
- Returns:
The needed types for the pipeline.