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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug in make_leads function #467

Open
amir-keramatian opened this issue Mar 30, 2024 · 0 comments
Open

Bug in make_leads function #467

amir-keramatian opened this issue Mar 30, 2024 · 0 comments

Comments

@amir-keramatian
Copy link

Bug in the following file: https://github.com/Kaggle/learntools/blob/master/learntools/time_series/utils.py

The function doesn't correctly create the leads. For example, setting leads to 1, it just copies the existing columns under a new column named: {name}_lead_0. See the attached screenshot for an example.

def make_leads(ts, leads, name='y'):
return pd.concat(
{f'{name}lead{i}': ts.shift(-i)
for i in reversed(range(leads))},
axis=1)

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant