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

Method set_group

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

Set group size of Dataset (used for ranking). Parameters ---------- group : list, numpy 1-D array, pandas Series or None Group size of each group. Returns ------- self : Dataset Dataset with set group.

(self, group)

Source from the content-addressed store, hash-verified

1437 return self
1438
1439 def set_group(self, group):
1440 """Set group size of Dataset (used for ranking).
1441
1442 Parameters
1443 ----------
1444 group : list, numpy 1-D array, pandas Series or None
1445 Group size of each group.
1446
1447 Returns
1448 -------
1449 self : Dataset
1450 Dataset with set group.
1451 """
1452 self.group = group
1453 if self.handle is not None and group is not None:
1454 group = list_to_1d_numpy(group, np.int32, name='group')
1455 self.set_field('group', group)
1456 return self
1457
1458 def get_label(self):
1459 """Get the label of the Dataset.

Callers 2

_lazy_initMethod · 0.95
constructMethod · 0.95

Calls 2

set_fieldMethod · 0.95
list_to_1d_numpyFunction · 0.85

Tested by

no test coverage detected