add contextual variable - #69
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #69 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 5 5
Lines 599 621 +22
=========================================
+ Hits 599 621 +22 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
I'm happy with the idea, but within most generators then, we need to be careful to select only those variables that aren't ContextualVariables before sampling over the domain, right? With some Whereas Maybe I'm misunderstanding. |
|
That is generally correct, but I would assert that this should be handled on a per package/generator level since each package could treat this differently. Note that in the context of Contextual BO, we need to build the model over the full vocs domain, and then we fix the context value, based on our experience, it makes more sense to keep it in the domain output |
This pull request introduces support for contextual variables in the
VOCSclass and updates related logic to handle them appropriately. Contextual variables are those that effect objectives/constraints of interest, but are measured and cannot be controlled directly. As such they are listed as variables. By default they have (-inf, inf) bounds, but these bounds can be overwritten if finite bounds are required (to be implemented by the package).Support for Contextual Variables:
ContextualVariableclass as a subclass ofContinuousVariableingest_api/vocs.pyto represent contextual variables.has_contextual_variablesproperty to theVOCSclass to indicate if any contextual variables are present.Testing:
test_has_contextual_variables_propertyingest_api/tests/test_vocs.pyto verify the behavior of thehas_contextual_variablesproperty and ensure contextual variables are excluded from bounds.ContextualVariablein the test file to support the new tests.