Closed ds-qst closed 5 months ago
Hey. How did you install the package? It's very unlikely that it has an incompatibility within itself, you may have mixed installs.
Hey. How did you install the package? It's very unlikely that it has an incompatibility within itself, you may have mixed installs.
Just installed with a normal "pip install mlforecast". I also did some test imports:
from mlforecast.core import _name_models from mlforecast.core import Freq
Does not return an error, but from mlforecast.core import _get_model_name
returns ImportError: cannot import name '_get_model_name' from 'mlforecast.core'
I'm using python 3.10
Is that the full error?
Yes, that's why I'm confused.
The full error, when running the import from the tutorial is: 20 21 from . import MLForecast ---> 22 from .core import Freq, _get_model_name, _name_models 23 from .lag_transforms import ExponentiallyWeightedMean, RollingMean 24 from .optimization import _TrialToConfig, mlforecast_objective
ImportError: cannot import name '_get_model_name' from 'mlforecast.core' (/home/
I checked the core.py already, but no luck importing it.
Also proof of the version:
Hmm, I'm not able to reproduce the issue. I just opened that notebook in colab, added %pip install datasetsforecast mlforecast
as the top cell and ran all without a problem.
I've just had this same issue. v0.13.2
I had pre-installed AutoGluon
, which had different package requirements for mlforecast and utilsforecast. I did
! pip install --upgrade mlforecast
! pip install --upgrade utilsforecast
and now i can import properly
What happened + What you expected to happen
When trying to import from mlforecast.auto in a notebook I receive an ImportError: cannot import name '_get_model_name' from 'mlforecast.core'
Trying to reproduce the hyperparameter tuning guide (https://nixtlaverse.nixtla.io/mlforecast/docs/how-to-guides/hyperparameter_optimization.html#imports)
Versions / Dependencies
mlforecast is 0.13.0.
Reproduction script
import os import tempfile
import lightgbm as lgb import optuna import pandas as pd from datasetsforecast.m4 import M4, M4Evaluation, M4Info from sklearn.linear_model import Ridge from sklearn.compose import ColumnTransformer from sklearn.pipeline import make_pipeline from sklearn.preprocessing import OneHotEncoder from utilsforecast.plotting import plot_series
from mlforecast import MLForecast from mlforecast.auto import ( AutoLightGBM, AutoMLForecast, AutoModel, AutoRidge, ridge_space, ) from mlforecast.lag_transforms import ExponentiallyWeightedMean, RollingMean
Issue Severity
High: It blocks me from completing my task.