def evaluate(dataset_id): ds = get_dataset(dataset_id) if not ds["public"]: flash.warn("Can't add private datasets into evaluation queue.") else: try: db.dataset_eval.evaluate_dataset(ds["id"]) flash.info("Dataset %s has been added into evaluation queue." % ds["id"]) except db.dataset_eval.IncompleteDatasetException: # TODO(roman): Show more informative error message. flash.error("Can't add dataset into evaluation queue because it's incomplete.") except db.dataset_eval.JobExistsException: flash.warn("Evaluation job for this dataset has been already created.") return redirect(url_for(".eval_info", dataset_id=dataset_id))
def evaluate(dataset_id): ds = get_dataset(dataset_id) if not ds["public"]: flash.warn("Can't add private datasets into evaluation queue.") else: try: db.dataset_eval.evaluate_dataset(ds["id"]) flash.info("Dataset %s has been added into evaluation queue." % ds["id"]) except db.dataset_eval.IncompleteDatasetException: # TODO(roman): Show more informative error message. flash.error( "Can't add dataset into evaluation queue because it's incomplete." ) except db.dataset_eval.JobExistsException: flash.warn( "Evaluation job for this dataset has been already created.") return redirect(url_for(".eval_info", dataset_id=dataset_id))
def evaluate(dataset_id): """Endpoint for submitting dataset for evaluation.""" ds = get_dataset(dataset_id) if not ds["public"]: flash.warn("Can't add private datasets into evaluation queue.") return redirect(url_for(".eval_info", dataset_id=dataset_id)) if db.dataset_eval.job_exists(dataset_id): flash.warn("Evaluation job for this dataset has been already created.") return redirect(url_for(".eval_info", dataset_id=dataset_id)) form = forms.DatasetEvaluationForm() if form.validate_on_submit(): try: if form.filter_type.data == forms.DATASET_EVAL_NO_FILTER: form.filter_type.data = None db.dataset_eval.evaluate_dataset( dataset_id=ds["id"], normalize=form.normalize.data, filter_type=form.filter_type.data, ) flash.info("Dataset %s has been added into evaluation queue." % ds["id"]) except db.dataset_eval.IncompleteDatasetException: # TODO(roman): Show more informative error message. flash.error("Can't add this dataset into evaluation queue because it's incomplete.") except db.dataset_eval.JobExistsException: flash.warn("Evaluation job for this dataset has been already created.") return redirect(url_for(".eval_info", dataset_id=dataset_id)) return render_template("datasets/evaluate.html", dataset=ds, form=form)
def evaluate(dataset_id): """Endpoint for submitting dataset for evaluation.""" ds = get_dataset(dataset_id) if not ds["public"]: flash.warn("Can't add private datasets into evaluation queue.") return redirect(url_for(".eval_info", dataset_id=dataset_id)) if db.dataset_eval.job_exists(dataset_id): flash.warn("Evaluation job for this dataset has been already created.") return redirect(url_for(".eval_info", dataset_id=dataset_id)) form = forms.DatasetEvaluationForm() if form.validate_on_submit(): try: if form.filter_type.data == forms.DATASET_EVAL_NO_FILTER: form.filter_type.data = None db.dataset_eval.evaluate_dataset( dataset_id=ds["id"], normalize=form.normalize.data, eval_location=form.evaluation_location.data, filter_type=form.filter_type.data, ) flash.info("Dataset %s has been added into evaluation queue." % ds["id"]) except db.dataset_eval.IncompleteDatasetException as e: flash.error( "Cannot add this dataset because of a validation error: %s" % e) except db.dataset_eval.JobExistsException: flash.warn( "An evaluation job for this dataset has been already created.") return redirect(url_for(".eval_info", dataset_id=dataset_id)) return render_template("datasets/evaluate.html", dataset=ds, form=form)
def evaluate(dataset_id): """Endpoint for submitting dataset for evaluation.""" ds = get_dataset(dataset_id) if not ds["public"]: flash.warn("Can't add private datasets into evaluation queue.") return redirect(url_for(".eval_info", dataset_id=dataset_id)) if db.dataset_eval.job_exists(dataset_id): flash.warn( "An evaluation job for this dataset has been already created.") return redirect(url_for(".eval_info", dataset_id=dataset_id)) # Validate dataset structure before choosing evaluation preferences try: db.dataset_eval.validate_dataset_structure(ds) except db.dataset_eval.IncompleteDatasetException as e: flash.error( "Cannot add this dataset because of a validation error: %s" % e) return redirect(url_for("datasets.view", dataset_id=dataset_id)) form = forms.DatasetEvaluationForm() if form.validate_on_submit(): try: if form.filter_type.data == forms.DATASET_EVAL_NO_FILTER: form.filter_type.data = None c_values = None gamma_values = None preprocessing_values = None if form.svm_filtering.data: c_values = [int(i) for i in form.c_value.data.split(",")] gamma_values = [ int(i) for i in form.gamma_value.data.split(",") ] preprocessing_values = form.preprocessing_values.data db.dataset_eval.evaluate_dataset( dataset_id=ds["id"], normalize=form.normalize.data, eval_location=form.evaluation_location.data, c_values=c_values, gamma_values=gamma_values, preprocessing_values=preprocessing_values, filter_type=form.filter_type.data, ) flash.info("Dataset %s has been added into evaluation queue." % ds["id"]) except db.dataset_eval.IncompleteDatasetException as e: flash.error( "Cannot add this dataset because of a validation error: %s" % e) except db.dataset_eval.JobExistsException: flash.warn( "An evaluation job for this dataset has been already created.") return redirect(url_for(".eval_info", dataset_id=dataset_id)) return render_template("datasets/evaluate.html", dataset=ds, form=form)