mirror of
https://github.com/Doctorado-ML/Stree_datasets.git
synced 2025-08-16 07:56:07 +00:00
Add time analysis
This commit is contained in:
@@ -45,7 +45,9 @@ class MySQL:
|
||||
self._database = mysql.connector.connect(**self._config_db)
|
||||
return self._database
|
||||
|
||||
def find_best(self, dataset, classifier="any", experiment="any"):
|
||||
def find_best(
|
||||
self, dataset, classifier="any", experiment="any", time_info=False
|
||||
):
|
||||
cursor = self._database.cursor(buffered=True)
|
||||
date_from = "2021-01-20"
|
||||
# date_to = "2021-04-07"
|
||||
@@ -65,10 +67,16 @@ class MySQL:
|
||||
# command += f" and date>='{date_from}' and date<='{date_to}'"
|
||||
command += f" and date>='{date_from}'"
|
||||
command += "" if experiment == "any" else f" and type='{experiment}'"
|
||||
command += (
|
||||
" order by r.dataset, accuracy desc, classifier desc, "
|
||||
"type, date, time"
|
||||
)
|
||||
if time_info:
|
||||
command += (
|
||||
" order by r.dataset, time_spent asc, classifier desc, "
|
||||
"type, date, time"
|
||||
)
|
||||
else:
|
||||
command += (
|
||||
" order by r.dataset, accuracy desc, classifier desc, "
|
||||
"type, date, time"
|
||||
)
|
||||
cursor.execute(command)
|
||||
return cursor.fetchone()
|
||||
|
||||
|
Reference in New Issue
Block a user