-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
Take Sequence
into consideration in get_data()
and add_features_from()
methods of Dataset
object
#4403
Comments
I've started working on this. As I don't uses these two APIs, I need some guidence. PR #4472 adds support For
Here's a simple combine Sequence by columns example: class CombineSequenceByColumn(lgb.Sequence):
def __init__(self, seqlst: List[lgb.Sequence], batch_size):
self.seqlst = seqlst
self.batch_size = batch_size
def __getitem__(self, idx):
if isinstance(idx, numbers.Integral):
return np.hstack([arr[idx] for arr in self.seqlst])
elif isinstance(idx, slice):
return np.hstack([arr[idx.start:idx.stop] for arr in self.seqlst])
else:
raise TypeError(f"Sequence Index must be an integer/list/slice, got {type(idx).__name__}")
def __len__(self):
return len(self.seqlst[0]) If we really want to support
This implementation can still retain the benefit of saving memory, but it's a lot of work as we have to adapt various existing supprted types to |
@cyfdecyf Thanks a lot for taking this issue!
Yeah, given your great explanation, I totally agree with you. |
Closed via #4472. |
This issue is actual only after merging #4089.
Refer to #4089 (comment).
The text was updated successfully, but these errors were encountered: