nkululeko 0.93.1__py3-none-any.whl → 0.93.2__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/constants.py CHANGED
@@ -1,2 +1,2 @@
1
- VERSION="0.93.1"
1
+ VERSION="0.93.2"
2
2
  SAMPLING_RATE = 16000
nkululeko/experiment.py CHANGED
@@ -434,7 +434,9 @@ class Experiment:
434
434
  f"unknown augmentation selection specifier {sample_selection},"
435
435
  " should be [all | train | test]"
436
436
  )
437
- targets = self.util.config_val_list("PREDICT", "targets", ["gender"])
437
+ targets = self.util.config_val_list("PREDICT", "targets", None)
438
+ if targets is None:
439
+ self.util.error("no prediction target specified")
438
440
  for target in targets:
439
441
  if target == "speaker":
440
442
  from nkululeko.autopredict.ap_sid import SIDPredictor
nkululeko/plots.py CHANGED
@@ -8,6 +8,8 @@ from scipy import stats
8
8
  import seaborn as sns
9
9
  from sklearn.manifold import TSNE
10
10
 
11
+ from audmetric import concordance_cc as ccc
12
+
11
13
  import nkululeko.glob_conf as glob_conf
12
14
  from nkululeko.reporting.defines import Header
13
15
  from nkululeko.reporting.report_item import ReportItem
@@ -239,28 +241,54 @@ class Plots:
239
241
 
240
242
  def _plot2cont_cat(self, df, cont1, cont2, cat, ylab):
241
243
  """Plot relation of two continuous distributions with one categorical."""
244
+ if cont2 == "class_label":
245
+ df.rename(columns={cont2: self.target})
246
+ cont2 = self.target
247
+ if cont1 == "class_label":
248
+ df.rename(columns={cont1: self.target})
249
+ cont1 = self.target
250
+ if cat == "class_label":
251
+ df.rename(columns={cat: self.target})
252
+ cat = self.target
242
253
  pearson = stats.pearsonr(df[cont1], df[cont2])
243
254
  # trunc to three digits
244
255
  pearson = int(pearson[0] * 1000) / 1000
245
256
  pearson_string = f"PCC: {pearson}"
257
+ ccc_val = ccc(df[cont1], df[cont2])
258
+ ccc_val = int(ccc_val * 1000) / 1000
259
+ ccc_string = f"CCC: {ccc_val}"
246
260
  ax = sns.lmplot(data=df, x=cont1, y=cont2, hue=cat)
247
- caption = f"{ylab} {df.shape[0]}. {pearson_string}"
261
+ caption = f"{ylab} {df.shape[0]}. {pearson_string} {ccc_string}"
248
262
  ax.figure.suptitle(caption)
249
263
  return ax, caption
250
264
 
251
265
  def _plot2cont(self, df, col1, col2, ylab):
252
266
  """Plot relation of two continuous distributions."""
267
+ # rename "class_label" to the original target
268
+ if col2 == "class_label":
269
+ df.rename(columns={col2: self.target})
270
+ col2 = self.target
271
+ if col1 == "class_label":
272
+ df.rename(columns={col1: self.target})
273
+ col1 = self.target
253
274
  pearson = stats.pearsonr(df[col1], df[col2])
254
275
  # trunc to three digits
255
276
  pearson = int(pearson[0] * 1000) / 1000
256
277
  pearson_string = f"PCC: {pearson}"
278
+ ccc_val = ccc(df[cont1], df[cont2])
279
+ ccc_val = int(ccc_val * 1000) / 1000
280
+ ccc_string = f"CCC: {ccc_val}"
257
281
  ax = sns.lmplot(data=df, x=col1, y=col2)
258
- caption = f"{ylab} {df.shape[0]}. {pearson_string}"
282
+ caption = f"{ylab} {df.shape[0]}. {pearson_string} {ccc_string}"
259
283
  ax.figure.suptitle(caption)
260
284
  return ax, caption
261
285
 
262
286
  def plotcatcont(self, df, cat_col, cont_col, xlab, ylab):
263
287
  """Plot relation of categorical distribution with continuous."""
288
+ # rename "class_label" to the original target
289
+ if cat_col == "class_label":
290
+ df.rename(columns={cat_col: self.target})
291
+ cat_col = self.target
264
292
  dist_type = self.util.config_val("EXPL", "dist_type", "kde")
265
293
  cats, cat_str, es = su.get_effect_size(df, cat_col, cont_col)
266
294
  model_type = self.util.get_model_type()
nkululeko/utils/util.py CHANGED
@@ -226,7 +226,10 @@ class Util:
226
226
  return self.config["DATA"]["target"]
227
227
 
228
228
  def get_model_type(self):
229
- return self.config["MODEL"]["type"]
229
+ try:
230
+ return self.config["MODEL"]["type"]
231
+ except KeyError:
232
+ return ""
230
233
 
231
234
  def get_model_description(self):
232
235
  mt = ""
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: nkululeko
3
- Version: 0.93.1
3
+ Version: 0.93.2
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
@@ -355,6 +355,10 @@ If you use it, please mention the Nkululeko paper:
355
355
  Changelog
356
356
  =========
357
357
 
358
+ Version 0.93.2
359
+ --------------
360
+ * changed class_label in plots to actual target
361
+
358
362
  Version 0.93.1
359
363
  --------------
360
364
  * made explore module more robust
@@ -2,13 +2,13 @@ nkululeko/__init__.py,sha256=62f8HiEzJ8rG2QlTFJXUCMpvuH3fKI33DoJSj33mscc,63
2
2
  nkululeko/aug_train.py,sha256=FoMbBrfyOZd4QAw7oIHl3X6-UpsqAKWVDIolCA7qOWs,3196
3
3
  nkululeko/augment.py,sha256=3RzaxB3gRxovgJVjHXi0glprW01J7RaHhUkqotW2T3U,2955
4
4
  nkululeko/cacheddataset.py,sha256=XFpWZmbJRg0pvhnIgYf0TkclxllD-Fctu-Ol0PF_00c,969
5
- nkululeko/constants.py,sha256=-K1r-fO1ilOQ-FT2-YDWo37lCfB7mjYPEylDVqqcP_s,39
5
+ nkululeko/constants.py,sha256=BbVRqe9PVLlKhJNVX9kRT-tO_jL8AU7O9uhFeSzq9sw,39
6
6
  nkululeko/demo-ft.py,sha256=iD9Pzp9QjyAv31q1cDZ75vPez7Ve8A4Cfukv5yfZdrQ,770
7
7
  nkululeko/demo.py,sha256=4Yzhg6pCPBYPGJrP7JX2TysVosl_R1llpVDKc2P_gUA,4955
8
8
  nkululeko/demo_feats.py,sha256=BvZjeNFTlERIRlq34OHM4Z96jdDQAhB01BGQAUcX9dM,2026
9
9
  nkululeko/demo_predictor.py,sha256=lDF-xOxRdEAclOmbepAYg-BQXQdGkHfq2n74PTIoop8,4872
10
10
  nkululeko/ensemble.py,sha256=71V-rre61H3J4sh7lu-OTo4I2_g7mm_rQxwW1ARDHgY,12782
11
- nkululeko/experiment.py,sha256=G5yNFO3z8yGAXJYzZbA-ANAPU9tTtijVyOGG7NGsn2M,31701
11
+ nkululeko/experiment.py,sha256=0xe_mrGtO6q8HF6dZ7slXca7BvSoyIh6j61U9mtcS_o,31785
12
12
  nkululeko/explore.py,sha256=FPM2CS-LKgcDV-LnjYlD6pEv7HuCQpH_C3KyyiOCdk4,3589
13
13
  nkululeko/export.py,sha256=U-V4acxtuL6qKt6oAsVcM5TTeWogYUJ3GU-lA6rq6d4,4336
14
14
  nkululeko/feature_extractor.py,sha256=UnspIWz3XrNhKnBBhWZkH2bHvD-sROtrQVqB1JvkUyw,4088
@@ -20,7 +20,7 @@ nkululeko/modelrunner.py,sha256=lJy-xM4QfDDWeL0dLTE_VIb4sYrnd_Z_yJRK3wwohQA,1119
20
20
  nkululeko/multidb.py,sha256=sO6OwJn8sn1-C-ig3thsIL8QMWHdV9SnJhDodKjeKrI,6876
21
21
  nkululeko/nkuluflag.py,sha256=PGWSmZz-PiiHLgcZJAoGOI_Y-sZDVI1ksB8p5r7riWM,3725
22
22
  nkululeko/nkululeko.py,sha256=M7baIq2nAoi6dEoBL4ATEuqAs5U1fvl_hyqAl5DybAQ,2040
23
- nkululeko/plots.py,sha256=dK3jVwsZufqXgHwAvDYt6uDg_KYk5cfxlP1Fo8kb9HA,23935
23
+ nkululeko/plots.py,sha256=5V64_dPusl6t4p2yO6mAa253ydB1T8qtDx2eERKfGqI,25078
24
24
  nkululeko/predict.py,sha256=MLnHEyFmSiHLLs-HDczag8Vu3zKF5T1rXLKdZZJ6py8,2083
25
25
  nkululeko/resample.py,sha256=akSAjJ3qn-O5NAyLJHVHdsK7MUZPGaZUvM2TwMSmj2M,5194
26
26
  nkululeko/runmanager.py,sha256=AswmORVUkCIH0gTx6zEyufvFATQBS8C5TXo2erSNdVg,7611
@@ -111,10 +111,10 @@ nkululeko/segmenting/seg_silero.py,sha256=ulodnvtRq5MLHDxy_RmAK4tJg6h1d-mPq-uCPF
111
111
  nkululeko/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
112
112
  nkululeko/utils/files.py,sha256=SrrYaU7AB80MZHiV1jcB0h_zigvYLYgSVNTXV4ao38g,4593
113
113
  nkululeko/utils/stats.py,sha256=vCRzhCR0Gx5SiJyAGbj1TIto8ocGz58CM5Pr3LltagA,2948
114
- nkululeko/utils/util.py,sha256=yxETonpbcGTeJhvdDr7sC4CO0Qtf-pgHEclZ76eOtPA,16816
115
- nkululeko-0.93.1.dist-info/LICENSE,sha256=0zGP5B_W35yAcGfHPS18Q2B8UhvLRY3dQq1MhpsJU_U,1076
116
- nkululeko-0.93.1.dist-info/METADATA,sha256=eLAEogu2sQxBrmzlxfHKs8AP2d9uELQLGhmIJ5sBWgk,42018
117
- nkululeko-0.93.1.dist-info/WHEEL,sha256=a7TGlA-5DaHMRrarXjVbQagU3Man_dCnGIWMJr5kRWo,91
118
- nkululeko-0.93.1.dist-info/entry_points.txt,sha256=lNTkFEdh6Kjo5o95ZAWf_0Lq-4ztGoAoMVSDuPtuyS0,442
119
- nkululeko-0.93.1.dist-info/top_level.txt,sha256=DPFNNSHPjUeVKj44dVANAjuVGRCC3MusJ08lc2a8xFA,10
120
- nkululeko-0.93.1.dist-info/RECORD,,
114
+ nkululeko/utils/util.py,sha256=wFDslqxpCVDwi6LBakIFDDy1kYsxt5G7ykE38CocmtA,16880
115
+ nkululeko-0.93.2.dist-info/LICENSE,sha256=0zGP5B_W35yAcGfHPS18Q2B8UhvLRY3dQq1MhpsJU_U,1076
116
+ nkululeko-0.93.2.dist-info/METADATA,sha256=Dyhm_lOM-nr_GSqThzGnOLscolalOux9O4j6Dwoqa_c,42097
117
+ nkululeko-0.93.2.dist-info/WHEEL,sha256=R06PA3UVYHThwHvxuRWMqaGcr-PuniXahwjmQRFMEkY,91
118
+ nkululeko-0.93.2.dist-info/entry_points.txt,sha256=lNTkFEdh6Kjo5o95ZAWf_0Lq-4ztGoAoMVSDuPtuyS0,442
119
+ nkululeko-0.93.2.dist-info/top_level.txt,sha256=DPFNNSHPjUeVKj44dVANAjuVGRCC3MusJ08lc2a8xFA,10
120
+ nkululeko-0.93.2.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (75.4.0)
2
+ Generator: setuptools (75.5.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5