]> Piment Noir Git Repositories - freqai-strategies.git/commitdiff
refactor(qav3): refine typing
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Wed, 2 Apr 2025 19:31:36 +0000 (21:31 +0200)
committerJérôme Benoit <jerome.benoit@piment-noir.org>
Wed, 2 Apr 2025 19:31:36 +0000 (21:31 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
quickadapter/user_data/freqaimodels/QuickAdapterRegressorV3.py

index 1a991ef9015aa491297aaf0df074ead4ea136d08..f5948e71d20354d3324c9a418ef955c3939ac543 100644 (file)
@@ -548,7 +548,7 @@ class QuickAdapterRegressorV3(BaseRegressionModel):
         return min_pred[EXTREMA_COLUMN], max_pred[EXTREMA_COLUMN]
 
 
-def get_callbacks(trial: optuna.Trial, regressor: str) -> list:
+def get_callbacks(trial: optuna.Trial, regressor: str) -> list[Callable]:
     if regressor == "xgboost":
         callbacks = [
             optuna.integration.XGBoostPruningCallback(trial, "validation_0-rmse")
@@ -569,7 +569,7 @@ def train_regressor(
     eval_weights: Optional[list[np.ndarray]],
     model_training_parameters: dict,
     init_model: Any = None,
-    callbacks: list = None,
+    callbacks: list[Callable] = None,
 ) -> Any:
     if regressor == "xgboost":
         from xgboost import XGBRegressor