Get the number of rows in the Dataset. Returns ------- number_of_rows : int The number of rows in the Dataset.
(self)
| 1559 | return self.group |
| 1560 | |
| 1561 | def num_data(self): |
| 1562 | """Get the number of rows in the Dataset. |
| 1563 | |
| 1564 | Returns |
| 1565 | ------- |
| 1566 | number_of_rows : int |
| 1567 | The number of rows in the Dataset. |
| 1568 | """ |
| 1569 | if self.handle is not None: |
| 1570 | ret = ctypes.c_int() |
| 1571 | _safe_call(_LIB.LGBM_DatasetGetNumData(self.handle, |
| 1572 | ctypes.byref(ret))) |
| 1573 | return ret.value |
| 1574 | else: |
| 1575 | raise LightGBMError("Cannot get num_data before construct dataset") |
| 1576 | |
| 1577 | def num_feature(self): |
| 1578 | """Get the number of columns (features) in the Dataset. |
no test coverage detected