I had one more quick for the Optimization example....
# mlforecast
b
I had one more quick for the Optimization example. Is it possible to use a distributed model like SparkLGBMForecast?
At this stage, I received an error trying to pass SparkLGBMForecast().
TypeError: Cannot clone object 'SparkLGBMForecast_7d1c5816879c' (type <class 'mlforecast.distributed.models.spark.lgb.SparkLGBMForecast'>): it does not seem to be a scikit-learn estimator as it does not implement a 'get_params' method.
import optuna from mlforecast.optimization import mlforecast_objective import mlforecast from mlforecast.distributed.models.spark.lgb import SparkLGBMForecast optuna.logging.set_verbosity(optuna.logging.WARNING) objective = mlforecast_objective( df=SparkDataFrame, config_fn=config_fn, loss=loss, model=SparkLGBMForecast(), freq='D', n_windows=4, h=7 ) study = optuna.create_study( direction='minimize', sampler=optuna.samplers.TPESampler(seed=0) ) study.optimize(objective, n_trials=2) best_cfg = study.best_trial.user_attrs['config']
k
I'd just implement your own objective with Mlforecast.cv method, since it's exactly how it's done in a package