qxmt.datasets.raw_preprocess.sampling module#
- qxmt.datasets.raw_preprocess.sampling.sampling_by_each_class(X, y, n_samples, labels, random_seed)
Data sampling by each class
- Parameters:
X (np.ndarray) – input data
y (np.ndarray) – label of input data
n_samples (int) – number of samples to be extracted
labels (list[int]) – labels to be extracted
random_seed (int) – random seed
- Returns:
sampled data
- Return type:
RAW_DATASET_TYPE
- qxmt.datasets.raw_preprocess.sampling.sampling_by_num(X, y, n_samples, random_seed)
Data sampling by number of samples
- Parameters:
X (np.ndarray) – input data
y (np.ndarray) – label of input data
n_samples (int) – number of samples to be extracted
random_seed (int) – random seed
- Returns:
sampled data
- Return type:
RAW_DATASET_TYPE