Add sqlite config

Add sqlite to report_score
This commit is contained in:
2021-06-30 09:23:58 +02:00
parent 641defd109
commit e36fed491b
8 changed files with 37 additions and 4 deletions

View File

@@ -126,11 +126,13 @@ def process_dataset(dataset, verbose, model, params):
record = dbh.find_best(dataset, model, "gridsearch")
hyperparameters = json.loads(record[8] if record[8] != "" else "{}")
hyperparameters.pop("random_state", None)
print("*" * 100)
for random_state in random_seeds:
random.seed(random_state)
np.random.seed(random_state)
kfold = KFold(shuffle=True, random_state=random_state, n_splits=5)
clf = get_classifier(model, random_state, hyperparameters)
print(hyperparameters)
res = cross_validate(clf, X, y, cv=kfold, return_estimator=True)
scores.append(res["test_score"])
times.append(res["fit_time"])
@@ -361,7 +363,7 @@ standardize = False
excel,
discretize,
) = parse_arguments()
# parameters = '{"splitter":"cfs","max_features":"auto"}'
# parameters = '{"kernel":"rbf","max_features":"auto"}'
dbh = MySQL()
if sql:
sql_output = open(f"{model}.sql", "w")