Measurement-only variable #263
-
Hi all I'm trying to add variables for elements like ambient temperature / humidity that might have day to day variation but cannot be directly controlled for an experiment. I think I've found a way to do that for NumericalDiscreteParameters via DiscreteCustomConstraint. It has the expected behavior of loading in my prior data with varying temperature values without error and all recommended experiments have the suggested lab temp of 22 e.g.
However I've tried to do the same for a categorical parameter with the same technique
And while the recommendations produced do consistently have the "Lab_practitioner" parameter set to "any", on the loading of my pre-existing dataset I get the following error for every row of the dataframe:
I'm wondering if this is an intended use case and if so whether there would be a alternate way to implement something like this |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Hey @JamesBagley , What happens with discrete constaints including Why does that cause the error you're seeing For For In the meantime, you can continue fixing your problem because Constraints are not the right thing for your problem Using Metadata # find indices of parameter values that you dont want recommended
dont_recommend_idxs = searchspace.discrete.exp_rep['Lab_temperature'] != 22
# restrict recommendations via metadata
searchspace.discrete.metadata.loc[dont_recommend_idxs, 'dont_recommend'] = True I think given the filtration capabilities you have here when doing the index search makes values like This is somewhat cumbersome, so we plan to generalize The Exogeneous parameters |
Beta Was this translation helpful? Give feedback.
Hey @JamesBagley ,
What happens with discrete constaints including
CustomDiscreteConstraint
After the searchspace is built form all parameter combinations you specified, we filter the entries according to all discrete constraints you provided. This means that even though you specify a
CategoricalParameter
withvalues=['A','B','C']
, the searchspace will contain only entries withA
if you also provided a constraint that marksB
andC
as invalid.BTW you could also use a
DiscreteExludeConstraint
with aSubSelectionCondition
in your case because its about simple filtering of values.Why does that cause the error you're seeing
Here we have to make a distinction between
NumericalDiscreteParameter
…