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