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

typo

parent 1849f5d9
No related branches found
No related tags found
No related merge requests found
Pipeline #3376 passed
......@@ -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:
......
No preview for this file type
......@@ -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()
......@@ -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:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment