from spotforecast2.multitask import SpotOptimTask
task = SpotOptimTask(n_trials_spotoptim=10, predict_size=24)
print(f"Task: {task.TASK}")
print(f"SpotOptim trials: {task.config.n_trials_spotoptim}")Task: spotoptim
SpotOptim trials: 10
multitask.SpotOptimTask(
config=None,
*,
dataframe=None,
data_test=None,
cache_home=None,
log_level=logging.INFO,
**overrides,
)Task 4 — SpotOptim surrogate-model Bayesian tuning.
Uses spotoptim for surrogate-model-based Bayesian optimisation. Effective with small trial budgets.
| Name | Description |
|---|---|
| run | Run SpotOptim surrogate-model tuning for all targets. |
Run SpotOptim surrogate-model tuning for all targets.
| Name | Type | Description | Default |
|---|---|---|---|
| show | bool | If True, display prediction figures. |
True |
| search_space | Optional[Dict[str, Any]] | Dictionary defining the SpotOptim search space. None uses the built-in default. |
None |
| Name | Type | Description |
|---|---|---|
| Dict[str, Any] | Aggregated prediction package. Per-target packages are stored | |
| Dict[str, Any] | on self.results["spotoptim"]. |
# Construct the task and verify configuration before running.
# A full run requires prepared data (prepare_data, impute, etc.);
# this example demonstrates construction and config inspection.
from spotforecast2.multitask.spotoptim import SpotOptimTask
task = SpotOptimTask(
n_trials_spotoptim=5,
n_initial_spotoptim=3,
predict_size=24,
auto_save_models=False,
)
print(f"Task type: {task.TASK}")
print(f"Trials: {task.config.n_trials_spotoptim}")
print(f"Initial evaluations: {task.config.n_initial_spotoptim}")
assert task.config.n_trials_spotoptim == 5
assert task.config.auto_save_models is FalseTask type: spotoptim
Trials: 5
Initial evaluations: 3