ConstantComponentSplitter#
- class openstef_models.models.component_splitting.constant_component_splitter.ConstantComponentSplitter(config: ConstantComponentSplitterConfig) None[source]
Bases:
ComponentSplitterConstant ratio-based component splitter for energy data.
Splits energy time series into predefined components using fixed ratios. Useful as a baseline splitter when users know the energy distribution or need a simple reference implementation.
The splitter applies constant multiplication factors to the source data based on predefined component ratios. No training is required since ratios are user-specified. Performance depends entirely on the accuracy of the provided ratios.
Example
Basic usage with known solar/wind distribution
>>> from openstef_core.types import EnergyComponentType >>> config = ConstantComponentSplitterConfig( ... source_column="total_load", ... components=[EnergyComponentType.SOLAR, EnergyComponentType.WIND], ... component_ratios={ ... EnergyComponentType.SOLAR: 0.6, ... EnergyComponentType.WIND: 0.4 ... } ... ) >>> splitter = ConstantComponentSplitter(config) >>> components = splitter.predict(time_series_data)
Using predefined configurations
>>> solar_splitter = ConstantComponentSplitter.known_solar_park() >>> wind_splitter = ConstantComponentSplitter.known_wind_farm()
- Parameters:
config (
ConstantComponentSplitterConfig)
- __init__(config: ConstantComponentSplitterConfig) None[source]
Initialize the constant component splitter.
- Parameters:
config (
ConstantComponentSplitterConfig) – Configuration with component ratios and source column.config
- property config: ConstantComponentSplitterConfig
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]
Fit the predictor to the input data.
This method should be called before generating predictions. It allows the predictor to learn parameters from the training data.
- Parameters:
data (
TimeSeriesDataset) – The training data to fit the predictor on.data_val (
TimeSeriesDataset|None) – The validation data to evaluate and tune the predictor on (optional).data
data_val
- Return type:
- predict(data: TimeSeriesDataset) EnergyComponentDataset[source]
Generate predictions for the input data.
This method should use the fitted parameters to generate predictions.
- Parameters:
data (
TimeSeriesDataset) – The input data to generate predictions for.data
- Returns:
Predictions for the input data.
- Raises:
NotFittedError – If the predictor has not been fitted yet.
- Return type: