sample_design#
- obsidian.experiment.advanced_design.sample_design(seed, n_samples, continuous_params, conditional_subparameters, subparam_mapping=None, optimize_categories=False, n_category_trials=100, corr_threshold=0.01)[source]#
Generate a complete experimental design by LHS-sampling all continuous and categorical parameters.
- Parameters:
seed – Random seed for reproducibility.
n_samples – Number of rows to generate.
continuous_params – Continuous parameter specifications (see
_get_param_levels).conditional_subparameters – Conditional categorical/subparameter specifications.
subparam_mapping – Dict mapping categorical variables to their subparameters. Inferred automatically if not provided.
optimize_categories – Whether to optimize the category assignment for the variable that has a subparam mapping to reduce inter-category correlation. Defaults to False.
n_category_trials – Number of random assignments evaluated during category optimization. Defaults to 100.
corr_threshold – Early-exit correlation threshold for category optimization. Defaults to 0.01.
- Returns:
The generated design with appropriately rounded values.
- Return type:
pd.DataFrame
Note
When
optimize_categories=True, only the first subparam-mapped category (as determined bysubparam_mapping) is optimized. Additional categorical variables are assigned with a single random draw.