nkululeko 0.77.5__py3-none-any.whl → 0.77.6__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
nkululeko/aug_train.py CHANGED
@@ -11,15 +11,7 @@ import nkululeko.glob_conf as glob_conf
11
11
  from nkululeko.augment import doit as augment
12
12
 
13
13
 
14
- def main(src_dir):
15
- parser = argparse.ArgumentParser(description="Call the nkululeko framework.")
16
- parser.add_argument("--config", default="exp.ini", help="The base configuration")
17
- args = parser.parse_args()
18
- if args.config is not None:
19
- config_file = args.config
20
- else:
21
- config_file = f"{src_dir}/exp.ini"
22
-
14
+ def doit(config_file):
23
15
  # test if the configuration file exists
24
16
  if not os.path.isfile(config_file):
25
17
  print(f"ERROR: no such file: {config_file}")
@@ -87,6 +79,17 @@ def main(src_dir):
87
79
  print("DONE")
88
80
 
89
81
 
82
+ def main(src_dir):
83
+ parser = argparse.ArgumentParser(description="Call the nkululeko framework.")
84
+ parser.add_argument("--config", default="exp.ini", help="The base configuration")
85
+ args = parser.parse_args()
86
+ if args.config is not None:
87
+ config_file = args.config
88
+ else:
89
+ config_file = f"{src_dir}/exp.ini"
90
+ doit(config_file)
91
+
92
+
90
93
  if __name__ == "__main__":
91
94
  cwd = os.path.dirname(os.path.abspath(__file__))
92
95
  main(cwd) # use this if you want to state the config file path on command line
nkululeko/constants.py CHANGED
@@ -1,2 +1,2 @@
1
- VERSION="0.77.5"
1
+ VERSION="0.77.6"
2
2
  SAMPLING_RATE = 16000
@@ -7,7 +7,6 @@ from sklearn.tree import DecisionTreeClassifier
7
7
  from sklearn.linear_model import LinearRegression
8
8
  from sklearn.tree import DecisionTreeRegressor
9
9
  import matplotlib.pyplot as plt
10
- from xgboost import XGBClassifier, XGBRegressor
11
10
  from nkululeko.utils.util import Util
12
11
  from nkululeko.utils.stats import normalize
13
12
  from nkululeko.plots import Plots
@@ -126,6 +125,8 @@ class FeatureAnalyser:
126
125
  plots = Plots()
127
126
  plots.plot_tree(model, self.features)
128
127
  elif model_s == "xgb":
128
+ from xgboost import XGBClassifier
129
+
129
130
  model = XGBClassifier(enable_categorical=True, tree_method="hist")
130
131
  self.labels = self.labels.astype("category")
131
132
  result_importances[model_s] = self._get_importance(
@@ -171,6 +172,8 @@ class FeatureAnalyser:
171
172
  model, permutation
172
173
  )
173
174
  elif model_s == "xgr":
175
+ from xgboost import XGBClassifier
176
+
174
177
  model = XGBRegressor()
175
178
  result_importances[model_s] = self._get_importance(
176
179
  model, permutation
nkululeko/nkululeko.py CHANGED
@@ -9,15 +9,7 @@ from nkululeko.utils.util import Util
9
9
  from nkululeko.constants import VERSION
10
10
 
11
11
 
12
- def main(src_dir):
13
- parser = argparse.ArgumentParser(description="Call the nkululeko framework.")
14
- parser.add_argument("--config", default="exp.ini", help="The base configuration")
15
- args = parser.parse_args()
16
- if args.config is not None:
17
- config_file = args.config
18
- else:
19
- config_file = f"{src_dir}/exp.ini"
20
-
12
+ def doit(config_file):
21
13
  # test if the configuration file exists
22
14
  if not os.path.isfile(config_file):
23
15
  print(f"ERROR: no such file: {config_file}")
@@ -54,11 +46,22 @@ def main(src_dir):
54
46
  expr.init_runmanager()
55
47
 
56
48
  # run the experiment
57
- expr.run()
58
-
49
+ reports = expr.run()
50
+ result = reports[-1].result.test
59
51
  expr.store_report()
60
-
61
52
  print("DONE")
53
+ return result
54
+
55
+
56
+ def main(src_dir):
57
+ parser = argparse.ArgumentParser(description="Call the nkululeko framework.")
58
+ parser.add_argument("--config", default="exp.ini", help="The base configuration")
59
+ args = parser.parse_args()
60
+ if args.config is not None:
61
+ config_file = args.config
62
+ else:
63
+ config_file = f"{src_dir}/exp.ini"
64
+ doit(config_file)
62
65
 
63
66
 
64
67
  if __name__ == "__main__":
nkululeko/utils/util.py CHANGED
@@ -25,6 +25,10 @@ class Util:
25
25
  ]
26
26
 
27
27
  def __init__(self, caller=None, has_config=True):
28
+ if caller is not None:
29
+ self.caller = caller
30
+ else:
31
+ self.caller = ""
28
32
  if has_config:
29
33
  import nkululeko.glob_conf as glob_conf
30
34
 
@@ -36,10 +40,7 @@ class Util:
36
40
  self.error(f"no such file: {self.got_data_roots}")
37
41
  self.data_roots = configparser.ConfigParser()
38
42
  self.data_roots.read(self.got_data_roots)
39
- if caller is not None:
40
- self.caller = caller
41
- else:
42
- self.caller = ""
43
+ self.debug(f"getting data roots from {self.got_data_roots}")
43
44
 
44
45
  def get_path(self, entry):
45
46
  """
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: nkululeko
3
- Version: 0.77.5
3
+ Version: 0.77.6
4
4
  Summary: Machine learning audio prediction experiments based on templates
5
5
  Home-page: https://github.com/felixbur/nkululeko
6
6
  Author: Felix Burkhardt
@@ -311,6 +311,10 @@ F. Burkhardt, Johannes Wagner, Hagen Wierstorf, Florian Eyben and Björn Schulle
311
311
  Changelog
312
312
  =========
313
313
 
314
+ Version 0.77.6
315
+ --------------
316
+ * added functions to call modules with config file path directly
317
+
314
318
  Version 0.77.5
315
319
  --------------
316
320
  * fixed augmentation bug for python version 10
@@ -1,8 +1,8 @@
1
1
  nkululeko/__init__.py,sha256=62f8HiEzJ8rG2QlTFJXUCMpvuH3fKI33DoJSj33mscc,63
2
- nkululeko/aug_train.py,sha256=zlaGdWFyaFCpHZ8h_mqPVFcdaOPyK0iXgEkr6eIBqMQ,2976
2
+ nkululeko/aug_train.py,sha256=Z8AYr1E-zjRVrB7uRF_eKTvc0vYXVYGuy3BtzjSIL64,3022
3
3
  nkululeko/augment.py,sha256=sHWG4Jmb4BjnaaXXnRYMP7Jkk0qlaZ2ohsArP8uW_d8,3003
4
4
  nkululeko/cacheddataset.py,sha256=lIJ6hUo5LoxSrzXtWV8mzwO7wRtUETWnOQ4ws2XfL1E,969
5
- nkululeko/constants.py,sha256=Lptv4d1FjzAxTL1xBRCb9wbAoMfBLUe-jlDoieF1Fqk,39
5
+ nkululeko/constants.py,sha256=p_G6aEcoN8S7E9aX4sOtHKmywY_uhLXbm6h0iJqfjuY,39
6
6
  nkululeko/demo.py,sha256=FFR8qHMCY8kKKRWDTa8xA7A8mWeYalRKYNtV5rjGg44,1915
7
7
  nkululeko/demo_predictor.py,sha256=j4ySWWcIxW7ZAIBH86m9BfRFokzrUNkRD6fpsvAQGTw,2629
8
8
  nkululeko/experiment.py,sha256=natQpQ_lETWoSea8rTM77g2G_xO_1KXNkES5eYU6GdM,28649
@@ -13,7 +13,7 @@ nkululeko/file_checker.py,sha256=LoLnL8aHpW-axMQ46qbqrManTs5otG9ShpEZuz9iRSk,347
13
13
  nkululeko/filter_data.py,sha256=w-X2mhKdYr5DxDIz50E5yzO6Jmzk4jjDBoXsgOOVtcA,7222
14
14
  nkululeko/glob_conf.py,sha256=6MZe83QCgHD_zB79Sl9m6UJQASwfqJlyb-1nqrQ_6Iw,381
15
15
  nkululeko/modelrunner.py,sha256=TQW08f72-GjBEIFTE3_8B8qMCWvTJUqJ1fveygmYnXI,9278
16
- nkululeko/nkululeko.py,sha256=MyjjbCg8qgLHHpvwJOEHBGNCDKf0GTv7gnXX27L56R4,1724
16
+ nkululeko/nkululeko.py,sha256=5EfguOjCMt3xDttBJOw-B9upwOHcrN4z3yGKZH5OtoU,1833
17
17
  nkululeko/plots.py,sha256=Ci8brbxGXsCp1lnJdGkPUXoyWA6qUqUUwuxKOYEaqR8,21278
18
18
  nkululeko/predict.py,sha256=dRXX-sQVESa7cNi_56S6UkUOa_pV1g_K4xYtYVM1SJs,1876
19
19
  nkululeko/reporter.py,sha256=wrtWbU_UKDwhKQNMi7Q_Ix5N_UTzTagRwZikgUGk1c8,11606
@@ -48,7 +48,7 @@ nkululeko/data/dataset_csv.py,sha256=9ysujWHQnOHLWtJxGtvdpHE3c_sM_l9svFYWYCpamVs
48
48
  nkululeko/feat_extract/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
49
49
  nkululeko/feat_extract/feats_agender.py,sha256=sDfsvSC2zt1JLn5rmB7bdck1JmXIIol3oIwN90TossM,2867
50
50
  nkululeko/feat_extract/feats_agender_agender.py,sha256=UYATYWE-zCt9F1qA4xQbYZ2qM7DT2nwGxk7vSiyhit4,2953
51
- nkululeko/feat_extract/feats_analyser.py,sha256=82CCFTViP3XCEUS5Mku_0P358jEsm2-AIt5lAvlQQmY,11335
51
+ nkululeko/feat_extract/feats_analyser.py,sha256=nD2-7K4c0hFJvVCfmpsoU-SnePyb4m_JIPsf0uTzE0M,11397
52
52
  nkululeko/feat_extract/feats_audmodel.py,sha256=sZD8NBC3qId4ygzBvW5RvKVgCC1zxvO_cyFazYOEwCk,2901
53
53
  nkululeko/feat_extract/feats_audmodel_dim.py,sha256=z48s-FXokREnir_dNMl8fNI5PLCXzOhvmjgfCjTDjh8,2817
54
54
  nkululeko/feat_extract/feats_clap.py,sha256=v82mbjdjGDSKUUBggttw7jW0oka22fWAmfUf-4VmaDU,3379
@@ -98,9 +98,9 @@ nkululeko/segmenting/seg_silero.py,sha256=lLytS38KzARS17omwv8VBw-zz60RVSXGSvZ5Ev
98
98
  nkululeko/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
99
99
  nkululeko/utils/files.py,sha256=UiGAtZRWYjHSvlmPaTMtzyNNGE6qaLaxQkybctS7iRM,4021
100
100
  nkululeko/utils/stats.py,sha256=29otJpUp1VqbtDKmlLkPPzBmVfTFiHZ70rUdR4860rM,2788
101
- nkululeko/utils/util.py,sha256=KwBS6-hcLN3I3oV1jMxC4hiSBvEXW4PVuu-uZhmbO9w,11548
102
- nkululeko-0.77.5.dist-info/LICENSE,sha256=0zGP5B_W35yAcGfHPS18Q2B8UhvLRY3dQq1MhpsJU_U,1076
103
- nkululeko-0.77.5.dist-info/METADATA,sha256=rHmJ4JrNbloUkYo5UIINVyYuvliyX4D9jcFAfoV9eVk,30566
104
- nkululeko-0.77.5.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
105
- nkululeko-0.77.5.dist-info/top_level.txt,sha256=DPFNNSHPjUeVKj44dVANAjuVGRCC3MusJ08lc2a8xFA,10
106
- nkululeko-0.77.5.dist-info/RECORD,,
101
+ nkululeko/utils/util.py,sha256=lpaM7_KnLjquFFtMPH6swdisF1kqSHBLpHh3CzgGtLw,11625
102
+ nkululeko-0.77.6.dist-info/LICENSE,sha256=0zGP5B_W35yAcGfHPS18Q2B8UhvLRY3dQq1MhpsJU_U,1076
103
+ nkululeko-0.77.6.dist-info/METADATA,sha256=jVeWsnVWyiRsVCYFxbyK_UYgqyLsDNNKTXg_XaQIK7A,30662
104
+ nkululeko-0.77.6.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
105
+ nkululeko-0.77.6.dist-info/top_level.txt,sha256=DPFNNSHPjUeVKj44dVANAjuVGRCC3MusJ08lc2a8xFA,10
106
+ nkululeko-0.77.6.dist-info/RECORD,,