Remove experimental LP components

This commit is contained in:
2021-04-06 16:36:14 -05:00
parent f90f295620
commit f495297168
16 changed files with 49 additions and 1125 deletions

View File

@@ -45,7 +45,7 @@ class StaticLazyConstraintsComponent(Component):
self.thresholds: Dict[Hashable, Threshold] = {}
self.pool: Dict[str, LazyConstraint] = {}
self.violation_tolerance: float = violation_tolerance
self.enforced_cids: Set[str] = set()
self.enforced_cids: Set[Hashable] = set()
self.n_restored: int = 0
self.n_iterations: int = 0
@@ -145,11 +145,11 @@ class StaticLazyConstraintsComponent(Component):
self,
instance: "Instance",
sample: TrainingSample,
) -> List[str]:
) -> List[Hashable]:
assert instance.features.constraints is not None
x, y = self.sample_xy(instance, sample)
category_to_cids: Dict[Hashable, List[str]] = {}
category_to_cids: Dict[Hashable, List[Hashable]] = {}
for (cid, cfeatures) in instance.features.constraints.items():
if cfeatures.category is None:
continue
@@ -157,7 +157,7 @@ class StaticLazyConstraintsComponent(Component):
if category not in category_to_cids:
category_to_cids[category] = []
category_to_cids[category] += [cid]
enforced_cids: List[str] = []
enforced_cids: List[Hashable] = []
for category in x.keys():
if category not in self.classifiers:
continue