|
|
@ -8,11 +8,11 @@ import py_entitymatching.catalog.catalog_manager as cm
|
|
|
|
import pandas as pd
|
|
|
|
import pandas as pd
|
|
|
|
from smac import HyperparameterOptimizationFacade, Scenario
|
|
|
|
from smac import HyperparameterOptimizationFacade, Scenario
|
|
|
|
|
|
|
|
|
|
|
|
from ml_er.magellan_new import matching
|
|
|
|
from ml_er.magellan_er import matching
|
|
|
|
from settings import *
|
|
|
|
from settings import *
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class Classifier:
|
|
|
|
class Optimization:
|
|
|
|
@property
|
|
|
|
@property
|
|
|
|
def configspace(self) -> ConfigurationSpace:
|
|
|
|
def configspace(self) -> ConfigurationSpace:
|
|
|
|
cs = ConfigurationSpace(seed=0)
|
|
|
|
cs = ConfigurationSpace(seed=0)
|
|
|
@ -68,8 +68,8 @@ class Classifier:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def ml_er_hpo():
|
|
|
|
def ml_er_hpo():
|
|
|
|
classifier = Classifier()
|
|
|
|
optimization = Optimization()
|
|
|
|
cs = classifier.configspace
|
|
|
|
cs = optimization.configspace
|
|
|
|
str_configspace = csj.write(cs)
|
|
|
|
str_configspace = csj.write(cs)
|
|
|
|
dict_configspace = json.loads(str_configspace)
|
|
|
|
dict_configspace = json.loads(str_configspace)
|
|
|
|
# 将超参数空间保存本地
|
|
|
|
# 将超参数空间保存本地
|
|
|
@ -88,7 +88,7 @@ def ml_er_hpo():
|
|
|
|
|
|
|
|
|
|
|
|
smac = HyperparameterOptimizationFacade(
|
|
|
|
smac = HyperparameterOptimizationFacade(
|
|
|
|
scenario,
|
|
|
|
scenario,
|
|
|
|
classifier.train,
|
|
|
|
optimization.train,
|
|
|
|
initial_design=initial_design,
|
|
|
|
initial_design=initial_design,
|
|
|
|
overwrite=True, # If the run exists, we overwrite it; alternatively, we can continue from last state
|
|
|
|
overwrite=True, # If the run exists, we overwrite it; alternatively, we can continue from last state
|
|
|
|
)
|
|
|
|
)
|
|
|
|