pub struct ParameterSpace {
pub categorical_params: HashMap<String, CategoricalParameter>,
pub conditional_params: HashMap<String, ConditionalParameter>,
pub constraints: Vec<ParameterConstraint>,
pub dependencies: HashMap<String, HashSet<String>>,
}Expand description
Enhanced parameter space with categorical parameter support
Fields§
§categorical_params: HashMap<String, CategoricalParameter>Base categorical parameters
conditional_params: HashMap<String, ConditionalParameter>Conditional parameters
constraints: Vec<ParameterConstraint>Parameter constraints
dependencies: HashMap<String, HashSet<String>>Parameter dependencies (which parameters depend on which)
Implementations§
Source§impl ParameterSpace
impl ParameterSpace
Sourcepub fn add_categorical_parameter(&mut self, param: CategoricalParameter)
pub fn add_categorical_parameter(&mut self, param: CategoricalParameter)
Add a categorical parameter
Sourcepub fn add_conditional_parameter(&mut self, param: ConditionalParameter)
pub fn add_conditional_parameter(&mut self, param: ConditionalParameter)
Add a conditional parameter
Sourcepub fn add_constraint(&mut self, constraint: ParameterConstraint)
pub fn add_constraint(&mut self, constraint: ParameterConstraint)
Add a constraint
Sourcepub fn sample(&self, rng: &mut impl Rng) -> Result<ParameterSet>
pub fn sample(&self, rng: &mut impl Rng) -> Result<ParameterSet>
Sample a valid parameter set from this space
Sourcepub fn is_valid_parameter_set(&self, params: &ParameterSet) -> bool
pub fn is_valid_parameter_set(&self, params: &ParameterSet) -> bool
Check if a parameter set is valid according to all constraints
Sourcepub fn get_parameter_names(&self) -> HashSet<String>
pub fn get_parameter_names(&self) -> HashSet<String>
Get all possible parameter names
Sourcepub fn get_dependent_parameters(&self, param_name: &str) -> HashSet<String>
pub fn get_dependent_parameters(&self, param_name: &str) -> HashSet<String>
Get parameters that depend on a given parameter
Sourcepub fn get_parameter_dependencies(&self, param_name: &str) -> HashSet<String>
pub fn get_parameter_dependencies(&self, param_name: &str) -> HashSet<String>
Get the dependencies of a parameter
Sourcepub fn sample_with_importance(
&self,
rng: &mut impl Rng,
importance_weights: &HashMap<String, f64>,
) -> Result<ParameterSet>
pub fn sample_with_importance( &self, rng: &mut impl Rng, importance_weights: &HashMap<String, f64>, ) -> Result<ParameterSet>
Generate a smart sample that respects parameter importance
Sourcepub fn add_float_param(&mut self, name: &str, min: f64, max: f64)
pub fn add_float_param(&mut self, name: &str, min: f64, max: f64)
Convenience method to add a float parameter with min/max range
Sourcepub fn add_int_param(&mut self, name: &str, min: i64, max: i64)
pub fn add_int_param(&mut self, name: &str, min: i64, max: i64)
Convenience method to add an integer parameter with min/max range
Sourcepub fn add_categorical_param(&mut self, name: &str, values: Vec<&str>)
pub fn add_categorical_param(&mut self, name: &str, values: Vec<&str>)
Convenience method to add a categorical parameter from string slice
Sourcepub fn add_boolean_param(&mut self, name: &str)
pub fn add_boolean_param(&mut self, name: &str)
Convenience method to add a boolean parameter
Sourcepub fn auto_detect_ranges(parameter_sets: &[ParameterSet]) -> Result<Self>
pub fn auto_detect_ranges(parameter_sets: &[ParameterSet]) -> Result<Self>
Auto-detect parameter ranges from a dataset of parameter sets
Trait Implementations§
Source§impl Clone for ParameterSpace
impl Clone for ParameterSpace
Source§fn clone(&self) -> ParameterSpace
fn clone(&self) -> ParameterSpace
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ParameterSpace
impl Debug for ParameterSpace
Auto Trait Implementations§
impl Freeze for ParameterSpace
impl !RefUnwindSafe for ParameterSpace
impl Send for ParameterSpace
impl Sync for ParameterSpace
impl Unpin for ParameterSpace
impl !UnwindSafe for ParameterSpace
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more