nkululeko 0.95.5__py3-none-any.whl → 0.95.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/constants.py CHANGED
@@ -1,2 +1,2 @@
1
- VERSION="0.95.5"
1
+ VERSION="0.95.6"
2
2
  SAMPLING_RATE = 16000
@@ -12,13 +12,9 @@ from scipy.special import softmax
12
12
  from scipy.stats import entropy
13
13
  from scipy.stats import pearsonr
14
14
  from sklearn.metrics import ConfusionMatrixDisplay
15
- from sklearn.metrics import RocCurveDisplay
16
- from sklearn.metrics import auc
17
15
  from sklearn.metrics import classification_report
18
16
  from sklearn.metrics import confusion_matrix
19
17
  from sklearn.metrics import r2_score
20
- from sklearn.metrics import roc_auc_score
21
- from sklearn.metrics import roc_curve
22
18
 
23
19
  # from torch import is_tensor
24
20
  from audmetric import accuracy
@@ -186,6 +182,7 @@ class Reporter:
186
182
  if not file_name.endswith(".csv"):
187
183
  file_name = file_name + ".csv"
188
184
  self.probas = probas
185
+ self.plot_proba_conf()
189
186
  probas.to_csv(file_name)
190
187
  self.util.debug(f"Saved probabilities to {file_name}")
191
188
  plots = Plots()
@@ -196,10 +193,27 @@ class Reporter:
196
193
  ax,
197
194
  caption,
198
195
  "Uncertainty",
199
- "uncertainty_samples",
196
+ "uncertainty",
200
197
  "samples",
201
198
  )
202
199
 
200
+ def plot_proba_conf(self):
201
+ uncertainty_threshold = self.util.config_val("PLOT", "uncertainty_threshold", False)
202
+ if uncertainty_threshold:
203
+ uncertainty_threshold = float(uncertainty_threshold)
204
+ old_size = self.probas.shape[0]
205
+ df = self.probas[self.probas["uncertainty"] < uncertainty_threshold]
206
+ new_size = df.shape[0]
207
+ difference = old_size - new_size
208
+ self.util.debug(
209
+ f"Filtered probabilities: {old_size} -> {new_size} ({difference}) samples with uncertainty < {uncertainty_threshold}"
210
+ )
211
+ truths = df["truth"].values
212
+ preds = df["predicted"].values
213
+ self._plot_confmat(truths, preds, f"uncertainty_less_than_{uncertainty_threshold}_cnf",
214
+ epoch=None, test_result=None)
215
+
216
+
203
217
  def set_id(self, run, epoch):
204
218
  """Make the report identifiable with run and epoch index."""
205
219
  self.run = run
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: nkululeko
3
- Version: 0.95.5
3
+ Version: 0.95.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
@@ -4,7 +4,7 @@ nkululeko/aug_train.py,sha256=wpiHCJ7zsW38kumg3ypwXZe2HQrhUblAnv7P2QeJnAc,3525
4
4
  nkululeko/augment.py,sha256=3RzaxB3gRxovgJVjHXi0glprW01J7RaHhUkqotW2T3U,2955
5
5
  nkululeko/balance.py,sha256=r7opXbrqAipm2euPPaOmLlA5J10p2bHQgO5kWk2x9ro,8702
6
6
  nkululeko/cacheddataset.py,sha256=XFpWZmbJRg0pvhnIgYf0TkclxllD-Fctu-Ol0PF_00c,969
7
- nkululeko/constants.py,sha256=uY1Jr5zRXhQbcZ07E355HAsT4h-soeECnBVXSukC-wY,39
7
+ nkululeko/constants.py,sha256=jC8e4ENKUF9damz-8BUpeu-yQdmouspc5ZJsg5VwyJs,39
8
8
  nkululeko/demo-ft.py,sha256=iD9Pzp9QjyAv31q1cDZ75vPez7Ve8A4Cfukv5yfZdrQ,770
9
9
  nkululeko/demo.py,sha256=tu7Al2l5MCLVegkDC-NE2wcuc_YE7NRbgOlPW3yhGEs,4940
10
10
  nkululeko/demo_feats.py,sha256=BvZjeNFTlERIRlq34OHM4Z96jdDQAhB01BGQAUcX9dM,2026
@@ -120,7 +120,7 @@ nkululeko/reporting/defines.py,sha256=0vh-Tlx4fAPpk1o6mP_4x3EkIoqzYMr38IZnj-JM5z
120
120
  nkululeko/reporting/latex_writer.py,sha256=NGwSIfd4nfslDkNUOSZSdqY_VDLA8634thyhe-vj1bY,1824
121
121
  nkululeko/reporting/report.py,sha256=B5eoIKMz46VKDBsi7M9u_iegzAD-E3eGCmolzSFjZ3c,1118
122
122
  nkululeko/reporting/report_item.py,sha256=drkknsyFhGviaPJNmPQtCXJmRhTSSfjNcJt0Bls6JAA,533
123
- nkululeko/reporting/reporter.py,sha256=awBaewERa8xSQtZ0c1KVAQhV77L-BvXSDyU959hQ6qU,21150
123
+ nkululeko/reporting/reporter.py,sha256=ITxM5O9Hoe_1z_59g-GF4b9vciR4shokZxeFzCrDaag,21869
124
124
  nkululeko/reporting/result.py,sha256=G63a2tHCwHhM6NBJgYzsWKWJm4Yu3r4hsCHA2Km7eHU,1073
125
125
  nkululeko/segmenting/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
126
126
  nkululeko/segmenting/seg_inaspeechsegmenter.py,sha256=b3t0zdpJYofKWMyKRMtMMX91xeR-k8d5pbnNaQHcsOE,1902
@@ -134,9 +134,9 @@ nkululeko/utils/files.py,sha256=SrrYaU7AB80MZHiV1jcB0h_zigvYLYgSVNTXV4ao38g,4593
134
134
  nkululeko/utils/stats.py,sha256=3Fyx8q8BSKYmiufT6OkRug9RATWmGrr9BaX_y8jziWo,3074
135
135
  nkululeko/utils/unzip.py,sha256=G68f5120TjwACZC3bQcneMniddnwubPbBdMc2L5KBOo,1206
136
136
  nkululeko/utils/util.py,sha256=yHgzfj-8ncgCvyrrrH_NDWCh6VmhAqVYY6Vlgyg-c6E,18585
137
- nkululeko-0.95.5.dist-info/licenses/LICENSE,sha256=0zGP5B_W35yAcGfHPS18Q2B8UhvLRY3dQq1MhpsJU_U,1076
138
- nkululeko-0.95.5.dist-info/METADATA,sha256=jt5I1QkdFV2jSe6vVu4SgJ5Ptlc9GMvKSpxRCpc9Awk,21998
139
- nkululeko-0.95.5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
140
- nkululeko-0.95.5.dist-info/entry_points.txt,sha256=lNTkFEdh6Kjo5o95ZAWf_0Lq-4ztGoAoMVSDuPtuyS0,442
141
- nkululeko-0.95.5.dist-info/top_level.txt,sha256=bf1k1YKkqcXemNX_cUgoyKqQ3_GVErPqAY-53J36jkM,19
142
- nkululeko-0.95.5.dist-info/RECORD,,
137
+ nkululeko-0.95.6.dist-info/licenses/LICENSE,sha256=0zGP5B_W35yAcGfHPS18Q2B8UhvLRY3dQq1MhpsJU_U,1076
138
+ nkululeko-0.95.6.dist-info/METADATA,sha256=fNK6XplFh2R-uBVMhUR9R4XhIp3Ebx8SX0BUZ8Cldvk,21998
139
+ nkululeko-0.95.6.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
140
+ nkululeko-0.95.6.dist-info/entry_points.txt,sha256=lNTkFEdh6Kjo5o95ZAWf_0Lq-4ztGoAoMVSDuPtuyS0,442
141
+ nkululeko-0.95.6.dist-info/top_level.txt,sha256=bf1k1YKkqcXemNX_cUgoyKqQ3_GVErPqAY-53J36jkM,19
142
+ nkululeko-0.95.6.dist-info/RECORD,,