diff --git a/dataset_eval/evaluate.py b/dataset_eval/evaluate.py index ecadbbfbd..0a6326a8b 100644 --- a/dataset_eval/evaluate.py +++ b/dataset_eval/evaluate.py @@ -60,28 +60,8 @@ def evaluate_dataset(eval_job, dataset_dir, storage_dir): with open(groundtruth_path, "w") as f: yaml.dump(create_groundtruth_dict(snapshot["data"]["name"], train), f) - # logging.info("Training GAIA model...") - # evaluate_gaia(eval_location, groundtruth_path, filelist_path, storage_dir, eval_job) - - # Passing more user preferences to train the model. - logging.info("Training model...") - results = gaia_wrapper.train_model( - project_dir=eval_location, - groundtruth_file=groundtruth_path, - filelist_file=filelist_path, - c_values=eval_job["options"].get("c_values", []), - gamma_values=eval_job["options"].get("gamma_values", []), - preprocessing_values=eval_job["options"].get("preprocessing_values", []), - ) - logging.info("Saving results...") - save_history_file(storage_dir, results["history_path"], eval_job["id"]) - db.dataset_eval.set_job_result(eval_job["id"], json.dumps({ - "project_path": eval_location, - "parameters": results["parameters"], - "accuracy": results["accuracy"], - "confusion_matrix": results["confusion_matrix"], - "history_path": results["history_path"], - })) + logging.info("Training GAIA model...") + evaluate_gaia(eval_location, groundtruth_path, filelist_path, storage_dir, eval_job) db.dataset_eval.set_job_status(eval_job["id"], db.dataset_eval.STATUS_DONE) logging.info("Evaluation job %s has been completed." % eval_job["id"]) @@ -104,6 +84,7 @@ def evaluate_dataset(eval_job, dataset_dir, storage_dir): def evaluate_gaia(eval_location, groundtruth_path, filelist_path, storage_dir, eval_job): + # Passing more user preferences to train the model. results = gaia_wrapper.train_model( project_dir=eval_location, groundtruth_file=groundtruth_path, @@ -123,9 +104,11 @@ def evaluate_gaia(eval_location, groundtruth_path, filelist_path, storage_dir, e })) -def evaluate_sklearn(eval_location, groundtruth_path, filelist_path, storage_dir, eval_job): - # create_classification_project(ground_truth_directory=groundtruth_path) - pass +def evaluate_sklearn(eval_location, dataset_dir, storage_dir, eval_job): + create_classification_project(ground_truth_directory=dataset_dir, + project_file=eval_job["id"], + exports_directory=eval_job["id"], + exports_path=eval_location) def create_groundtruth_dict(name, datadict):