mirror of
https://github.com/ANL-CEEESA/MIPLearn.git
synced 2025-12-06 09:28:51 -06:00
Finish TSP implementation; improve performance of Extractors
This commit is contained in:
@@ -27,29 +27,7 @@ def test_predict():
|
||||
instances, models = _get_instances()
|
||||
comp = PrimalSolutionComponent()
|
||||
comp.fit(instances)
|
||||
solution = comp.predict(instances[0], models[0])
|
||||
assert models[0].x in solution.keys()
|
||||
solution = comp.predict(instances[0])
|
||||
assert "x" in solution
|
||||
for idx in range(4):
|
||||
assert idx in solution[models[0].x].keys()
|
||||
|
||||
# def test_warm_start_save_load():
|
||||
# state_file = tempfile.NamedTemporaryFile(mode="r")
|
||||
# solver = LearningSolver(components={"warm-start": WarmStartComponent()})
|
||||
# solver.parallel_solve(_get_instances(), n_jobs=2)
|
||||
# solver.fit()
|
||||
# comp = solver.components["warm-start"]
|
||||
# assert comp.x_train["default"].shape == (8, 6)
|
||||
# assert comp.y_train["default"].shape == (8, 2)
|
||||
# assert ("default", 0) in comp.predictors.keys()
|
||||
# assert ("default", 1) in comp.predictors.keys()
|
||||
# solver.save_state(state_file.name)
|
||||
|
||||
# solver.solve(_get_instances()[0])
|
||||
|
||||
# solver = LearningSolver(components={"warm-start": WarmStartComponent()})
|
||||
# solver.load_state(state_file.name)
|
||||
# comp = solver.components["warm-start"]
|
||||
# assert comp.x_train["default"].shape == (8, 6)
|
||||
# assert comp.y_train["default"].shape == (8, 2)
|
||||
# assert ("default", 0) in comp.predictors.keys()
|
||||
# assert ("default", 1) in comp.predictors.keys()
|
||||
assert idx in solution["x"]
|
||||
|
||||
Reference in New Issue
Block a user