MD-metrics-HPO
HuangJintao 6 months ago
parent c1e07eabb6
commit f1e732afaf

@ -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
)

@ -155,6 +155,7 @@ def matching(config: Configuration, blocking_result_):
predictions = predictions.reset_index(drop=True)
predictions = predictions.astype(str)
# 目前predictions包含的属性左右表全部属性+gold+predicted
sim_tensor_dict = build_col_pairs_sim_tensor_dict(predictions)
predictions['confidence'] = 0

@ -1,4 +1,4 @@
from ml_er.magellan_new import blocking_mining
from ml_er.magellan_er import blocking_mining
if __name__ == '__main__':
blocking_mining()

Loading…
Cancel
Save