holisticai.datasets.GroupByDataset#

class holisticai.datasets.GroupByDataset(groupby_obj)[source]#

A class representing a Grouped Dataset.

Parameters:#

groupby_objpandas.core.groupby.GroupBy

The pandas GroupBy object representing the grouped dataset.

Attributes:#

grouped_nameslist

A list of the names of the groups in the dataset.

featureslist

A list of the unique features in the dataset.

ngroupsint

The number of groups in the dataset.

random_statenumpy.random.RandomState

The random state object used for sampling.

head(k)[source]#

Returns the first k rows of each group in the dataset.

repr_info()[source]#

Returns an HTML representation of the GroupByDataset.

sample(n, random_state=None)[source]#

Returns a random sample of n rows from each group in the dataset.