This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def generate_dataset(n_rows, num_count, cat_count, max_nan=0.1, max_cat_size=100): | |
"""Randomly generate datasets with numerical and categorical features. | |
The numerical features are taken from the normal distribution X ~ N(0, 1). | |
The categorical features are generated as random uuid4 strings with | |
cardinality C where 2 <= C <= max_cat_size. | |
Also, a max_nan proportion of both numerical and categorical features is replaces | |
with NaN values. | |
""" |