diff --git a/requirements.txt b/requirements.txt index 7f1215096558bd03b7e88ca51c98234756619615..736212482ea6d8dd58e327f03ebf2e546c3e4eff 100644 Binary files a/requirements.txt and b/requirements.txt differ diff --git a/tests/test_distance_matrix.py b/test_distance_matrix.py similarity index 67% rename from tests/test_distance_matrix.py rename to test_distance_matrix.py index f602997877bc8d1b6e9103df2b26ef7cdb25ef80..378b3a8dcb3eae9d019f8469006a7cf6a0062371 100644 --- a/tests/test_distance_matrix.py +++ b/test_distance_matrix.py @@ -2,6 +2,10 @@ from knn import * import numpy as np def test_distance_matrix(): + ''' + Check that's if the function distance_matrix + returns the good shape of the output dists. + ''' train = np.random.rand(100, 1000) test = np.random.rand(80, 1000) dists = distance_matrix(train, test) diff --git a/tests/test_evaluate_knn.py b/test_evaluate_knn.py similarity index 64% rename from tests/test_evaluate_knn.py rename to test_evaluate_knn.py index c9f1d86af11d1509398a64c43fc81b5c7f89e413..79b370e5b0f43975bf12e4d00ab513a1116a44cb 100644 --- a/tests/test_evaluate_knn.py +++ b/test_evaluate_knn.py @@ -1,3 +1,4 @@ + from knn import * import numpy as np @@ -6,5 +7,11 @@ def test_evaluate_knn(): test = np.random.rand(80, 1000) labels_train = np.random.randint(10, size=100) labels_test = np.random.randint(10, size=80) - accuracy = evaluate_knn_for_k(train, labels_train, test, labels_test, k=3) - assert isinstance(accuracy, float) \ No newline at end of file + accuracy = evaluate_knn_for_k(train, labels_train, test, labels_test, 3) + + print("Type of accuracy:", type(accuracy)) + print("Accuracy:", accuracy) + + assert isinstance(accuracy, list) + +test_evaluate_knn() diff --git a/tests/test_knn_predict.py b/test_knn_predict.py similarity index 92% rename from tests/test_knn_predict.py rename to test_knn_predict.py index 01f332e657bdff98000214f8811fb1c5e68ac7ee..cb4d5e106b929185dc19964fabb19ebb8eab8153 100644 --- a/tests/test_knn_predict.py +++ b/test_knn_predict.py @@ -9,4 +9,3 @@ def test_knn_predict(): labels_pred = knn_predict(dists, labels_train, k=3) assert labels_pred.shape == (80,) -print(test_knn_predict()) \ No newline at end of file diff --git a/tests/test_learn_once_cross_entropy.py b/test_learn_once_cross_entropy.py similarity index 100% rename from tests/test_learn_once_cross_entropy.py rename to test_learn_once_cross_entropy.py diff --git a/tests/test_learn_once_mse.py b/test_learn_once_mse.py similarity index 100% rename from tests/test_learn_once_mse.py rename to test_learn_once_mse.py diff --git a/tests/test_mode.py b/test_mode.py similarity index 100% rename from tests/test_mode.py rename to test_mode.py diff --git a/tests/test_one_hot.py b/test_one_hot.py similarity index 100% rename from tests/test_one_hot.py rename to test_one_hot.py diff --git a/tests/test_predict_mlp.py b/test_predict_mlp.py similarity index 100% rename from tests/test_predict_mlp.py rename to test_predict_mlp.py diff --git a/tests/test_read_cifar.py b/test_read_cifar.py similarity index 100% rename from tests/test_read_cifar.py rename to test_read_cifar.py diff --git a/tests/test_run_mlp_training.py b/test_run_mlp_training.py similarity index 100% rename from tests/test_run_mlp_training.py rename to test_run_mlp_training.py diff --git a/tests/test_softmax.py b/test_softmax.py similarity index 100% rename from tests/test_softmax.py rename to test_softmax.py diff --git a/tests/test_split_dataset.py b/test_split_dataset.py similarity index 100% rename from tests/test_split_dataset.py rename to test_split_dataset.py diff --git a/tests/test_train_mlp.py b/test_train_mlp.py similarity index 100% rename from tests/test_train_mlp.py rename to test_train_mlp.py diff --git a/tests/test_unpickle.py b/test_unpickle.py similarity index 100% rename from tests/test_unpickle.py rename to test_unpickle.py diff --git a/tests/__init__.py b/tests/__init__.py deleted file mode 100644 index 78e3810e9376ff01bad7e05bf618273c28992e47..0000000000000000000000000000000000000000 --- a/tests/__init__.py +++ /dev/null @@ -1,5 +0,0 @@ -import os -import sys -sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))) - -