MCPcopy Create free account
hub / github.com/antmachineintelligence/mtgbmcode / num_feature

Method num_feature

python-package/lightgbmmt/basic.py:1577–1591  ·  view source on GitHub ↗

Get the number of columns (features) in the Dataset. Returns ------- number_of_columns : int The number of columns (features) in the Dataset.

(self)

Source from the content-addressed store, hash-verified

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.

Callers 1

set_feature_nameMethod · 0.95

Calls 2

_safe_callFunction · 0.85
LightGBMErrorClass · 0.85

Tested by

no test coverage detected