code: def num_feature(self):
          
          if self.handle is not None:
              ret = ctypes.c_int()
              _safe_call(_LIB.LGBM_DatasetGetNumFeature(self.handle,
                                                        ctypes.byref(ret)))
              return ret.value
          else:
              raise LightGBMError("Cannot get num_feature before construct dataset")
docs: Get the number of columns (features) in the Dataset.
  
          Returns
          -------
          number_of_columns : int
              The number of columns (features) in the Dataset.