roiextract.pipeline.PipelineStep#
- class roiextract.pipeline.PipelineStep#
Base class for all pipeline steps that describe a linear transformation of the data. Subclasses can use custom signatures for the
fit()andfit_transform()methods as long as data remains the first argument (positional). Additional arguments can be requested by overriding the_request_args()method.- Attributes:
- preparedbool
Indicates whether the step (i.e., the underlying method) has been fit to the data.
Methods
fit(data, **kwargs)Fit the underlying method to the provided data.
fit_transform(data, **kwargs)Fit the step to the provided data and then apply the transformation.
Names for rows of the weight matrix that corresponds to this step.
Parameters of the pipeline step that should be saved in the corresponding spatial filter.
The weight matrix corresponding to the linear transformation defined by this pipeline step.
transform(data)Apply the transformation defined by this pipeline step to the provided data.
- fit(data, **kwargs)#
Fit the underlying method to the provided data. This method should be called before calling
transform().- Parameters:
- data
The data to fit the step on. The expected type and shape of the data depends on the specific step implementation.
- **kwargs
Additional keyword arguments that may be required for fitting the step. By default, no arguments are provided by the
ExtractionPipelineclass. The step implementation can request specific arguments by overriding the_request_args()method.
- fit_transform(data, **kwargs)#
Fit the step to the provided data and then apply the transformation.
- Parameters:
- data
The data to fit and transform. The expected type and shape of the data depends on the specific step implementation.
- **kwargs
Additional keyword arguments that may be required for fitting the step. By default, no additional arguments are provided. The step implementation can request specific arguments by overriding the
_request_args()method.
- Returns:
transformed_dataThe transformed data. The type and shape of the returned data depend on the specific step implementation.
- get_names()#
Names for rows of the weight matrix that corresponds to this step.
- get_params()#
Parameters of the pipeline step that should be saved in the corresponding spatial filter.
- Returns:
- params
dict Parameters of the pipeline step that should be saved in the corresponding spatial filter.
- params
- get_weights()#
The weight matrix corresponding to the linear transformation defined by this pipeline step.
- Returns:
- weights
array The weight matrix corresponding to the linear transformation defined by this pipeline step.
- weights
- transform(data)#
Apply the transformation defined by this pipeline step to the provided data.
- Parameters:
- data
The data to transform. The expected type and shape of the data depends on the specific step implementation.
- Returns:
transformed_dataThe transformed data. The type and shape of the returned data depend on the specific step implementation.