From 964f3c9969bb76cf3d3d7d3d27bb2b659353d4a7 Mon Sep 17 00:00:00 2001 From: "dean.schmitz@hhu.de" <dean.schmitz@hhu.de> Date: Thu, 20 Oct 2022 20:54:16 +0200 Subject: [PATCH] Udatin CSV to a relative Path --- src/helper_files/helper_tests.pl | 2 +- src/methods/adaboost/adaboost_test.pl | 14 +++++------ src/methods/approx_kfn/approx_kfn_test.pl | 2 +- .../bayesian_linear_regression_test.pl | 2 +- src/methods/dbscan/dbscan_test.pl | 24 +++++++++---------- .../decision_tree/decision_tree_test.pl | 8 +++---- src/methods/emst/emst_test.pl | 2 +- src/methods/fastmks/fastmks_test.pl | 24 +++++++++---------- .../hoeffding_tree/hoeffding_tree_test.pl | 18 +++++++------- src/methods/kde/kde_test.pl | 4 ++-- src/methods/kernel_pca/kernel_pca_test.pl | 6 ++--- src/methods/kfn/kfn_test.pl | 6 ++--- src/methods/kmeans/kmeans_test.pl | 2 +- src/methods/knn/knn_test.pl | 2 +- src/methods/lars/lars_test.pl | 2 +- .../linear_regression_test.pl | 2 +- src/methods/new_method/new_method_test.pl | 2 +- .../sparse_coding/sparse_coding_test.pl | 8 +++---- 18 files changed, 65 insertions(+), 65 deletions(-) diff --git a/src/helper_files/helper_tests.pl b/src/helper_files/helper_tests.pl index 183f5b3..3c6dc20 100644 --- a/src/helper_files/helper_tests.pl +++ b/src/helper_files/helper_tests.pl @@ -12,7 +12,7 @@ :- begin_tests(b). test(matrix) :- - open('/home/afkjakhes/eclipse-workspace/prolog-mlpack-libary/src/data_csv/iris2.csv', read, File), + open('src/data_csv/iris2.csv', read, File), take_csv_row(File, skipFirstRow, 2, Records), print(Records), print('\n'), diff --git a/src/methods/adaboost/adaboost_test.pl b/src/methods/adaboost/adaboost_test.pl index a930b61..f65ba55 100644 --- a/src/methods/adaboost/adaboost_test.pl +++ b/src/methods/adaboost/adaboost_test.pl @@ -105,7 +105,7 @@ test(classify_with_bad_data_input_decision_stump) :- %% Successful Tests test(classify_perceptron) :- reset_Model_No_Train(perceptron), - open('/home/afkjakhes/eclipse-workspace/prolog-mlpack-libary/src/data_csv/iris2.csv', read, File), + open('src/data_csv/iris2.csv', read, File), take_csv_row(File, skipFirstRow,10, Records), train(Records, 4, [0,1,0,1,1,0,1,1,1,0], 2, perceptron, 50, 0.0001, _), classify([3, 2, 0, 5, 1, 4, 0, 0, 4, 3, 3, 5, 0, 5, 5, 2, 5, 5, 0, 2], 4, @@ -114,7 +114,7 @@ test(classify_perceptron) :- test(classify_decision_stump) :- reset_Model_No_Train(decision_stump), - open('/home/afkjakhes/eclipse-workspace/prolog-mlpack-libary/src/data_csv/iris2.csv', read, File), + open('src/data_csv/iris2.csv', read, File), take_csv_row(File, skipFirstRow,10, Records), train(Records, 4, [0,1,0,1,1,0,1,1,1,0], 2, decision_stump, 50, 0.0001, _), classify([3, 2, 0, 5, 1, 4, 0, 0, 4, 3, 3, 5, 0, 5, 5, 2, 5, 5, 0, 2], 4, @@ -152,7 +152,7 @@ test(numClasses_Custom_NumClasses, [true(Amount =:= 3)]) :- test(numClasses_afterTrain_Perceptron, [true(Amount =:= 2)]) :- reset_Model_No_Train(perceptron), - open('/home/afkjakhes/eclipse-workspace/prolog-mlpack-libary/src/data_csv/iris2.csv', read, File), + open('src/data_csv/iris2.csv', read, File), take_csv_row(File, skipFirstRow,10, Records), train(Records, 4, [0,1,0,1,1,0,1,1,1,0], 2, perceptron, 50, 0.0001, _), numClasses(Amount). @@ -187,7 +187,7 @@ test(getTolerance_Custom_Tolerance, [true(Amount =:= 0.0009)]) :- test(getTolerance_afterTrain, [true(Amount =:= 0.0005)]) :- reset_Model_No_Train(perceptron), - open('/home/afkjakhes/eclipse-workspace/prolog-mlpack-libary/src/data_csv/iris2.csv', read, File), + open('src/data_csv/iris2.csv', read, File), take_csv_row(File, skipFirstRow,10, Records), train(Records, 4, [0,1,0,1,1,0,1,1,1,0], 2, perceptron, 50, 0.0005, _), getTolerance(Amount). @@ -234,7 +234,7 @@ test(modifyTolerance_Custom_Tolerance, [true(Amount =:= 0.02)]) :- test(modifyTolerance_afterTrain, [true(Amount =:= 0.02)]) :- reset_Model_No_Train(perceptron), - open('/home/afkjakhes/eclipse-workspace/prolog-mlpack-libary/src/data_csv/iris2.csv', read, File), + open('src/data_csv/iris2.csv', read, File), take_csv_row(File, skipFirstRow,10, Records), train(Records, 4, [0,1,0,1,1,0,1,1,1,0], 2, perceptron, 50, 0.0001, _), modifyTolerance(0.02), @@ -300,7 +300,7 @@ test(train_With_Direct_Input_Perceptron, [true(Error =:= 1)]) :- test(train_With_Data_From_CSV_Perceptron, [true(Error =:= 0.9797958971132711)]) :- reset_Model_No_Train(perceptron), - open('/home/afkjakhes/eclipse-workspace/prolog-mlpack-libary/src/data_csv/iris2.csv', read, File), + open('src/data_csv/iris2.csv', read, File), take_csv_row(File, skipFirstRow,10, Records), train(Records, 4, [0,1,0,1,1,0,1,1,1,0], 2, perceptron, 50, 0.0001, Error). @@ -310,7 +310,7 @@ test(train_With_Direct_Input_Decision_Stump, [true(Error =:= 1)]) :- test(train_With_Data_From_CSV_Decision_Stump, [true(Error =:= 0.9797958971132711)]) :- reset_Model_No_Train(decision_stump), - open('/home/afkjakhes/eclipse-workspace/prolog-mlpack-libary/src/data_csv/iris2.csv', read, File), + open('src/data_csv/iris2.csv', read, File), take_csv_row(File, skipFirstRow,10, Records), train(Records, 4, [0,1,0,1,1,0,1,1,1,0], 2, decision_stump, 50, 0.0001, Error). diff --git a/src/methods/approx_kfn/approx_kfn_test.pl b/src/methods/approx_kfn/approx_kfn_test.pl index 6e5d6df..b37a384 100644 --- a/src/methods/approx_kfn/approx_kfn_test.pl +++ b/src/methods/approx_kfn/approx_kfn_test.pl @@ -33,7 +33,7 @@ test(testDescription3, [true(Error =:= 1)]) :- test(testDescription4, [true(Error =:= 0.9797958971132711)]) :- reset_Model_No_Train(perceptron), - open('/home/afkjakhes/eclipse-workspace/prolog-mlpack-libary/src/data_csv/iris2.csv', read, File), + open('src/data_csv/iris2.csv', read, File), take_csv_row(File, skipFirstRow,10, Data), train(Data, 4, [0,1,0,1,1,0,1,1,1,0], 2, perceptron, 50, 0.0001, Error). diff --git a/src/methods/bayesian_linear_regression/bayesian_linear_regression_test.pl b/src/methods/bayesian_linear_regression/bayesian_linear_regression_test.pl index 86bb61e..264118c 100644 --- a/src/methods/bayesian_linear_regression/bayesian_linear_regression_test.pl +++ b/src/methods/bayesian_linear_regression/bayesian_linear_regression_test.pl @@ -85,7 +85,7 @@ test(testDescription3, [true(Error =:= 1)]) :- test(testDescription4, [true(Error =:= 0.9797958971132711)]) :- reset_Model_No_Train(perceptron), - open('/home/afkjakhes/eclipse-workspace/prolog-mlpack-libary/src/data_csv/iris2.csv', read, File), + open('src/data_csv/iris2.csv', read, File), take_csv_row(File, skipFirstRow,10, Data), train(Data, 4, [0,1,0,1,1,0,1,1,1,0], 2, perceptron, 50, 0.0001, Error). diff --git a/src/methods/dbscan/dbscan_test.pl b/src/methods/dbscan/dbscan_test.pl index 112d030..a7535d0 100644 --- a/src/methods/dbscan/dbscan_test.pl +++ b/src/methods/dbscan/dbscan_test.pl @@ -33,7 +33,7 @@ test(dbscan_wrong_TreeType_Input_With_Random_Selection, [error(domain_error('The %% Successful Tests test(dbscan_KD_CSV) :- - open('/home/afkjakhes/eclipse-workspace/prolog-mlpack-libary/src/data_csv/iris2.csv', read, File), + open('src/data_csv/iris2.csv', read, File), take_csv_row(File, skipFirstRow,30, Data), dbscan(1.0, 1, 0, ordered, kd, Data, 4, AssignList, CentroidsList, _), dbscan(1.0, 1, 0, random, kd, Data, 4, AssignListRand, CentroidsListRand, _), @@ -47,7 +47,7 @@ test(dbscan_KD_CSV) :- print(CentroidsListRand). test(dbscan_R_CSV) :- - open('/home/afkjakhes/eclipse-workspace/prolog-mlpack-libary/src/data_csv/iris2.csv', read, File), + open('src/data_csv/iris2.csv', read, File), take_csv_row(File, skipFirstRow,30, Data), dbscan(1.0, 1, 0, ordered, r, Data, 4, AssignList, CentroidsList, _), dbscan(1.0, 1, 0, random, r, Data, 4, AssignListRand, CentroidsListRand, _), @@ -61,7 +61,7 @@ test(dbscan_R_CSV) :- print(CentroidsListRand). test(dbscan_RSTAR_CSV) :- - open('/home/afkjakhes/eclipse-workspace/prolog-mlpack-libary/src/data_csv/iris2.csv', read, File), + open('src/data_csv/iris2.csv', read, File), take_csv_row(File, skipFirstRow,30, Data), dbscan(1.0, 1, 0, ordered, r_star, Data, 4, AssignList, CentroidsList, _), dbscan(1.0, 1, 0, random, r_star, Data, 4, AssignListRand, CentroidsListRand, _), @@ -75,7 +75,7 @@ test(dbscan_RSTAR_CSV) :- print(CentroidsListRand). test(dbscan_X_CSV) :- - open('/home/afkjakhes/eclipse-workspace/prolog-mlpack-libary/src/data_csv/iris2.csv', read, File), + open('src/data_csv/iris2.csv', read, File), take_csv_row(File, skipFirstRow,30, Data), dbscan(1.0, 1, 0, ordered, x, Data, 4, AssignList, CentroidsList, _), dbscan(1.0, 1, 0, random, x, Data, 4, AssignListRand, CentroidsListRand, _), @@ -89,7 +89,7 @@ test(dbscan_X_CSV) :- print(CentroidsListRand). test(dbscan_Hilbert_R_CSV) :- - open('/home/afkjakhes/eclipse-workspace/prolog-mlpack-libary/src/data_csv/iris2.csv', read, File), + open('src/data_csv/iris2.csv', read, File), take_csv_row(File, skipFirstRow,30, Data), dbscan(1.0, 1, 0, ordered, hilbert_r, Data, 4, AssignList, CentroidsList, _), dbscan(1.0, 1, 0, random, hilbert_r, Data, 4, AssignListRand, CentroidsListRand, _), @@ -103,7 +103,7 @@ test(dbscan_Hilbert_R_CSV) :- print(CentroidsListRand). test(dbscan_RPlus_CSV) :- - open('/home/afkjakhes/eclipse-workspace/prolog-mlpack-libary/src/data_csv/iris2.csv', read, File), + open('src/data_csv/iris2.csv', read, File), take_csv_row(File, skipFirstRow,30, Data), dbscan(1.0, 1, 0, ordered, r_plus, Data, 4, AssignList, CentroidsList, _), dbscan(1.0, 1, 0, random, r_plus, Data, 4, AssignListRand, CentroidsListRand, _), @@ -117,7 +117,7 @@ test(dbscan_RPlus_CSV) :- print(CentroidsListRand). test(dbscan_RPlusPlus_CSV) :- - open('/home/afkjakhes/eclipse-workspace/prolog-mlpack-libary/src/data_csv/iris2.csv', read, File), + open('src/data_csv/iris2.csv', read, File), take_csv_row(File, skipFirstRow,30, Data), dbscan(1.0, 1, 0, ordered, r_plus_plus, Data, 4, AssignList, CentroidsList, _), dbscan(1.0, 1, 0, random, r_plus_plus, Data, 4, AssignListRand, CentroidsListRand, _), @@ -131,7 +131,7 @@ test(dbscan_RPlusPlus_CSV) :- print(CentroidsListRand). test(dbscan_Cover_CSV) :- - open('/home/afkjakhes/eclipse-workspace/prolog-mlpack-libary/src/data_csv/iris2.csv', read, File), + open('src/data_csv/iris2.csv', read, File), take_csv_row(File, skipFirstRow,30, Data), dbscan(1.0, 1, 0, ordered, cover, Data, 4, AssignList, CentroidsList, _), dbscan(1.0, 1, 0, random, cover, Data, 4, AssignListRand, CentroidsListRand, _), @@ -146,7 +146,7 @@ test(dbscan_Cover_CSV) :- test(dbscan_Ball_CSV) :- - open('/home/afkjakhes/eclipse-workspace/prolog-mlpack-libary/src/data_csv/iris2.csv', read, File), + open('src/data_csv/iris2.csv', read, File), take_csv_row(File, skipFirstRow,30, Data), dbscan(1.0, 1, 0, ordered, ball, Data, 4, AssignList, CentroidsList, _), dbscan(1.0, 1, 0, random, ball, Data, 4, AssignListRand, CentroidsListRand, _), @@ -168,7 +168,7 @@ test(dbscan_Orderd_KD) :- print(CentroidsList). test(dbscan_Orderd_KD_CSV) :- - open('/home/afkjakhes/eclipse-workspace/prolog-mlpack-libary/src/data_csv/iris2.csv', read, File), + open('src/data_csv/iris2.csv', read, File), take_csv_row(File, skipFirstRow,10, Data), dbscan(1.0, 1, 0, ordered, kd, Data, 4, AssignList, CentroidsList, _), print(AssignList), @@ -179,12 +179,12 @@ test(dbscan_Random_KD) :- dbscan(3.2, 4, 1, random, kd, [5.1,3.5,1.4,4.9,3.0,1.4,4.7,3.2,1.3,4.6,3.1,1.5], 3, [0.0,0.0,0.0,0.0], [[4.824999809265137,3.200000047683716,1.399999976158142]], _). test(dbscan_Random_KD_CSV) :- - open('/home/afkjakhes/eclipse-workspace/prolog-mlpack-libary/src/data_csv/iris2.csv', read, File), + open('src/data_csv/iris2.csv', read, File), take_csv_row(File, skipFirstRow,10, Data), dbscan(3.2, 4, 1, random, kd, Data, 4, [0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0], [[4.860000133514404,3.309999942779541,1.4500000476837158,0.2199999988079071]], _). test(dbscan_Random_RSTAR_CSV) :- - open('/home/afkjakhes/eclipse-workspace/prolog-mlpack-libary/src/data_csv/iris2.csv', read, File), + open('src/data_csv/iris2.csv', read, File), take_csv_row(File, skipFirstRow,100, Data), dbscan(1.0, 10, 1, random, r_star, Data, 4, AssignList, CentroidsList, _), print(AssignList), diff --git a/src/methods/decision_tree/decision_tree_test.pl b/src/methods/decision_tree/decision_tree_test.pl index 209f0a7..712d1c1 100644 --- a/src/methods/decision_tree/decision_tree_test.pl +++ b/src/methods/decision_tree/decision_tree_test.pl @@ -49,7 +49,7 @@ test(initModel_Direkt_Input_Use) :- initModel([5.1,3.5,1.4,4.9,3.0,1.4,4.7,3.2,1.3,4.6,3.1,1.5], 3, [0,0,0,0], 2, 10, 0.5, 0). test(initModel_Direkt_CSV_Use) :- - open('/home/afkjakhes/eclipse-workspace/prolog-mlpack-libary/src/data_csv/iris2.csv', read, File), + open('src/data_csv/iris2.csv', read, File), take_csv_row(File, skipFirstRow,10, Data), initModel(Data, 4, [0,1,0,1,1,0,1,1,1,0], 2, 2, 0.7, 3). @@ -142,7 +142,7 @@ test(classify_Matrix_Direkt_Input2) :- print(ProbsList). test(classify_Matrix_CSV_Trained) :- - open('/home/afkjakhes/eclipse-workspace/prolog-mlpack-libary/src/data_csv/iris2.csv', read, File), + open('src/data_csv/iris2.csv', read, File), take_csv_row(File, skipFirstRow,30, Data), train(Data, 4, [0,1,0,1,1,0,1,1,1,0, 0,1,0,1,1,0,1,1,1,0, 0,1,0,1,1,0,1,1,1,0], 2, 5, 0.0007, 0, _), classifyMatrix([2, 2, 3, 5, 1, 4, 1, 1, 4, 0, 3, 5, 0, 5, 5, 2, 2, 6, 0, 1], 4, PredictionList, ProbsList, _), @@ -192,7 +192,7 @@ test(initModel_Direkt_Input_Use, [true(Entropy =:= 0.0)]) :- train([5.1,3.5,1.4,4.9,3.0,1.4,4.7,3.2,1.3,4.6,3.1,1.5], 3, [0,0,0,0], 2, 10, 0.5, 0, Entropy). test(initModel_Direkt_CSV_Use, [true(Entropy =:= 0.48)]) :- - open('/home/afkjakhes/eclipse-workspace/prolog-mlpack-libary/src/data_csv/iris2.csv', read, File), + open('src/data_csv/iris2.csv', read, File), take_csv_row(File, skipFirstRow,10, Data), train(Data, 4, [0,1,0,1,1,0,1,1,1,0], 2, 2, 0.7, 3, Entropy). @@ -202,7 +202,7 @@ test(initModel_Direkt_Input_Use, [true(Entropy =:= 0.0)]) :- test(initModel_Direkt_CSV_Use, [true(Entropy =:= 0.3767195767195767)]) :- reset_Model_With_Train, - open('/home/afkjakhes/eclipse-workspace/prolog-mlpack-libary/src/data_csv/iris2.csv', read, File), + open('src/data_csv/iris2.csv', read, File), take_csv_row(File, skipFirstRow,30, Data), train(Data, 4, [0,1,0,1,1,0,1,1,1,0, 0,1,0,1,1,0,1,1,1,0, 0,1,0,1,1,0,1,1,1,0], 2, 5, 0.0005, 0, Entropy). diff --git a/src/methods/emst/emst_test.pl b/src/methods/emst/emst_test.pl index 2514ff1..52fa689 100644 --- a/src/methods/emst/emst_test.pl +++ b/src/methods/emst/emst_test.pl @@ -31,7 +31,7 @@ test(emst_Direkt_Input_Use_Naive) :- [0.0,2.0,0.5099020004272461]], _). test(emst_CSV_Input_Use) :- - open('/home/afkjakhes/eclipse-workspace/prolog-mlpack-libary/src/data_csv/iris2.csv', read, File), + open('src/data_csv/iris2.csv', read, File), take_csv_row(File, skipFirstRow,10, Data), emst(Data, 4, 0, ResultsList, _), print(ResultsList), diff --git a/src/methods/fastmks/fastmks_test.pl b/src/methods/fastmks/fastmks_test.pl index 1ba17d3..1d5aeeb 100644 --- a/src/methods/fastmks/fastmks_test.pl +++ b/src/methods/fastmks/fastmks_test.pl @@ -7,7 +7,7 @@ :- use_module('../../helper_files/helper.pl'). reset_Model :- - open('/home/afkjakhes/eclipse-workspace/prolog-mlpack-libary/src/data_csv/iris2.csv', read, File), + open('src/data_csv/iris2.csv', read, File), take_csv_row(File, skipFirstRow,10, Data), initModel(Data, 4, linear, 0.0, 0.0, 1.0, 0.0, 0, 0, 1.2). @@ -20,7 +20,7 @@ reset_Model :- %% Failure Tests test(searchWithQuery_Fastmks_Search_Before_Init, [error(_,system_error('The Model hasnt been trained yet!'))]) :- - open('/home/afkjakhes/eclipse-workspace/prolog-mlpack-libary/src/data_csv/iris2.csv', read, File), + open('src/data_csv/iris2.csv', read, File), take_csv_row(File, skipFirstRow,5, Data), searchWithQuery(Data, 4, 2, _, _, _, _, 1.1). @@ -37,37 +37,37 @@ test(initModel_Fatsmks_Bad_Base_Input, fail) :- %% Successful Tests test(iniModel_Fastmks_Linear) :- - open('/home/afkjakhes/eclipse-workspace/prolog-mlpack-libary/src/data_csv/iris2.csv', read, File), + open('src/data_csv/iris2.csv', read, File), take_csv_row(File, skipFirstRow,10, Data), initModel(Data, 4, linear, 0.0, 0.0, 1.0, 0.0, 0, 0, 1.5). test(iniModel_Fastmks_Polynomial) :- - open('/home/afkjakhes/eclipse-workspace/prolog-mlpack-libary/src/data_csv/iris2.csv', read, File), + open('src/data_csv/iris2.csv', read, File), take_csv_row(File, skipFirstRow,10, Data), initModel(Data, 4, polynomial, 0.0, 0.0, 1.0, 0.0, 0, 0, 1.5). test(iniModel_Fastmks_Cosine) :- - open('/home/afkjakhes/eclipse-workspace/prolog-mlpack-libary/src/data_csv/iris2.csv', read, File), + open('src/data_csv/iris2.csv', read, File), take_csv_row(File, skipFirstRow,10, Data), initModel(Data, 4, cosine, 0.0, 0.0, 1.0, 0.0, 0, 0, 1.5). test(iniModel_Fastmks_Gaussian) :- - open('/home/afkjakhes/eclipse-workspace/prolog-mlpack-libary/src/data_csv/iris2.csv', read, File), + open('src/data_csv/iris2.csv', read, File), take_csv_row(File, skipFirstRow,10, Data), initModel(Data, 4, gaussian, 0.5, 0.5, 0.5, 0.5, 0, 0, 1.5). test(iniModel_Fastmks_Epanechnikov) :- - open('/home/afkjakhes/eclipse-workspace/prolog-mlpack-libary/src/data_csv/iris2.csv', read, File), + open('src/data_csv/iris2.csv', read, File), take_csv_row(File, skipFirstRow,10, Data), initModel(Data, 4, epanechnikov, 0.0, 0.0, 1.0, 0.0, 0, 0, 1.5). test(iniModel_Fastmks_Triangular) :- - open('/home/afkjakhes/eclipse-workspace/prolog-mlpack-libary/src/data_csv/iris2.csv', read, File), + open('src/data_csv/iris2.csv', read, File), take_csv_row(File, skipFirstRow,10, Data), initModel(Data, 4, triangular, 0.0, 0.0, 1.0, 0.0, 0, 0, 1.5). test(iniModel_Fastmks_Hyptan) :- - open('/home/afkjakhes/eclipse-workspace/prolog-mlpack-libary/src/data_csv/iris2.csv', read, File), + open('src/data_csv/iris2.csv', read, File), take_csv_row(File, skipFirstRow,10, Data), initModel(Data, 4, hyptan, 0.0, 0.0, 1.0, 1.0, 0, 0, 1.5). @@ -83,13 +83,13 @@ test(iniModel_Fastmks_Hyptan) :- test(searchWithQuery_Fastmks_Negative_K, fail) :- reset_Model, - open('/home/afkjakhes/eclipse-workspace/prolog-mlpack-libary/src/data_csv/iris2.csv', read, File), + open('src/data_csv/iris2.csv', read, File), take_csv_row(File, skipFirstRow,5, Data), searchWithQuery(Data, 4, -2, _, _, _, _, 1.1). test(searchWithQuery_Fastmks_Negative_Base, fail) :- reset_Model, - open('/home/afkjakhes/eclipse-workspace/prolog-mlpack-libary/src/data_csv/iris2.csv', read, File), + open('src/data_csv/iris2.csv', read, File), take_csv_row(File, skipFirstRow,5, Data), searchWithQuery(Data, 4, 2, _, _, _, _, -1.1). @@ -106,7 +106,7 @@ test(searchWithQuery_Fastmks_New_Query) :- test(searchWithQuery_Fastmks_Training_Data_Query) :- reset_Model, - open('/home/afkjakhes/eclipse-workspace/prolog-mlpack-libary/src/data_csv/iris2.csv', read, File), + open('src/data_csv/iris2.csv', read, File), take_csv_row(File, skipFirstRow,5, Data), searchWithQuery(Data, 4, 2, IndicesList, _, KernelsList, _, 1.1), print('Indices:\n'), diff --git a/src/methods/hoeffding_tree/hoeffding_tree_test.pl b/src/methods/hoeffding_tree/hoeffding_tree_test.pl index a1dbaab..75280e5 100644 --- a/src/methods/hoeffding_tree/hoeffding_tree_test.pl +++ b/src/methods/hoeffding_tree/hoeffding_tree_test.pl @@ -7,7 +7,7 @@ :- use_module('../../helper_files/helper.pl'). reset_Model :- - open('/home/afkjakhes/eclipse-workspace/prolog-mlpack-libary/src/data_csv/iris2.csv', read, File), + open('src/data_csv/iris2.csv', read, File), take_csv_row(File, skipFirstRow,10, Data), initAndBuildModel(gini_binary, Data, 4, [0,1,0,1,1,0,1,1,1,0], 2, 0, 0.95, 5000, 100, 100, 10, 100). @@ -68,7 +68,7 @@ test(hoeffding_Init_GiniHoeffding_Direkt_Input) :- initAndBuildModel(gini_hoeffding, [5.1,3.5,1.4,4.9,3.0,1.4,4.7,3.2,1.3,4.6,3.1,1.5], 3, [0,1,0,1], 2, 0, 0.95, 5000, 100, 100, 10, 100). test(hoeffding_Init_GiniHoeffding_CSV_Input) :- - open('/home/afkjakhes/eclipse-workspace/prolog-mlpack-libary/src/data_csv/iris2.csv', read, File), + open('src/data_csv/iris2.csv', read, File), take_csv_row(File, skipFirstRow,10, Data), initAndBuildModel(gini_hoeffding, Data, 4, [0,1,0,1,1,0,1,1,1,0], 2, 0, 0.95, 5000, 100, 100, 10, 100). @@ -76,7 +76,7 @@ test(hoeffding_Init_GiniBinary_Direkt_Input) :- initAndBuildModel(gini_binary, [5.1,3.5,1.4,4.9,3.0,1.4,4.7,3.2,1.3,4.6,3.1,1.5], 3, [0,1,0,1], 2, 0, 0.95, 5000, 100, 100, 10, 100). test(hoeffding_Init_GiniBinary_CSV_Input) :- - open('/home/afkjakhes/eclipse-workspace/prolog-mlpack-libary/src/data_csv/iris2.csv', read, File), + open('src/data_csv/iris2.csv', read, File), take_csv_row(File, skipFirstRow,10, Data), initAndBuildModel(gini_binary, Data, 4, [0,1,0,1,1,0,1,1,1,0], 2, 0, 0.95, 5000, 100, 100, 10, 100). @@ -84,7 +84,7 @@ test(hoeffding_Init_InfoHoeffding_Direkt_Input) :- initAndBuildModel(info_hoeffding, [5.1,3.5,1.4,4.9,3.0,1.4,4.7,3.2,1.3,4.6,3.1,1.5], 3, [0,1,0,1], 2, 0, 0.95, 5000, 100, 100, 10, 100). test(hoeffding_Init_InfoHoeffding_CSV_Input) :- - open('/home/afkjakhes/eclipse-workspace/prolog-mlpack-libary/src/data_csv/iris2.csv', read, File), + open('src/data_csv/iris2.csv', read, File), take_csv_row(File, skipFirstRow,10, Data), initAndBuildModel(info_hoeffding, Data, 4, [0,1,0,1,1,0,1,1,1,0], 2, 0, 0.95, 5000, 100, 100, 10, 100). @@ -92,7 +92,7 @@ test(hoeffding_Init_InfoBinary_Direkt_Input) :- initAndBuildModel(info_binary, [5.1,3.5,1.4,4.9,3.0,1.4,4.7,3.2,1.3,4.6,3.1,1.5], 3, [0,1,0,1], 2, 0, 0.95, 5000, 100, 100, 10, 100). test(hoeffding_Init_InfoBinary_CSV_Input) :- - open('/home/afkjakhes/eclipse-workspace/prolog-mlpack-libary/src/data_csv/iris2.csv', read, File), + open('src/data_csv/iris2.csv', read, File), take_csv_row(File, skipFirstRow,10, Data), initAndBuildModel(info_binary, Data, 4, [0,1,0,1,1,0,1,1,1,0], 2, 0, 0.95, 5000, 100, 100, 10, 100). @@ -118,7 +118,7 @@ test(hoeffding_Classify_Different_Dims_To_Train, [error(_,system_error('Labels V %% Successful Tests test(hoeffding_Classify_GiniHoeffding) :- - open('/home/afkjakhes/eclipse-workspace/prolog-mlpack-libary/src/data_csv/iris2.csv', read, File), + open('src/data_csv/iris2.csv', read, File), take_csv_row(File, skipFirstRow,10, Data), initAndBuildModel(gini_hoeffding, Data, 4, [0,1,0,1,1,0,1,1,1,0], 2, 0, 0.95, 5000, 100, 100, 10, 100), classify([3, 2, 0, 5, 1, 4, 1, 0, 4, 3, 3, 5, 0, 5, 5, 2, 5, 5, 0, 2], 4, PredicList, ProbsList), @@ -128,7 +128,7 @@ test(hoeffding_Classify_GiniHoeffding) :- print(ProbsList). test(hoeffding_Classify_GiniBinary) :- - open('/home/afkjakhes/eclipse-workspace/prolog-mlpack-libary/src/data_csv/iris2.csv', read, File), + open('src/data_csv/iris2.csv', read, File), take_csv_row(File, skipFirstRow,10, Data), initAndBuildModel(gini_binary, Data, 4, [0,1,0,1,1,0,1,1,1,0], 2, 0, 0.95, 5000, 100, 100, 10, 100), classify([3, 2, 0, 5, 1, 4, 1, 0, 4, 3, 3, 5, 0, 5, 5, 2, 5, 5, 0, 2], 4, PredicList, ProbsList), @@ -138,7 +138,7 @@ test(hoeffding_Classify_GiniBinary) :- print(ProbsList). test(hoeffding_Classify_InfoHoeffding) :- - open('/home/afkjakhes/eclipse-workspace/prolog-mlpack-libary/src/data_csv/iris2.csv', read, File), + open('src/data_csv/iris2.csv', read, File), take_csv_row(File, skipFirstRow,10, Data), initAndBuildModel(info_hoeffding, Data, 4, [0,1,0,1,1,0,1,1,1,0], 2, 0, 0.95, 5000, 100, 100, 10, 100), classify([3, 2, 0, 5, 1, 4, 1, 0, 4, 3, 3, 5, 0, 5, 5, 2, 5, 5, 0, 2], 4, PredicList, ProbsList), @@ -148,7 +148,7 @@ test(hoeffding_Classify_InfoHoeffding) :- print(ProbsList). test(hoeffding_Classify_InfoBinary) :- - open('/home/afkjakhes/eclipse-workspace/prolog-mlpack-libary/src/data_csv/iris2.csv', read, File), + open('src/data_csv/iris2.csv', read, File), take_csv_row(File, skipFirstRow,10, Data), initAndBuildModel(info_binary, Data, 4, [0,1,0,1,1,0,1,1,1,0], 2, 0, 0.95, 5000, 100, 100, 10, 100), classify([3, 2, 0, 5, 1, 4, 1, 0, 4, 3, 3, 5, 0, 5, 5, 2, 5, 5, 0, 2], 4, PredicList, ProbsList), diff --git a/src/methods/kde/kde_test.pl b/src/methods/kde/kde_test.pl index ba08917..1199aac 100644 --- a/src/methods/kde/kde_test.pl +++ b/src/methods/kde/kde_test.pl @@ -240,7 +240,7 @@ test(kde_Init_Triangular_RTREE) :- test(kde_Init_CSV_Input) :- - open('/home/afkjakhes/eclipse-workspace/prolog-mlpack-libary/src/data_csv/iris2.csv', read, File), + open('src/data_csv/iris2.csv', read, File), take_csv_row(File, skipFirstRow,10, Data), initAndBuildModel(2.2, 0.25, 0.5, gaussian, kd_tree, dual_tree, 1, 0.75, 50, 2.0, 0.2, Data, 4). @@ -270,7 +270,7 @@ test(kde_EvalWithQuery) :- print(Estimation). test(kde_EvalWithQuery_CSV_Input) :- - open('/home/afkjakhes/eclipse-workspace/prolog-mlpack-libary/src/data_csv/iris2.csv', read, File), + open('src/data_csv/iris2.csv', read, File), take_csv_row(File, skipFirstRow,10, Data), initAndBuildModel(2.2, 0.25, 0.5, gaussian, kd_tree, dual_tree, 1, 0.75, 50, 2.0, 0.2, Data, 4), diff --git a/src/methods/kernel_pca/kernel_pca_test.pl b/src/methods/kernel_pca/kernel_pca_test.pl index f0c7864..18bf9e3 100644 --- a/src/methods/kernel_pca/kernel_pca_test.pl +++ b/src/methods/kernel_pca/kernel_pca_test.pl @@ -143,7 +143,7 @@ test(kernel_pca_Cosine) :- test(kernel_pca_CSV_Input) :- - open('/home/afkjakhes/eclipse-workspace/prolog-mlpack-libary/src/data_csv/iris2.csv', read, File), + open('src/data_csv/iris2.csv', read, File), take_csv_row(File, skipFirstRow,10, Data), kernel_pca(linear, 0, 0, kmeans, 1.0, 0.0, 1.0, 1.0, Data, 4, TransformedList, _, EigValList, EigVecList, _, 0), print('\nTransformedData: '), @@ -154,7 +154,7 @@ test(kernel_pca_CSV_Input) :- print(EigVecList). test(kernel_pca_CSV_Input_Same_NewDims) :- - open('/home/afkjakhes/eclipse-workspace/prolog-mlpack-libary/src/data_csv/iris2.csv', read, File), + open('src/data_csv/iris2.csv', read, File), take_csv_row(File, skipFirstRow,10, Data), kernel_pca(linear, 0, 0, kmeans, 1.0, 0.0, 1.0, 1.0, Data, 4, TransformedList, _, EigValList, EigVecList, _, 4), print('\nTransformedData: '), @@ -165,7 +165,7 @@ test(kernel_pca_CSV_Input_Same_NewDims) :- print(EigVecList). test(kernel_pca_CSV_Input_Smaller_NewDims) :- - open('/home/afkjakhes/eclipse-workspace/prolog-mlpack-libary/src/data_csv/iris2.csv', read, File), + open('src/data_csv/iris2.csv', read, File), take_csv_row(File, skipFirstRow,10, Data), kernel_pca(linear, 0, 0, kmeans, 1.0, 0.0, 1.0, 1.0, Data, 4, TransformedList, _, EigValList, EigVecList, _, 2), print('\nTransformedData: '), diff --git a/src/methods/kfn/kfn_test.pl b/src/methods/kfn/kfn_test.pl index 01dc66f..3e74176 100644 --- a/src/methods/kfn/kfn_test.pl +++ b/src/methods/kfn/kfn_test.pl @@ -33,7 +33,7 @@ test(testDescription3, [true(Error =:= 1)]) :- test(testDescription4, [true(Error =:= 0.9797958971132711)]) :- reset_Model_No_Train(perceptron), - open('/home/afkjakhes/eclipse-workspace/prolog-mlpack-libary/src/data_csv/iris2.csv', read, File), + open('src/data_csv/iris2.csv', read, File), take_csv_row(File, skipFirstRow,10, Data), train(Data, 4, [0,1,0,1,1,0,1,1,1,0], 2, perceptron, 50, 0.0001, Error). @@ -64,7 +64,7 @@ test(testDescription3, [true(Error =:= 1)]) :- test(testDescription4, [true(Error =:= 0.9797958971132711)]) :- reset_Model_No_Train(perceptron), - open('/home/afkjakhes/eclipse-workspace/prolog-mlpack-libary/src/data_csv/iris2.csv', read, File), + open('src/data_csv/iris2.csv', read, File), take_csv_row(File, skipFirstRow,10, Data), train(Data, 4, [0,1,0,1,1,0,1,1,1,0], 2, perceptron, 50, 0.0001, Error). @@ -95,7 +95,7 @@ test(testDescription3, [true(Error =:= 1)]) :- test(testDescription4, [true(Error =:= 0.9797958971132711)]) :- reset_Model_No_Train(perceptron), - open('/home/afkjakhes/eclipse-workspace/prolog-mlpack-libary/src/data_csv/iris2.csv', read, File), + open('src/data_csv/iris2.csv', read, File), take_csv_row(File, skipFirstRow,10, Data), train(Data, 4, [0,1,0,1,1,0,1,1,1,0], 2, perceptron, 50, 0.0001, Error). diff --git a/src/methods/kmeans/kmeans_test.pl b/src/methods/kmeans/kmeans_test.pl index 97e212c..65c7012 100644 --- a/src/methods/kmeans/kmeans_test.pl +++ b/src/methods/kmeans/kmeans_test.pl @@ -31,7 +31,7 @@ test(testDescription3, [true(Error =:= 1)]) :- test(testDescription4, [true(Error =:= 0.9797958971132711)]) :- reset_Model_No_Train(perceptron), - open('/home/afkjakhes/eclipse-workspace/prolog-mlpack-libary/src/data_csv/iris2.csv', read, File), + open('src/data_csv/iris2.csv', read, File), take_csv_row(File, skipFirstRow,10, Data), train(Data, 4, [0,1,0,1,1,0,1,1,1,0], 2, perceptron, 50, 0.0001, Error). diff --git a/src/methods/knn/knn_test.pl b/src/methods/knn/knn_test.pl index 7423a31..8d29958 100644 --- a/src/methods/knn/knn_test.pl +++ b/src/methods/knn/knn_test.pl @@ -33,7 +33,7 @@ test(testDescription3, [true(Error =:= 1)]) :- test(testDescription4, [true(Error =:= 0.9797958971132711)]) :- reset_Model_No_Train(perceptron), - open('/home/afkjakhes/eclipse-workspace/prolog-mlpack-libary/src/data_csv/iris2.csv', read, File), + open('src/data_csv/iris2.csv', read, File), take_csv_row(File, skipFirstRow,10, Data), train(Data, 4, [0,1,0,1,1,0,1,1,1,0], 2, perceptron, 50, 0.0001, Error). diff --git a/src/methods/lars/lars_test.pl b/src/methods/lars/lars_test.pl index f45ca33..23e55df 100644 --- a/src/methods/lars/lars_test.pl +++ b/src/methods/lars/lars_test.pl @@ -74,7 +74,7 @@ test(testDescription3, [true(Error =:= 1)]) :- test(testDescription4, [true(Error =:= 0.9797958971132711)]) :- reset_Model_No_Train(perceptron), - open('/home/afkjakhes/eclipse-workspace/prolog-mlpack-libary/src/data_csv/iris2.csv', read, File), + open('src/data_csv/iris2.csv', read, File), take_csv_row(File, skipFirstRow,10, Data), train(Data, 4, [0,1,0,1,1,0,1,1,1,0], 2, perceptron, 50, 0.0001, Error). diff --git a/src/methods/linear_regression/linear_regression_test.pl b/src/methods/linear_regression/linear_regression_test.pl index 6fe709f..39bafe9 100644 --- a/src/methods/linear_regression/linear_regression_test.pl +++ b/src/methods/linear_regression/linear_regression_test.pl @@ -78,7 +78,7 @@ test(testDescription3, [true(Error =:= 1)]) :- test(testDescription4, [true(Error =:= 0.9797958971132711)]) :- reset_Model_No_Train(perceptron), - open('/home/afkjakhes/eclipse-workspace/prolog-mlpack-libary/src/data_csv/iris2.csv', read, File), + open('src/data_csv/iris2.csv', read, File), take_csv_row(File, skipFirstRow,10, Data), train(Data, 4, [0,1,0,1,1,0,1,1,1,0], 2, perceptron, 50, 0.0001, Error). diff --git a/src/methods/new_method/new_method_test.pl b/src/methods/new_method/new_method_test.pl index 78fdfd7..043589b 100644 --- a/src/methods/new_method/new_method_test.pl +++ b/src/methods/new_method/new_method_test.pl @@ -33,7 +33,7 @@ test(testDescription3, [true(Error =:= 1)]) :- test(testDescription4, [true(Error =:= 0.9797958971132711)]) :- reset_Model_No_Train(perceptron), - open('/home/afkjakhes/eclipse-workspace/prolog-mlpack-libary/src/data_csv/iris2.csv', read, File), + open('src/data_csv/iris2.csv', read, File), take_csv_row(File, skipFirstRow,10, Data), train(Data, 4, [0,1,0,1,1,0,1,1,1,0], 2, perceptron, 50, 0.0001, Error). diff --git a/src/methods/sparse_coding/sparse_coding_test.pl b/src/methods/sparse_coding/sparse_coding_test.pl index 16cfca8..6290c0a 100644 --- a/src/methods/sparse_coding/sparse_coding_test.pl +++ b/src/methods/sparse_coding/sparse_coding_test.pl @@ -8,7 +8,7 @@ reset_Model_With_Train_A :- - open('/home/afkjakhes/eclipse-workspace/prolog-mlpack-libary/src/data_csv/iris2.csv', read, File), + open('src/data_csv/iris2.csv', read, File), take_csv_row(File, skipFirstRow,20, Data), initModelWithTrain(Data,4,15,0.1,0.0,100,0.01,0.000001). reset_Model_No_Train_A :- @@ -53,7 +53,7 @@ test(initModelWithTrain_Changed_Input) :- initModelWithTrain([5.1,3.5,1.4,4.9,3.0,1.4,4.7,3.2,1.3,4.6,3.1,1.5], 6,2,2.3,0.1,30,0.002,0.0001). test(initModelWithTrain_CSV_Use) :- - open('/home/afkjakhes/eclipse-workspace/prolog-mlpack-libary/src/data_csv/iris2.csv', read, File), + open('src/data_csv/iris2.csv', read, File), take_csv_row(File, skipFirstRow,20, Data), initModelWithTrain(Data,4,15,0.1,0.0,100,0.01,0.000001). @@ -128,7 +128,7 @@ test(encode_Normal_Use1) :- test(encode_Normal_Use2) :- reset_Model_No_Train_A, - open('/home/afkjakhes/eclipse-workspace/prolog-mlpack-libary/src/data_csv/iris2.csv', read, File), + open('src/data_csv/iris2.csv', read, File), take_csv_row(File, skipFirstRow,10, Data), train(Data, 4, _), encode([5.1,3.5,1.4,4.9,3.0,1.4,4.7,3.2,1.3,4.6,3.1,1.5], 4, CodesList, CodesRows), @@ -168,7 +168,7 @@ test(train_With_Direkt_Input) :- test(train_With_CSV_Input) :- reset_Model_No_Train_A, - open('/home/afkjakhes/eclipse-workspace/prolog-mlpack-libary/src/data_csv/iris2.csv', read, File), + open('src/data_csv/iris2.csv', read, File), take_csv_row(File, skipFirstRow,20, Data), train(Data, 4, ObjectiveValue), print(ObjectiveValue). -- GitLab