Skip to content

Warning in sklean with using LinearPerSegmentModel and DateFlagsTransform #207

Closed
4 tasks done
Mr-Geekman opened this issue Oct 18, 2021 · 2 comments · Fixed by #250
Closed
4 tasks done

Warning in sklean with using LinearPerSegmentModel and DateFlagsTransform #207

Mr-Geekman opened this issue Oct 18, 2021 · 2 comments · Fixed by #250
Assignees
Labels
bug Something isn't working

Comments

@Mr-Geekman
Copy link
Contributor

🐛 Bug Report

Warning: Arrays of bytes/strings is being converted to decimal numbers if dtype='numeric'. This behavior is deprecated in 0.24 and will be removed in 1.1 (renaming of 0.26). Please convert your data to numeric values explicitly instead.

The problem is caused by category type of the results of DateFlagsTransform (even if they are boolean like in is_weekend).

This warning looks suspicious and something should be done about it.

Expected behavior

No warning.

How To Reproduce

from etna.datasets import generate_periodic_df
from etna.datasets import TSDataset
from etna.models import LinearPerSegmentModel
from etna.transforms import DateFlagsTransform 

classic_df = generate_periodic_df(periods=100, start_time="2020-01-01", n_segments=4, period=7, sigma=3)
df = TSDataset.to_dataset(df=classic_df)
ts = TSDataset(df, freq="D")
transforms = [DateFlagsTransform(is_weekend=True, day_number_in_week=False, day_number_in_month=False)]
ts.fit_transform(transforms)

model = LinearPerSegmentModel()
# here will be warning
model.fit(ts)
# here probably too
ts_future = ts.make_future(1)
model.forecast(ts_future)

Environment

No response

Additional context

No response

Checklist

  • Bug appears at the latest library version
  • Bug description added
  • Steps to reproduce added
  • Expected behavior added
@Mr-Geekman Mr-Geekman added the bug Something isn't working label Oct 18, 2021
@julia-shenshina
Copy link
Contributor

need to be discussed

@julia-shenshina
Copy link
Contributor

Add to_numeric method to *SklearnModels

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants