optimize_category_assignment_parallel#
- obsidian.experiment.advanced_design.optimize_category_assignment_parallel(cat_samples, conditional_subparameters, subparam_mapping, n_samples, seed, max_workers=4, n_category_trials=100, corr_threshold=0.01)[source]#
Search for the category assignment (for the variable that has a subparam mapping) that minimizes the maximum inter-category correlation.
- Parameters:
cat_samples – Dict of already-sampled categorical columns (excluding the variable being optimized).
conditional_subparameters – Full conditional subparameter specification.
subparam_mapping – Dict mapping each categorical variable to its subparameter.
n_samples – Number of rows in the design.
seed – Base random seed.
max_workers – Maximum number of parallel threads. Defaults to 4.
n_category_trials – Number of random assignments to evaluate. Defaults to 100.
corr_threshold – Stop early if max correlation drops below this value. Defaults to 0.01.
- Returns:
Best-found list of category values for the optimized variable.
- Return type:
list