Get the group of the Dataset. Returns ------- group : numpy array or None Group size of each group.
(self)
| 1544 | return self.data |
| 1545 | |
| 1546 | def get_group(self): |
| 1547 | """Get the group of the Dataset. |
| 1548 | |
| 1549 | Returns |
| 1550 | ------- |
| 1551 | group : numpy array or None |
| 1552 | Group size of each group. |
| 1553 | """ |
| 1554 | if self.group is None: |
| 1555 | self.group = self.get_field('group') |
| 1556 | if self.group is not None: |
| 1557 | # group data from LightGBM is boundaries data, need to convert to group size |
| 1558 | self.group = np.diff(self.group) |
| 1559 | return self.group |
| 1560 | |
| 1561 | def num_data(self): |
| 1562 | """Get the number of rows in the Dataset. |