Skip to content
Snippets Groups Projects
Commit 59146432 authored by Dominique Benielli's avatar Dominique Benielli
Browse files

test iP

parent 733eb98d
No related branches found
No related tags found
No related merge requests found
......@@ -310,7 +310,7 @@ def get_classic_db_hdf5(views, path_f, name_DB, nb_class, asked_labels_names,
noise_std)
else:
pass
return dataset, labels_dictionary, dataset_name
return dataset_file, labels_dictionary, dataset_name
def add_gaussian_noise(dataset_file, random_state, path_f, dataset_name,
......
......@@ -6,7 +6,7 @@ import numpy as np
from .utils import rm_tmp, tmp_path
from ..mono_multi_view_classifiers import exec_classif
from multiview_platform.mono_multi_view_classifiers import exec_classif
class Test_initBenchmark(unittest.TestCase):
......@@ -232,7 +232,7 @@ class Test_execBenchmark(unittest.TestCase):
@classmethod
def setUpClass(cls):
rm_tmp()
os.mkdir("multiview_platform/tests/tmp_tests")
os.mkdir("./tests/tmp_tests")
cls.Dataset = h5py.File(
tmp_path+"test_file.hdf5", "w")
cls.labels = cls.Dataset.create_dataset("Labels",
......@@ -333,10 +333,10 @@ class FakeKfold():
class Test_execOneBenchmark(unittest.TestCase):
@classmethod
def setUp(cls):
rm_tmp()
os.mkdir("multiview_platform/tests/tmp_tests")
print(os.getcwd())
os.mkdir("../tests/tmp_tests")
cls.args = {
"Base": {"name": "chicken_is_heaven", "type": "type",
"pathf": "pathF"},
......@@ -403,7 +403,7 @@ class Test_execOneBenchmark_multicore(unittest.TestCase):
@classmethod
def setUpClass(cls):
rm_tmp()
os.mkdir("multiview_platform/tests/tmp_tests")
os.mkdir("./tests/tmp_tests")
cls.args = {
"Base": {"name": "chicken_is_heaven", "type": "type",
"pathf": "pathF"},
......@@ -809,3 +809,6 @@ class Test_get_path_dict(unittest.TestCase):
# suite.addTest(Test_initBenchmark('test_initKWARGSFunc_no_monoview'))
# # suite.addTest(WidgetTestCase('test_widget_resize'))
# return suite
if __name__ == '__main__':
unittest.main()
\ No newline at end of file
......@@ -68,3 +68,7 @@ class Test_DiversityFusion(unittest.TestCase):
classifier_names=self.classifier_names,
classifiers_config=self.classifiers_config)
clf.fit(self.X, self.y, self.train_indices, self.views_indices)
if __name__ == '__main__':
unittest.main()
\ No newline at end of file
This diff is collapsed.
......@@ -13,7 +13,7 @@ class Test_get_the_args(unittest.TestCase):
def setUpClass(cls):
rm_tmp()
cls.path_to_config_file = tmp_path+"config_temp.yml"
os.mkdir("multiview_platform/tests/tmp_tests")
os.mkdir("./multiview_platform/tests/tmp_tests")
data = {"Base":{"first_arg": 10, "second_arg":[12.5, 1e-06]}, "Classification":{"third_arg":True}}
with open(cls.path_to_config_file, "w") as config_file:
yaml.dump(data, config_file)
......@@ -74,3 +74,5 @@ class Test_get_the_args(unittest.TestCase):
# value = configuration.format_raw_arg("list_str ; list string")
# self.assertEqual(value, ["list", "string"])
if __name__ == '__main__':
unittest.main()
\ No newline at end of file
......@@ -95,3 +95,6 @@ class Test_Dataset(unittest.TestCase):
self.assertEqual(dataset_object.get_view_dict(), {"ViewN0":0,
"ViewN1": 1,
"ViewN2": 2,})
if __name__ == '__main__':
unittest.main()
\ No newline at end of file
......@@ -225,3 +225,6 @@ class Test_genArgumentDictionaries(unittest.TestCase):
np.array([0, 1, -100, 0, 1])]
cls.labelsCombinations = [[0, 1], [0, 2], [1, 2]]
cls.indicesMulticlass = [[[[], []], [[], []], [[], []]], [[], [], []]]
if __name__ == '__main__':
unittest.main()
\ No newline at end of file
......@@ -56,3 +56,9 @@ class Test_randomized_search(unittest.TestCase):
self.dataset_file, self.labels.value, "multiview", self.random_state, tmp_path,
weighted_linear_early_fusion, "WeightedLinearEarlyFusion", self.k_folds,
1, ["accuracy_score", None], 2, {}, learning_indices=self.learning_indices)
if __name__ == '__main__':
# unittest.main()
suite = unittest.TestLoader().loadTestsFromTestCase(Test_randomized_search)
unittest.TextTestRunner(verbosity=2).run(suite)
\ No newline at end of file
......@@ -43,3 +43,6 @@ class Test_genMulticlassLabels(unittest.TestCase):
-100,
1, -100, 0, 0, 1, 0, -100, 0,
-100]))
if __name__ == '__main__':
unittest.main()
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment