mirror of
https://github.com/ANL-CEEESA/MIPLearn.git
synced 2025-12-08 18:38:51 -06:00
Remove obsolete methods
This commit is contained in:
@@ -13,7 +13,6 @@ from miplearn.classifiers.threshold import MinProbabilityThreshold
|
||||
from miplearn.components import classifier_evaluation_dict
|
||||
from miplearn.components.dynamic_lazy import DynamicLazyConstraintsComponent
|
||||
from miplearn.features import (
|
||||
TrainingSample,
|
||||
Features,
|
||||
InstanceFeatures,
|
||||
Sample,
|
||||
@@ -24,60 +23,6 @@ from miplearn.solvers.tests import assert_equals
|
||||
E = 0.1
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def training_instances_old() -> List[Instance]:
|
||||
instances = [cast(Instance, Mock(spec=Instance)) for _ in range(2)]
|
||||
instances[0].features = Features(
|
||||
instance=InstanceFeatures(
|
||||
user_features=[50.0],
|
||||
),
|
||||
)
|
||||
instances[0].training_data = [
|
||||
TrainingSample(lazy_enforced={"c1", "c2"}),
|
||||
TrainingSample(lazy_enforced={"c2", "c3"}),
|
||||
]
|
||||
instances[0].get_constraint_category = Mock( # type: ignore
|
||||
side_effect=lambda cid: {
|
||||
"c1": "type-a",
|
||||
"c2": "type-a",
|
||||
"c3": "type-b",
|
||||
"c4": "type-b",
|
||||
}[cid]
|
||||
)
|
||||
instances[0].get_constraint_features = Mock( # type: ignore
|
||||
side_effect=lambda cid: {
|
||||
"c1": [1.0, 2.0, 3.0],
|
||||
"c2": [4.0, 5.0, 6.0],
|
||||
"c3": [1.0, 2.0],
|
||||
"c4": [3.0, 4.0],
|
||||
}[cid]
|
||||
)
|
||||
instances[1].features = Features(
|
||||
instance=InstanceFeatures(
|
||||
user_features=[80.0],
|
||||
),
|
||||
)
|
||||
instances[1].training_data = [
|
||||
TrainingSample(lazy_enforced={"c3", "c4"}),
|
||||
]
|
||||
instances[1].get_constraint_category = Mock( # type: ignore
|
||||
side_effect=lambda cid: {
|
||||
"c1": None,
|
||||
"c2": "type-a",
|
||||
"c3": "type-b",
|
||||
"c4": "type-b",
|
||||
}[cid]
|
||||
)
|
||||
instances[1].get_constraint_features = Mock( # type: ignore
|
||||
side_effect=lambda cid: {
|
||||
"c2": [7.0, 8.0, 9.0],
|
||||
"c3": [5.0, 6.0],
|
||||
"c4": [7.0, 8.0],
|
||||
}[cid]
|
||||
)
|
||||
return instances
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def training_instances() -> List[Instance]:
|
||||
instances = [cast(Instance, Mock(spec=Instance)) for _ in range(2)]
|
||||
|
||||
Reference in New Issue
Block a user