nkululeko 0.88.0__py3-none-any.whl → 0.88.1__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.88.0"
1
+ VERSION="0.88.1"
2
2
  SAMPLING_RATE = 16000
@@ -186,6 +186,9 @@ class Reporter:
186
186
  epoch (int, optional): Number of epoch. Defaults to None.
187
187
  """
188
188
  if not self.util.exp_is_classification():
189
+ self._plot_scatter(
190
+ self.truths, self.preds, plot_name.replace("cnf", "scatter"), epoch
191
+ )
189
192
  self.continuous_to_categorical()
190
193
  self._plot_confmat(self.truths, self.preds, plot_name, epoch)
191
194
 
@@ -218,6 +221,43 @@ class Reporter:
218
221
  pred = np.digitize(pred, bins) - 1
219
222
  self._plot_confmat(truth, pred.astype("int"), plot_name, 0)
220
223
 
224
+ def _plot_scatter(self, truths, preds, plot_name, epoch=None):
225
+ # print(truths)
226
+ # print(preds)
227
+ if epoch is None:
228
+ epoch = self.epoch
229
+ fig_dir = self.util.get_path("fig_dir")
230
+ fig = plt.figure() # figsize=[5, 5]
231
+
232
+ pcc = pearsonr(self.truths, self.preds)[0]
233
+
234
+ reg_res = f"{self.result.test:.3f} {self.MEASURE}"
235
+
236
+ plt.scatter(truths, preds, cmap="Blues")
237
+ plt.xlabel("truth")
238
+ plt.ylabel("prediction")
239
+
240
+ if epoch != 0:
241
+ plt.title(f"Scatter plot: {reg_res}, PCC: {pcc:.3f}, Epoch: {epoch}")
242
+ else:
243
+ plt.title(f"Scatter plot: {reg_res}, PCC: {pcc:.3f}")
244
+
245
+ img_path = f"{fig_dir}{plot_name}{self.filenameadd}.{self.format}"
246
+ plt.savefig(img_path)
247
+ self.util.debug(f"Saved scatter plot to {img_path}")
248
+ fig.clear()
249
+ plt.close(fig)
250
+ plt.close()
251
+ plt.clf()
252
+ glob_conf.report.add_item(
253
+ ReportItem(
254
+ Header.HEADER_RESULTS,
255
+ self.util.get_model_description(),
256
+ "Result scatter plot",
257
+ img_path,
258
+ )
259
+ )
260
+
221
261
  def _plot_confmat(self, truths, preds, plot_name, epoch=None):
222
262
  # print(truths)
223
263
  # print(preds)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: nkululeko
3
- Version: 0.88.0
3
+ Version: 0.88.1
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
@@ -201,7 +201,7 @@ Here is an overview of the interfaces/modules:
201
201
  All of them take *--config <my_config.ini>* as an argument.
202
202
 
203
203
  * **nkululeko.nkululeko**: do machine learning experiments combining features and learners
204
- * **nkululeko.ensemble**: combine several nkululeko experiments and report on late fusion results
204
+ * **nkululeko.ensemble**: [combine several nkululeko experiments](http://blog.syntheticspeech.de/2024/06/25/nkululeko-ensemble-classifiers-with-late-fusion/) and report on late fusion results
205
205
  * *configurations*: which experiments to combine
206
206
  * *--method* (optional): majority_voting, mean, max, sum
207
207
  * *--outfile* (optional): name of CSV file for output
@@ -356,6 +356,10 @@ F. Burkhardt, Johannes Wagner, Hagen Wierstorf, Florian Eyben and Björn Schulle
356
356
  Changelog
357
357
  =========
358
358
 
359
+ Version 0.88.1
360
+ --------------
361
+ * added obligatory scatter plot for regression
362
+
359
363
  Version 0.88.0
360
364
  --------------
361
365
  * added ensemble late fusion and AST features
@@ -2,7 +2,7 @@ nkululeko/__init__.py,sha256=62f8HiEzJ8rG2QlTFJXUCMpvuH3fKI33DoJSj33mscc,63
2
2
  nkululeko/aug_train.py,sha256=YhuZnS_WVWnun9G-M6g5n6rbRxoVREz6Zh7k6qprFNQ,3194
3
3
  nkululeko/augment.py,sha256=4MG0apTAG5RgkuJrYEjGgDdbodZWi_HweSPNI1JJ5QA,3051
4
4
  nkululeko/cacheddataset.py,sha256=lIJ6hUo5LoxSrzXtWV8mzwO7wRtUETWnOQ4ws2XfL1E,969
5
- nkululeko/constants.py,sha256=KhD5BoAv4ItEdg4vSAq1wew4zjdCOGPQxR6syd9NoEo,39
5
+ nkululeko/constants.py,sha256=wDgoTGTbu7Xgf_ms4HNIIYRiH8Z5f0DMdvLeI-SupRo,39
6
6
  nkululeko/demo.py,sha256=bLuHkeEl5rOfm7ecGHCcWATiPK7-njNbtrGljxzNzFs,5088
7
7
  nkululeko/demo_feats.py,sha256=sAeGFojhEj9WEDFtG3SzPBmyYJWLF2rkbpp65m8Ujo4,2025
8
8
  nkululeko/demo_predictor.py,sha256=es56xbT8ifkS_vnrlb5NTZT54gNmeUtNlA4zVA_gnN8,4757
@@ -98,7 +98,7 @@ nkululeko/reporting/defines.py,sha256=IsY1YgKRMaABpylVKjBJgJ5bNCEbGCVA_E6pivraqS
98
98
  nkululeko/reporting/latex_writer.py,sha256=qiCRSmB4KOD_za4oHu5x-PhwjZohzfo8wecMOwlXZwc,1886
99
99
  nkululeko/reporting/report.py,sha256=W0rcigDdjBvxZQ3pZja_gvToILYvaZ1BFtnN2qFRfYI,1060
100
100
  nkululeko/reporting/report_item.py,sha256=siWeGNgo4bAE46YBMNcsdf3jTMTy76BO9Fi6DTvDig4,533
101
- nkululeko/reporting/reporter.py,sha256=6zW3PmQrwVJO5orBVA-fiaIhnzGrFymC861DSd8nSjc,16806
101
+ nkululeko/reporting/reporter.py,sha256=2SX8qPaWpqslzfcXDQFINxTkVDWbrySiQZR4iZ77xG0,18096
102
102
  nkululeko/reporting/result.py,sha256=nSN5or-Py2GPRWHkWpGRh7UCi1W0er7WLEHz8fYLk-A,742
103
103
  nkululeko/segmenting/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
104
104
  nkululeko/segmenting/seg_inaspeechsegmenter.py,sha256=pmLHuXsaqvcdYxB4PSW9l1mbQWZZBJFhi_CGabqydas,1947
@@ -107,8 +107,8 @@ nkululeko/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
107
107
  nkululeko/utils/files.py,sha256=UiGAtZRWYjHSvlmPaTMtzyNNGE6qaLaxQkybctS7iRM,4021
108
108
  nkululeko/utils/stats.py,sha256=eC9dMO-by6CDnGLHDBQu-2B4-BudZNJ0nnWGhKYdUMA,2968
109
109
  nkululeko/utils/util.py,sha256=eQkfd_3MO2JYis5QbROnCmhglQGkl4-F9TLCT1uiQH0,14514
110
- nkululeko-0.88.0.dist-info/LICENSE,sha256=0zGP5B_W35yAcGfHPS18Q2B8UhvLRY3dQq1MhpsJU_U,1076
111
- nkululeko-0.88.0.dist-info/METADATA,sha256=RTWqGxR2H8T7hM_h8PFAqnssBdfPxEjmB289vVMoEyo,38853
112
- nkululeko-0.88.0.dist-info/WHEEL,sha256=mguMlWGMX-VHnMpKOjjQidIo1ssRlCFu4a4mBpz1s2M,91
113
- nkululeko-0.88.0.dist-info/top_level.txt,sha256=DPFNNSHPjUeVKj44dVANAjuVGRCC3MusJ08lc2a8xFA,10
114
- nkululeko-0.88.0.dist-info/RECORD,,
110
+ nkululeko-0.88.1.dist-info/LICENSE,sha256=0zGP5B_W35yAcGfHPS18Q2B8UhvLRY3dQq1MhpsJU_U,1076
111
+ nkululeko-0.88.1.dist-info/METADATA,sha256=S_oewgAcmyRs8p-61M0PcVYfvtRl4hRwwlFDWVH9yDY,39025
112
+ nkululeko-0.88.1.dist-info/WHEEL,sha256=mguMlWGMX-VHnMpKOjjQidIo1ssRlCFu4a4mBpz1s2M,91
113
+ nkululeko-0.88.1.dist-info/top_level.txt,sha256=DPFNNSHPjUeVKj44dVANAjuVGRCC3MusJ08lc2a8xFA,10
114
+ nkululeko-0.88.1.dist-info/RECORD,,