mirror of
https://github.com/Doctorado-ML/Stree_datasets.git
synced 2025-08-16 07:56:07 +00:00
Update analysis and report mysql
This commit is contained in:
@@ -46,18 +46,21 @@ class MySQL:
|
||||
|
||||
def find_best(self, dataset, classifier="any", experiment="any"):
|
||||
cursor = self._database.cursor(buffered=True)
|
||||
if classifier == "any":
|
||||
command = (
|
||||
f"select * from results r inner join reference e on "
|
||||
f"r.dataset=e.dataset where r.dataset='{dataset}' and "
|
||||
f"date>='2021-01-20'"
|
||||
)
|
||||
else:
|
||||
command = (
|
||||
f"select * from results r inner join reference e on "
|
||||
f"r.dataset=e.dataset where r.dataset='{dataset}' and "
|
||||
f"classifier='{classifier}' and date>='2021-01-20'"
|
||||
)
|
||||
date_from = "2021-01-20"
|
||||
command = (
|
||||
f"select * from results r inner join reference e on "
|
||||
f"r.dataset=e.dataset where r.dataset='{dataset}'"
|
||||
)
|
||||
if isinstance(classifier, list):
|
||||
classifier_set = "("
|
||||
for i, item in enumerate(classifier):
|
||||
comma = "" if i == 0 else ","
|
||||
classifier_set += f"{comma}'{item}'"
|
||||
classifier_set += ")"
|
||||
command += f" and r.classifier in {classifier_set}"
|
||||
elif classifier != "any":
|
||||
command += f" and r.classifier='{classifier}'"
|
||||
command += f" and date>='{date_from}'"
|
||||
command += "" if experiment == "any" else f" and type='{experiment}'"
|
||||
command += (
|
||||
" order by r.dataset, accuracy desc, classifier desc, "
|
||||
@@ -182,7 +185,8 @@ class BD(ABC):
|
||||
database = dbh.get_connection()
|
||||
command_insert = (
|
||||
"replace into results (date, time, type, accuracy, "
|
||||
"dataset, classifier, norm, stand, parameters, accuracy_std, time_spent, time_spent_std) values (%s, %s, "
|
||||
"dataset, classifier, norm, stand, parameters, accuracy_std, "
|
||||
"time_spent, time_spent_std) values (%s, %s, "
|
||||
"%s, %s, %s, %s, %s, %s, %s, %s, %s, %s)"
|
||||
)
|
||||
now = datetime.now()
|
||||
|
Reference in New Issue
Block a user