LinearComponentSplitter#
- class openstef_models.models.component_splitting.linear_component_splitter.LinearComponentSplitter(config: LinearComponentSplitterConfig) None[source]
Bases:
ComponentSplitterLinear component splitter for energy data.
Provides a linear component splitter that uses a simple linear model to split energy data into predefined components. The predefined components are:
Wind on shore
Solar
Other
The splitter applies a pre-trained model from OpenSTEF V3.4.24 to divide total energy consumption into three predefined components. Training is currently not supported.
Example
Basic usage
>>> from openstef_core.types import EnergyComponentType >>> config = LinearComponentSplitterConfig( ... source_column="total_load", ... components=[EnergyComponentType.SOLAR, EnergyComponentType.WIND, EnergyComponentType.OTHER], ... ) >>> splitter = LinearComponentSplitter(config) >>> components = splitter.predict(time_series_data)
- Parameters:
config (
LinearComponentSplitterConfig)
- __init__(config: LinearComponentSplitterConfig) None[source]
Initialize the linear component splitter.
- Parameters:
config (
LinearComponentSplitterConfig) – Configuration with model path and column names.config
- property config: LinearComponentSplitterConfig
Get the splitter configuration.
- Returns:
Current configuration with component ratios and settings.
- property is_fitted: bool
Check if the predictor has been fitted.
- fit(data: TimeSeriesDataset, data_val: TimeSeriesDataset | None = None) None[source]
No training supported currently for linear component splitter.
The linear model is pre-trained and loaded from a file.
- Parameters:
data (
TimeSeriesDataset)data_val (
TimeSeriesDataset|None)
- Return type:
- predict(data: TimeSeriesDataset) EnergyComponentDataset[source]
Predict energy components using the linear model.
- Parameters:
data (
TimeSeriesDataset) – Input time series dataset containing total load, radiation, and windspeed_100m.data
- Returns:
Energy component dataset with wind, solar, and other components.
- Raises:
ValueError – If required columns are missing or model not loaded.
- Return type: