mirror of
https://github.com/ANL-CEEESA/MIPLearn.git
synced 2025-12-06 09:28:51 -06:00
Reorganize imports; start moving data to instance.training_data
This commit is contained in:
@@ -4,8 +4,10 @@
|
||||
|
||||
from unittest.mock import Mock, call
|
||||
|
||||
from miplearn import Component, LearningSolver, Instance
|
||||
from miplearn.components.component import Component
|
||||
from miplearn.components.composite import CompositeComponent
|
||||
from miplearn.instance import Instance
|
||||
from miplearn.solvers.learning import LearningSolver
|
||||
|
||||
|
||||
def test_composite():
|
||||
|
||||
@@ -5,11 +5,14 @@
|
||||
from unittest.mock import Mock
|
||||
|
||||
import numpy as np
|
||||
from miplearn import DynamicLazyConstraintsComponent, LearningSolver, InternalSolver
|
||||
from miplearn.classifiers import Classifier
|
||||
from miplearn.tests import get_test_pyomo_instances
|
||||
from numpy.linalg import norm
|
||||
|
||||
from miplearn.classifiers import Classifier
|
||||
from miplearn.components.lazy_dynamic import DynamicLazyConstraintsComponent
|
||||
from miplearn.solvers.internal import InternalSolver
|
||||
from miplearn.solvers.learning import LearningSolver
|
||||
from miplearn.tests import get_test_pyomo_instances
|
||||
|
||||
E = 0.1
|
||||
|
||||
|
||||
|
||||
@@ -4,13 +4,11 @@
|
||||
|
||||
from unittest.mock import Mock, call
|
||||
|
||||
from miplearn import (
|
||||
StaticLazyConstraintsComponent,
|
||||
LearningSolver,
|
||||
Instance,
|
||||
InternalSolver,
|
||||
)
|
||||
from miplearn.classifiers import Classifier
|
||||
from miplearn.components.lazy_static import StaticLazyConstraintsComponent
|
||||
from miplearn.instance import Instance
|
||||
from miplearn.solvers.internal import InternalSolver
|
||||
from miplearn.solvers.learning import LearningSolver
|
||||
|
||||
|
||||
def test_usage_with_solver():
|
||||
@@ -49,7 +47,9 @@ def test_usage_with_solver():
|
||||
)
|
||||
|
||||
component = StaticLazyConstraintsComponent(
|
||||
threshold=0.90, use_two_phase_gap=False, violation_tolerance=1.0
|
||||
threshold=0.90,
|
||||
use_two_phase_gap=False,
|
||||
violation_tolerance=1.0,
|
||||
)
|
||||
component.classifiers = {
|
||||
"type-a": Mock(spec=Classifier),
|
||||
|
||||
@@ -5,8 +5,9 @@
|
||||
from unittest.mock import Mock
|
||||
|
||||
import numpy as np
|
||||
from miplearn import ObjectiveValueComponent
|
||||
|
||||
from miplearn.classifiers import Regressor
|
||||
from miplearn.components.objective import ObjectiveValueComponent
|
||||
from miplearn.tests import get_test_pyomo_instances
|
||||
|
||||
|
||||
|
||||
@@ -5,8 +5,9 @@
|
||||
from unittest.mock import Mock
|
||||
|
||||
import numpy as np
|
||||
from miplearn import PrimalSolutionComponent
|
||||
|
||||
from miplearn.classifiers import Classifier
|
||||
from miplearn.components.primal import PrimalSolutionComponent
|
||||
from miplearn.tests import get_test_pyomo_instances
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user