qolmat.utils.data.add_holes¶
- qolmat.utils.data.add_holes(df: DataFrame, ratio_masked: float, mean_size: int, random_state: Optional[Union[int, RandomState]] = None) DataFrame[source]¶
Create holes in a dataset with no missing value, starting from df.
Only used in the documentation to design examples.
- Parameters
- dfpd.DataFrame
dataframe no missing values
- mean_sizeint
Targeted mean size of the holes to add
- ratio_maskedfloat
Targeted global proportion of nans added in the returned dataset
- random_state: RandomSetting
Random state for reproducibility
- Returns
- pd.DataFrame
dataframe with missing values