Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with AutoTS, no parameter "transformers_params" #83

Closed
ksetdekov opened this issue Mar 19, 2023 · 1 comment
Closed

Issue with AutoTS, no parameter "transformers_params" #83

ksetdekov opened this issue Mar 19, 2023 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@ksetdekov
Copy link

馃悰 Bug

When installing in a fresh venv, version from pip does not support transformers_params argument in lightautoml.addons.autots.base.AutoTS

To Reproduce

Steps to reproduce the behavior:

  1. get python Python 3.8.10 (v3.8.10:3d8993a744, May 3 2021, 08:55:58)
  2. install lightautoml==0.3.7.3
pip install lightautoml
  1. get code from master/examples/demo13.py
  2. try to run
import numpy as np
import pandas as pd

from sklearn.metrics import mean_absolute_error

from lightautoml.addons.autots.base import AutoTS
from lightautoml.tasks import Task


np.random.seed(42)

data = pd.read_csv("data/ai92_value_77.csv")
horizon = 30

train = data[:-horizon]
test = data[-horizon:]

roles = {"target": "value", "datetime": "date"}

seq_params = {
    "seq0": {
        "case": "next_values",
        "params": {"n_target": horizon, "history": np.maximum(7, horizon), "step": 1, "test_last": True},
    },
}

# True (then set default values) / False; int, list or np.array
# default: lag_features=30, diff_features=7
transformers_params = {
    "lag_features": [0, 1, 2, 3, 5, 10],
    "lag_time_features": [0, 1, 2],
    "diff_features": [0, 1, 3, 4],
}

task = Task("multi:reg", greater_is_better=False, metric="mae", loss="mae")

automl = AutoTS(
    task,
    seq_params=seq_params,
    trend_params={
        "trend": False,
    },
    transformers_params=transformers_params,
)
train_pred, _ = automl.fit_predict(train, roles, verbose=4)
forecast, _ = automl.predict(train)

print("Check scores...")
print("TEST score: {}".format(mean_absolute_error(test[roles["target"]].values, forecast.data)))
  1. get error:
multi:reg isn`t supported in lgb
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
Cell In[4], line 20
     12 transformers_params = {
     13     "lag_features": [0, 1, 2, 3, 5, 10],
     14     "lag_time_features": [0, 1, 2],
     15     "diff_features": [0, 1, 3, 4],
     16 }
     18 task = Task("multi:reg", greater_is_better=False, metric="mae", loss="mae")
---> 20 automl = AutoTS(
     21     task,
     22     seq_params=seq_params,
     23     trend_params={
     24         "trend": False,
     25     },
     26     transformers_params=transformers_params,
     27 )
     28 train_pred, _ = automl.fit_predict(train, roles, verbose=4)
     29 forecast, _ = automl.predict(train)

TypeError: __init__() got an unexpected keyword argument 'transformers_params'

Expected behavior

  • code runs
  • get TEST score print at the end

Additional context

  • Running with jupyter notebook
  • OS: macOS Ventura 13.2
@ksetdekov ksetdekov added the bug Something isn't working label Mar 19, 2023
@elineii
Copy link
Collaborator

elineii commented Jul 3, 2023

Hi @ksetdekov,

This error occurs because the corresponding functionality is present in the version from the master branch available on github, but not in the latest release on pypi. The bug will be fixed after a fresh release.

Alina

@elineii elineii closed this as completed Jul 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants