diff --git a/config_files/config.yml b/config_files/config.yml index 5c3f48fc24d18b5e334592eea9446d6045da8efe..a10fa2737f24f3477fdd112482875136aa09af69 100644 --- a/config_files/config.yml +++ b/config_files/config.yml @@ -5,7 +5,7 @@ Base : label: "_" type: ".hdf5" views: ["all"] - pathf: "../Data/" + pathf: "../data/" nice: 0 random_state: 42 nb_cores: 1 @@ -13,7 +13,7 @@ Base : debug: True add_noise: False noise_std: 0.0 - res_dir: "../Results/" + res_dir: "../results/" # All the classification-realted configuration options Classification: diff --git a/data/Plausible.hdf5 b/data/Plausible.hdf5 index 947a30ea7b8b7213f075b8c03149c4efd0e5df28..331fea8b825aa82ae829a32ffe09809f5e2880ff 100644 Binary files a/data/Plausible.hdf5 and b/data/Plausible.hdf5 differ diff --git a/multiview_platform/mono_multi_view_classifiers/utils/make_file_config.py b/multiview_platform/mono_multi_view_classifiers/utils/make_file_config.py index 121e1f869c321aabd6a287632c7401c67210257f..ac53853a52f0338b3bbf1e289a2582f5f4d2707a 100644 --- a/multiview_platform/mono_multi_view_classifiers/utils/make_file_config.py +++ b/multiview_platform/mono_multi_view_classifiers/utils/make_file_config.py @@ -4,39 +4,20 @@ import os, sys, inspect import importlib -classifier_dict = {"0": ['mono', 'Adaboost', - 'multiview_platform.mono_multi_view_classifiers.monoview_classifiers.adaboost']} -val = classifier_dict["0"] -mymodule = importlib.import_module(val[2]) - -for name in dir(mymodule): - att = getattr(mymodule, name) - try: - getattr(att, "__module__") - if att.__module__.startswith(mymodule.__name__): - if inspect.isclass(att): - print(att) - print(name) - except Exception: - pass - - -parameter = {"0":[]} -instring = "multiview_platform/mono_multi_view_classifiers/monoview_classifiers/" - -if instring in mymodule.__file__: - monInstance = getattr(mymodule, 'Adaboost') - sig = inspect.signature(monInstance.__init__) - for arg_idx, name in enumerate(sig.parameters): - param= sig.parameters[name] - if not name.startswith('self'): - parameter["0"].append(name) - - if param.default is not inspect.Parameter.empty: - value_default = param.default - else: - value_default = 'None' - print() +# +# if instring in mymodule.__file__: +# +# sig = inspect.signature(monInstance.__init__) +# for arg_idx, name in enumerate(sig.parameters): +# param= sig.parameters[name] +# if not name.startswith('self'): +# parameter["0"].append(name) +# +# if param.default is not inspect.Parameter.empty: +# value_default = param.default +# else: +# value_default = 'None' +# print() class ConfigurationMaker(): @@ -57,6 +38,7 @@ class ConfigurationMaker(): for key, val in classifier_dict.items(): mymodule = importlib.import_module(val[2]) names.append(self._get_module_name(mymodule)) + monInstance = getattr(mymodule, val[1]) def _get_module_name(self, mymodule): @@ -72,81 +54,6 @@ class ConfigurationMaker(): return None return None -# mymodule = importlib.import_module(val[2]) -# module_file = mymodule.__file__ -# getattr(self._path_classifier_mono, module_file[:-3]) -# -# #__import__(val[1], locals(), globals(), [], 1) -# sig = inspect.signature(val[1]+"."+val[0]) -# print(sig) -# for arg_idx, name in enumerate(sig.parameters): -# print(arg_idx) -# print(name) -# -# -# def make(dir='.', output=None): -# """ -# Generate file config from classifier files -# :param dir: (default'.' -# :dir type: str or list of str -# :return: -# """ -# -# currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))) -# parentdir = os.path.dirname(currentdir) -# sys.path.insert(0, parentdir) -# -# -# # calling_module = inspect.getmodule(stack_frame[0]) -# -# -# -# path = os.getcwd() + '/multiview_platform/' -# files = [] -# # r=root, d=directories, f = files -# for r, d, f in os.walk(path): -# print('dir', d) -# print('root', r) -# for file in f: -# if '.py' in file and not file.startswith('__init__'): -# print("file", file) -# files.append(os.path.join(r, file)) -# -# for f in files: -# print(f) -# -# for module in os.listdir(os.path.dirname(os.path.realpath(__file__))): -# if module == '__init__.py' or module[-3:] != '.py': -# continue -# print(module) -# __import__(module[:-3], locals(), globals(), [], 1) -# -# import glob -# -# path = 'c:\\projects\\hc2\\' -# -# files = [f for f in glob.glob(path + "**/*.txt", recursive=True)] -# -# for f in files: -# print(f) -# -# import inspect -# -# -# # Import this to other module and call it -# def print_caller_info(): -# # Get the full stack -# stack = inspect.stack() -# -# # Get one level up from current -# previous_stack_frame = stack[1] -# print(previous_stack_frame.filename) # Filename where caller lives -# -# # Get the module object of the caller -# calling_module = inspect.getmodule(stack_frame[0]) -# print(calling_module) -# print(calling_module.__file__) -# -# -# if __name__ == '__main__': -# print_caller_info() \ No newline at end of file + +if __name__ == '__main__': + ConfigurationMaker() diff --git a/setup.py b/setup.py index 4b3122f16a18b34b26c7d4c58e1d2bc552b82a62..71baa7adce8f806d199d37837581f6fa74a39b2f 100644 --- a/setup.py +++ b/setup.py @@ -54,7 +54,7 @@ def setup_package(): # Une url qui pointe vers la page officielle de votre lib url='http://github.com/babau1/multiview-machine-learning-omis/', install_requires=['numpy>=1.8', 'scipy>=0.16','scikit-learn==0.19', - 'h5py', 'joblib', 'pyscm', 'pandas', 'm2r', 'yaml'], + 'h5py', 'joblib', 'pyscm', 'pandas', 'm2r', 'pyyaml'], # Il est d'usage de mettre quelques metadata à propos de sa lib # Pour que les robots puissent facilement la classer. # La liste des marqueurs autorisées est longue: