openfl.pipelines.skc_pipeline.SKCPipeline
- class openfl.pipelines.skc_pipeline.SKCPipeline(p_sparsity=0.1, n_clusters=6, **kwargs)
Bases:
TransformationPipelineA pipeline class to compress data lossly using sparsity and k-means methods.
- Class Attributes:
p (float) – The sparsity factor.
n_cluster (int) – The number of K-mean clusters.
Methods
Backward pass of pipeline data transformer.
Forward pass of pipeline data transformer.
If any of the transformers are lossy, then the pipeline is lossy.
- backward(data, transformer_metadata, **kwargs)
Backward pass of pipeline data transformer.
- Parameters:
data – The transformed data.
transformer_metadata – The metadata for the transformation.
**kwargs – Additional keyword arguments for the transformation.
- Returns:
The original data before the transformation.
- forward(data, **kwargs)
Forward pass of pipeline data transformer.
- Parameters:
data – The data to be transformed.
**kwargs – Additional keyword arguments for the transformation.
- Returns:
data – The transformed data.
transformer_metadata – The metadata for the transformation.
- is_lossy()
If any of the transformers are lossy, then the pipeline is lossy.
- Returns:
True if any of the transformers in the pipeline are lossy, False – otherwise.