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() and fit_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.

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.

get_weights()

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 ExtractionPipeline class. 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_data

The 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.

Returns:
row_nameslist of str

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:
paramsdict

Parameters of the pipeline step that should be saved in the corresponding spatial filter.

get_weights()#

The weight matrix corresponding to the linear transformation defined by this pipeline step.

Returns:
weightsarray

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.

Parameters:
data

The data to transform. The expected type and shape of the data depends on the specific step implementation.

Returns:
transformed_data

The transformed data. The type and shape of the returned data depend on the specific step implementation.