Hi, Is there anyway I can save/load some variables...
# mlforecast
s
Hi, Is there anyway I can save/load some variables as attributes along with MLForecast? What I'm trying to do is this
Copy code
udf_variable1  = [1,2,3]
udf_variable2 = df
fcst = MLForecast(
    models={
        'avg': lgb.LGBMRegressor(**lgb_params),
    },
)
fcst.fit(df)
fcst.a = udf_variable1
fcst.b = udf_variable2
fcst.save(path='example_path')

###load
fcst = MLForecast.load(path='example_path')
fcst.a == [1,2,3] ### should be true
I'm able to save the model but I got error when loading:
Copy code
993 try:
    994     with fsspec.open(f"{path}/intervals.pkl", "rb") as f:
--> 995         intervals = cloudpickle.load(f)
    996 except FileNotFoundError:
    997     intervals = None

EOFError: Ran out of input
j
Hey. Only some objects are serialized so assigning attributes to the forecast object won't work. However, a directory is created, so you could create another file in that directory and save your attributes there.
1