diff --git a/src/helper_files/helper_tests.pl b/src/helper_files/helper_tests.pl index 183f5b388150c72fcadadcae17d41ff6822a4ffe..3c6dc20afd3bf549834d45a47c8e5dc9fba2b0d5 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 a930b619e1509d05d05498da33abdf1ce9f23873..f65ba55c0e7f31c1a9839b84337f60d7b9648079 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 6e5d6df774d516d384c313dbf95ac8ff5b374fe8..b37a3845ab9ba6bdea4ed8766397d78ee1c45baf 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 86bb61e38bd6b9b5ae90d2c4c3cfef3e80fe320a..264118c02761009ab54854d47de1e2157ccfa676 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 112d030011396c38970006f2f7d8c98873521ad9..a7535d0efc0f16068b48fa36d685139a037c1273 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 209f0a7a3dc547d4b13fc23ae271997592e94592..712d1c19d78d94df50850c1d890d9f477017fd69 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 2514ff1b7957ec5309a13ab222cf1261488dd749..52fa6892abeade79ef61813a102d1afb08b032aa 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 1ba17d322316918212569df26e4022412fbd7596..1d5aeeb3a429fbb3fc96a9d77b157034ac15a5c8 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 a1dbaabe9963baa4481d4cae8982f2a3bb58faff..75280e5e39bb15cfc5d64639beb8d3abf022a998 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 ba0891761a995b3d8061aed24c7af077217e577b..1199aac8678e0df2442e7b860e0929fceb01defa 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 f0c7864a9ff9c746e4749ead75fca94843bfe94e..18bf9e337953e26672813dad01e58b5b879cdeb3 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 01dc66fa540d5246667740947bc19a7396230684..3e74176831b05961006cbc22c88d4793f6206df5 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 97e212cbd8c69b22be27488930fc44883806cb8c..65c70127189fd3cc765f93a31edfc90462de97d1 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 7423a31852031e3910cb3da511df4cf378195822..8d29958e64376d41609917112f8f0cf47d5889bf 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 f45ca33bae459676b120cf161f84d287ab4fa334..23e55df2df19392e7f53f3e6c678e8f805a06e0c 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 6fe709fdfebdd183e952a93ab9a64f947f2e2a61..39bafe91febb9e17a3bbdbc2e433024f202e55dc 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 78fdfd725191e5b9c2abe7b22269175add5456fc..043589b4f3e3d92b84e74b08275f8565113119f1 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 16cfca88b436e2eef3599761d9a49efc8c63b822..6290c0a4f210b89691b02b40c155875482b0e2d1 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).