Repository: dpuenteramirez/Semisupervised-learning-and-instance-selection-methods (language: python)

Issue:
Unify ACC & MSE graphs of tests with labels based on given percentages
Individual graphs had already been generated for each data set, in order to have a global representation, they should all be unified into one, respectively.
Unify ACC & MSE graphs of tests with labels based on given percentages
Individual graphs had already been generated for each data set, in order to have a global representation, they should all be unified into one, respectively.
Unify ACC & MSE graphs of tests with labels based on given percentages
Individual graphs had already been generated for each data set, in order to have a global representation, they should all be unified into one, respectively.
Unify ACC & MSE graphs of tests with labels based on given percentages
Individual graphs had already been generated for each data set, in order to have a global representation, they should all be unified into one, respectively.


Discussion / hints:
Branch [issue-31-Unify_ACC_&_MSE_graphs_of_tests_with_labels_based_on_given_percentages](https://github.com/dpr1005/Semisupervised-learning-and-instance-selection-methods/tree/issue-31-Unify_ACC_&_MSE_graphs_of_tests_with_labels_based_on_given_percentages) created!
Branch [issue-31-Unify_ACC_&_MSE_graphs_of_tests_with_labels_based_on_given_percentages](https://github.com/dpr1005/Semisupervised-learning-and-instance-selection-methods/tree/issue-31-Unify_ACC_&_MSE_graphs_of_tests_with_labels_based_on_given_percentages) created!
Branch [issue-31-Unify_ACC_&_MSE_graphs_of_tests_with_labels_based_on_given_percentages](https://github.com/dpr1005/Semisupervised-learning-and-instance-selection-methods/tree/issue-31-Unify_ACC_&_MSE_graphs_of_tests_with_labels_based_on_given_percentages) created!
Branch [issue-31-Unify_ACC_&_MSE_graphs_of_tests_with_labels_based_on_given_percentages](https://github.com/dpr1005/Semisupervised-learning-and-instance-selection-methods/tree/issue-31-Unify_ACC_&_MSE_graphs_of_tests_with_labels_based_on_given_percentages) created!

Fix patch:
diff --git a/Instance Selection Algorithms/plot_csv_percent.py b/Instance Selection Algorithms/plot_csv_percent.py
index 991afec..e27d4d8 100644
--- a/Instance Selection Algorithms/plot_csv_percent.py
+++ b/Instance Selection Algorithms/plot_csv_percent.py
@@ -15,7 +15,7 @@ def test_unlabeled(dataset):
     folder = './test_unlabeled/'
 
     files = next(walk(folder), (None, None, []))[2]
-    
+
     for file in files:
         if '.csv' in file and ('KNN' in file or 'Tree' in file):
             name = folder + file
@@ -47,11 +47,11 @@ def test_unlabeled(dataset):
     axs[0, 0].set_ylabel('KNN')
     axs[1, 0].set_ylabel('Tree')
 
-    axs[1, 0].set_xlabel("Precision")
-    axs[1, 1].set_xlabel("Precision")
+    axs[1, 0].set_xlabel("So much per one labeled")
+    axs[1, 1].set_xlabel("So much per one labeled")
 
     plt.tight_layout()
-    plt.savefig(folder+dataset)
+    plt.savefig(folder + dataset)
     plt.show()
 
 
@@ -61,13 +61,45 @@ def plot_self_tarining(dataset):
     print(datasets)
 
 
+def plot_unlabeled_to_one():
+    df_knn_acc = pd.read_csv(
+        './test_unlabeled/test_unlabeled_cross_validation_KNN_acc.csv')
+    df_knn_mse = pd.read_csv(
+        './test_unlabeled/test_unlabeled_cross_validation_KNN_mse.csv')
+    df_tree_acc = pd.read_csv(
+        './test_unlabeled/test_unlabeled_cross_validation_Tree_acc.csv')
+    df_tree_mse = pd.read_csv(
+        './test_unlabeled/test_unlabeled_cross_validation_Tree_mse.csv')
+
+    knn_acc = df_knn_acc.to_numpy()
+    knn_mse = df_knn_mse.to_numpy()
+    tree_acc = df_tree_acc.to_numpy()
+    tree_mse = df_tree_mse.to_numpy()
+    datasets = [knn_acc, knn_mse, tree_acc, tree_mse]
+    str_datasets = ['KNN_acc', 'KNN_mse', 'Tree_acc', 'Tree_mse']
+
+    precision = np.array(df_knn_acc.keys()[1:])
+    precision = np.asfarray(precision)
+
+    for index, dataset in enumerate(datasets):
+
+        fig, ax = plt.subplots(figsize=(10, 10))
+        for d in dataset:
+            plt.plot(precision, d[1:])
+        ax.set_xlabel("So much per one labeled")
+        ax.set_ylabel('Correct prediction')
+        ax.set_title(str_datasets[index])
+
+        plt.tight_layout()
+        plt.savefig(f'./test_unlabeled/all_in_one_{str_datasets[index]}')
+
+
 if __name__ == '__main__':
     parser = argparse.ArgumentParser()
     parser.add_argument('--d', nargs=1)
     args = parser.parse_args()
 
     dataset = 'page-blocks' if args.d is None else str(args.d[0])
-    test_unlabeled(dataset)
-    #plot_self_tarining(dataset)
-
-
+    # test_unlabeled(dataset)
+    # plot_self_tarining(dataset)
+    plot_unlabeled_to_one()


Test patch:
diff --git a/Instance Selection Algorithms/test_unlabeled/all_in_one_KNN_acc.png b/Instance Selection Algorithms/test_unlabeled/all_in_one_KNN_acc.png
new file mode 100644
index 0000000..0ff258d
Binary files /dev/null and b/Instance Selection Algorithms/test_unlabeled/all_in_one_KNN_acc.png differ
diff --git a/Instance Selection Algorithms/test_unlabeled/all_in_one_KNN_mse.png b/Instance Selection Algorithms/test_unlabeled/all_in_one_KNN_mse.png
new file mode 100644
index 0000000..7374555
Binary files /dev/null and b/Instance Selection Algorithms/test_unlabeled/all_in_one_KNN_mse.png differ
diff --git a/Instance Selection Algorithms/test_unlabeled/all_in_one_Tree_acc.png b/Instance Selection Algorithms/test_unlabeled/all_in_one_Tree_acc.png
new file mode 100644
index 0000000..249ca80
Binary files /dev/null and b/Instance Selection Algorithms/test_unlabeled/all_in_one_Tree_acc.png differ
diff --git a/Instance Selection Algorithms/test_unlabeled/all_in_one_Tree_mse.png b/Instance Selection Algorithms/test_unlabeled/all_in_one_Tree_mse.png
new file mode 100644
index 0000000..c5676f8
Binary files /dev/null and b/Instance Selection Algorithms/test_unlabeled/all_in_one_Tree_mse.png differ
diff --git a/Instance Selection Algorithms/test_unlabeled/banana.png b/Instance Selection Algorithms/test_unlabeled/banana.png
index 2cf4e36..c7dda89 100644
Binary files a/Instance Selection Algorithms/test_unlabeled/banana.png and b/Instance Selection Algorithms/test_unlabeled/banana.png differ
diff --git a/Instance Selection Algorithms/test_unlabeled/contraceptive.png b/Instance Selection Algorithms/test_unlabeled/contraceptive.png
index 0ace235..f5d827f 100644
Binary files a/Instance Selection Algorithms/test_unlabeled/contraceptive.png and b/Instance Selection Algorithms/test_unlabeled/contraceptive.png differ
diff --git a/Instance Selection Algorithms/test_unlabeled/page-blocks.png b/Instance Selection Algorithms/test_unlabeled/page-blocks.png
index 58b8ffb..7f0c1e2 100644
Binary files a/Instance Selection Algorithms/test_unlabeled/page-blocks.png and b/Instance Selection Algorithms/test_unlabeled/page-blocks.png differ
diff --git a/Instance Selection Algorithms/test_unlabeled/phoneme.png b/Instance Selection Algorithms/test_unlabeled/phoneme.png
index 23b0d68..2791d57 100644
Binary files a/Instance Selection Algorithms/test_unlabeled/phoneme.png and b/Instance Selection Algorithms/test_unlabeled/phoneme.png differ
diff --git a/Instance Selection Algorithms/test_unlabeled/segment.png b/Instance Selection Algorithms/test_unlabeled/segment.png
index be40d66..25e06f6 100644
Binary files a/Instance Selection Algorithms/test_unlabeled/segment.png and b/Instance Selection Algorithms/test_unlabeled/segment.png differ
diff --git a/Instance Selection Algorithms/test_unlabeled/texture.png b/Instance Selection Algorithms/test_unlabeled/texture.png
index 901bd75..d42a171 100644
Binary files a/Instance Selection Algorithms/test_unlabeled/texture.png and b/Instance Selection Algorithms/test_unlabeled/texture.png differ
diff --git a/Instance Selection Algorithms/test_unlabeled/titanic.png b/Instance Selection Algorithms/test_unlabeled/titanic.png
index 2fa3063..34e9781 100644
Binary files a/Instance Selection Algorithms/test_unlabeled/titanic.png and b/Instance Selection Algorithms/test_unlabeled/titanic.png differ
diff --git a/Instance Selection Algorithms/test_unlabeled/whinequality-red.png b/Instance Selection Algorithms/test_unlabeled/whinequality-red.png
index 5662db5..213e5d0 100644
Binary files a/Instance Selection Algorithms/test_unlabeled/whinequality-red.png and b/Instance Selection Algorithms/test_unlabeled/whinequality-red.png differ
diff --git a/Instance Selection Algorithms/test_unlabeled/whinequality-white.png b/Instance Selection Algorithms/test_unlabeled/whinequality-white.png
index 679b1ad..7b54b9f 100644
Binary files a/Instance Selection Algorithms/test_unlabeled/whinequality-white.png and b/Instance Selection Algorithms/test_unlabeled/whinequality-white.png differ
diff --git a/Instance Selection Algorithms/test_unlabeled/yeast.png b/Instance Selection Algorithms/test_unlabeled/yeast.png
index 0262e5f..ef64bdf 100644
Binary files a/Instance Selection Algorithms/test_unlabeled/yeast.png and b/Instance Selection Algorithms/test_unlabeled/yeast.png differ