Convert Features into dataclass

This commit is contained in:
2021-04-04 22:37:16 -05:00
parent f2520f33fb
commit 59f4f75a53
12 changed files with 77 additions and 67 deletions

View File

@@ -77,9 +77,10 @@ class ObjectiveValueComponent(Component):
features: Features,
sample: TrainingSample,
) -> Tuple[Dict[Hashable, List[List[float]]], Dict[Hashable, List[List[float]]]]:
assert features.instance is not None
x: Dict[Hashable, List[List[float]]] = {}
y: Dict[Hashable, List[List[float]]] = {}
f = list(features["Instance"]["User features"])
f = list(features.instance["User features"])
if "LP value" in sample and sample["LP value"] is not None:
f += [sample["LP value"]]
for c in ["Upper bound", "Lower bound"]: