Skip to content
Snippets Groups Projects
Commit ad0c9738 authored by Desi's avatar Desi
Browse files

fix errors

parent bd855d46
No related branches found
No related tags found
No related merge requests found
#Measure Runtime for KNN and POLY for singe File
import sys
import pathlib
import os
import time
sys.path.append(str(pathlib.Path.absolute)+ '../')
BASE_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), '../'))
if BASE_DIR not in sys.path:
sys.path.append(BASE_DIR)
from src.models.sofia_modelle.KNN import KNN
from src.models.desi.POLY import POLY
from src.utils.slidingWindows import find_length_rank
......@@ -21,9 +23,10 @@ def run_Sub_KNN(data, n_neighbors=10, method='largest', periodicity=1, n_jobs=1)
score = clf.decision_scores_
return score.ravel()
model = 'Sub_KNN'
model = 'Sub_KNN_runtime'
output_path = '../docs/evaluation/'
print('Start processing with KNN')
start_time = time.time()
#writes results in .csv
main(run_Sub_KNN,params,model,data_folders = './data/', model_type='unsupervised',output_dir = output_path)
......@@ -46,8 +49,9 @@ def run_POLY(data, periodicity=1, power=3, n_jobs=1):
score = clf.decision_scores_
return score.ravel()
model = 'POLY'
model = 'POLY_runtime'
print('Start processing with POLY')
start_time = time.time()
#writes results in .csv
main(run_POLY,params,model,data_folders = './data/', model_type='unsupervised',output_dir = output_path)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment