StaticLazy: Refactor

This commit is contained in:
2021-04-04 08:39:56 -05:00
parent 168f56c296
commit 6e614264b5
8 changed files with 340 additions and 429 deletions

View File

@@ -58,8 +58,8 @@ class ObjectiveValueComponent(Component):
def fit_xy(
self,
x: Dict[str, np.ndarray],
y: Dict[str, np.ndarray],
x: Dict[Hashable, np.ndarray],
y: Dict[Hashable, np.ndarray],
) -> None:
for c in ["Upper bound", "Lower bound"]:
if c in y:
@@ -84,9 +84,9 @@ class ObjectiveValueComponent(Component):
def sample_xy(
features: Features,
sample: TrainingSample,
) -> Tuple[Dict[str, List[List[float]]], Dict[str, List[List[float]]]]:
x: Dict[str, List[List[float]]] = {}
y: Dict[str, List[List[float]]] = {}
) -> Tuple[Dict[Hashable, List[List[float]]], Dict[Hashable, List[List[float]]]]:
x: Dict[Hashable, List[List[float]]] = {}
y: Dict[Hashable, List[List[float]]] = {}
f = list(features["Instance"]["User features"])
if "LP value" in sample and sample["LP value"] is not None:
f += [sample["LP value"]]