Description
Currently, I am working on condensing the return values of suggest, and the arguments of register into a class, which in many ways acts as a named tuple. Because of this, I have been looking into the structure of these classes as per comments on #771.
With the current implementation, it is possible to register multiple configurations simultaneously using the register function, however, this feature does not seem to be utilized in the test cases nor in mlos_bench. Additionally, it causes our observations to be lists of variable-length data frames.
I would propose that instead of supporting bulk registrations directly in the register function, we split this functionality out into an additional function (potentially called bulk_register) that calls into register. This would have the added benefit that it would remove the variable length list of dataframes in our observations as seen in opimizer.py
.
self._observations: List[Tuple[pd.DataFrame, pd.DataFrame, Optional[pd.DataFrame]]] = []
This would then allow for a representation of singular observations through an Observation
object` turning the type on this object into:
self._observations: List[Observation] = []
Observation would be a implemented as such:
class Observation:
def __init__(
self,
*,
config: pd.Series,
performance: Optional[pd.Series] = None,
context: Optional[pd.Series] = None,
metadata: Optional[pd.Series] = None,
):
self.config = config
self.performance = performance
self.context = context
self.metadata = metadata
...