lightgbm.Sequence — LightGBM 4.6.0.99 documentation (original) (raw)
class lightgbm.Sequence[source]
Bases: ABC
Generic data access interface.
Object should support the following operations:
Get total row number.
len(seq)
Random access by row index. Used for data sampling.
seq[10]
Range data access. Used to read data in batch when constructing Dataset.
seq[0:100]
Optionally specify batch_size to control range data read size.
seq.batch_size
- With random access, data sampling does not need to go through all data.
- With range data access, there’s no need to read all data into memory thus reduce memory usage.
Added in version 3.3.0.
batch_size
Default size of a batch.
Type:
int
__init__()
Methods
Attributes