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

After executing add_features_from() many dataset fields remain unchanged #2603

Closed
StrikerRUS opened this issue Dec 1, 2019 · 1 comment · Fixed by #2754
Closed

After executing add_features_from() many dataset fields remain unchanged #2603

StrikerRUS opened this issue Dec 1, 2019 · 1 comment · Fixed by #2754
Labels

Comments

@StrikerRUS
Copy link
Collaborator

Dataset's add_features_from() method makes a lot of fields outdated and it's very confusing.
For example:

import numpy as np
import lightgbm as lgb

X1 = np.random.random((100, 2))
y1 = np.random.random(100)
lgb_data1 = lgb.Dataset(X1, y1, free_raw_data=False).construct()

X2 = np.random.random((100, 1))
y2 = np.random.random(100)
lgb_data2 = lgb.Dataset(X2, y2, free_raw_data=False).construct()

lgb_data2.add_features_from(lgb_data1)

lgb_data2.get_data().shape
>>> (100, 1)  # should be (100, 3)

lgb_data2._dump_text('dump.txt')
>>> feature_names: Column_0, Column_0, Column_1,  # duplicated column names

Gently ping @remcob-gr as author of #2006.

@StrikerRUS StrikerRUS added the bug label Dec 1, 2019
@guolinke guolinke mentioned this issue Feb 8, 2020
2 tasks
@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity since it was closed. To start a new related discussion, open a new issue at https://github.com/microsoft/LightGBM/issues including a reference to this.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant