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:
@@ -3,17 +3,17 @@
|
||||
# Released under the modified BSD license. See COPYING.md for more details.
|
||||
|
||||
import logging
|
||||
import random
|
||||
from copy import deepcopy
|
||||
|
||||
import numpy as np
|
||||
from tqdm import tqdm
|
||||
import random
|
||||
|
||||
from ... import Component
|
||||
from ...classifiers.counting import CountingClassifier
|
||||
from ...components import classifier_evaluation_dict
|
||||
from ...extractors import InstanceIterator
|
||||
from .drop_redundant import DropRedundantInequalitiesStep
|
||||
from miplearn.classifiers.counting import CountingClassifier
|
||||
from miplearn.components import classifier_evaluation_dict
|
||||
from miplearn.components.component import Component
|
||||
from miplearn.components.steps.drop_redundant import DropRedundantInequalitiesStep
|
||||
from miplearn.extractors import InstanceIterator
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@@ -8,9 +8,9 @@ from copy import deepcopy
|
||||
import numpy as np
|
||||
from tqdm import tqdm
|
||||
|
||||
from miplearn import Component
|
||||
from miplearn.classifiers.counting import CountingClassifier
|
||||
from miplearn.components import classifier_evaluation_dict
|
||||
from miplearn.components.component import Component
|
||||
from miplearn.components.lazy_static import LazyConstraint
|
||||
from miplearn.extractors import InstanceIterator
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
import logging
|
||||
|
||||
from miplearn import Component
|
||||
from miplearn.components.component import Component
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
from miplearn import LearningSolver, GurobiSolver, Instance, Classifier
|
||||
from unittest.mock import Mock
|
||||
|
||||
from miplearn.classifiers import Classifier
|
||||
from miplearn.components.steps.convert_tight import ConvertTightIneqsIntoEqsStep
|
||||
from miplearn.components.steps.relax_integrality import RelaxIntegralityStep
|
||||
from miplearn.instance import Instance
|
||||
from miplearn.problems.knapsack import GurobiKnapsackInstance
|
||||
|
||||
from unittest.mock import Mock
|
||||
from miplearn.solvers.gurobi import GurobiSolver
|
||||
from miplearn.solvers.learning import LearningSolver
|
||||
|
||||
|
||||
def test_convert_tight_usage():
|
||||
@@ -40,7 +43,6 @@ def test_convert_tight_usage():
|
||||
class TestInstance(Instance):
|
||||
def to_model(self):
|
||||
import gurobipy as grb
|
||||
from gurobipy import GRB
|
||||
|
||||
m = grb.Model("model")
|
||||
x1 = m.addVar(name="x1")
|
||||
|
||||
@@ -2,21 +2,15 @@
|
||||
# Copyright (C) 2020, UChicago Argonne, LLC. All rights reserved.
|
||||
# Released under the modified BSD license. See COPYING.md for more details.
|
||||
|
||||
import numpy as np
|
||||
from unittest.mock import Mock, call
|
||||
|
||||
from miplearn import (
|
||||
LearningSolver,
|
||||
Instance,
|
||||
InternalSolver,
|
||||
GurobiSolver,
|
||||
)
|
||||
import numpy as np
|
||||
|
||||
from miplearn.classifiers import Classifier
|
||||
from miplearn.components.relaxation import (
|
||||
DropRedundantInequalitiesStep,
|
||||
RelaxIntegralityStep,
|
||||
)
|
||||
from miplearn.problems.knapsack import GurobiKnapsackInstance
|
||||
from miplearn.components.relaxation import DropRedundantInequalitiesStep
|
||||
from miplearn.instance import Instance
|
||||
from miplearn.solvers.internal import InternalSolver
|
||||
from miplearn.solvers.learning import LearningSolver
|
||||
|
||||
|
||||
def _setup():
|
||||
|
||||
Reference in New Issue
Block a user