TextData.sample#

TextData.sample(n_samples: int, replace: bool = False, random_state: Optional[int] = None, drop_na_label: bool = False) TDataset[source]#

Create a copy of the dataset object, with the internal data being a sample of the original data.

Parameters
n_samplesint

Number of samples to draw.

replacebool, default: False

Whether to sample with replacement.

random_statet.Optional[int] , default None

Random state.

drop_na_labelbool, default: False

Whether to take sample only from rows with exiting label.

Returns
Dataset

instance of the Dataset with sampled internal dataframe.