Get the number of columns (features) in the Dataset. Returns ------- number_of_columns : int The number of columns (features) in the Dataset.
(self)
| 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. |
| 1579 | |
| 1580 | Returns |
| 1581 | ------- |
| 1582 | number_of_columns : int |
| 1583 | The number of columns (features) in the Dataset. |
| 1584 | """ |
| 1585 | if self.handle is not None: |
| 1586 | ret = ctypes.c_int() |
| 1587 | _safe_call(_LIB.LGBM_DatasetGetNumFeature(self.handle, |
| 1588 | ctypes.byref(ret))) |
| 1589 | return ret.value |
| 1590 | else: |
| 1591 | raise LightGBMError("Cannot get num_feature before construct dataset") |
| 1592 | |
| 1593 | def get_ref_chain(self, ref_limit=100): |
| 1594 | """Get a chain of Dataset objects. |
no test coverage detected