nkululeko 0.65.4__py3-none-any.whl → 0.65.5__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 +1 -1
- nkululeko/plots.py +6 -0
- nkululeko/utils/stats.py +12 -1
- {nkululeko-0.65.4.dist-info → nkululeko-0.65.5.dist-info}/METADATA +5 -1
- {nkululeko-0.65.4.dist-info → nkululeko-0.65.5.dist-info}/RECORD +8 -8
- {nkululeko-0.65.4.dist-info → nkululeko-0.65.5.dist-info}/LICENSE +0 -0
- {nkululeko-0.65.4.dist-info → nkululeko-0.65.5.dist-info}/WHEEL +0 -0
- {nkululeko-0.65.4.dist-info → nkululeko-0.65.5.dist-info}/top_level.txt +0 -0
nkululeko/constants.py
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
VERSION="0.65.
|
1
|
+
VERSION="0.65.5"
|
2
2
|
SAMPLING_RATE=16000
|
nkululeko/plots.py
CHANGED
@@ -57,6 +57,8 @@ class Plots():
|
|
57
57
|
bin_reals = eval(self.util.config_val('EXPL', 'bin_reals', 'True'))
|
58
58
|
for att in attributes:
|
59
59
|
if len(att) == 1:
|
60
|
+
if att[0] not in df:
|
61
|
+
self.util.error(f'unknown feature: {att[0]}')
|
60
62
|
self.util.debug(f'plotting {att[0]}')
|
61
63
|
filename = f'{self.target}-{att[0]}'
|
62
64
|
if self.util.is_categorical(df[att[0]]):
|
@@ -90,6 +92,10 @@ class Plots():
|
|
90
92
|
plt.close(fig)
|
91
93
|
# fig.clear() # avoid error
|
92
94
|
elif len(att) == 2:
|
95
|
+
if att[0] not in df:
|
96
|
+
self.util.error(f'unknown feature: {att[0]}')
|
97
|
+
if att[1] not in df:
|
98
|
+
self.util.error(f'unknown feature: {att[1]}')
|
93
99
|
self.util.debug(f'plotting {att}')
|
94
100
|
att1 = att[0]
|
95
101
|
att2 = att[1]
|
nkululeko/utils/stats.py
CHANGED
@@ -3,6 +3,14 @@ import math
|
|
3
3
|
import numpy as np
|
4
4
|
import pandas as pd
|
5
5
|
|
6
|
+
def check_na(a):
|
7
|
+
if np.isnan(a).any():
|
8
|
+
count = np.count_nonzero(np.isnan(a))
|
9
|
+
print(f'WARNING: got {count} Nans (of {len(a)}), setting to 0')
|
10
|
+
a[np.isnan(a)] = 0
|
11
|
+
return a
|
12
|
+
else:
|
13
|
+
return a
|
6
14
|
|
7
15
|
def cohen_d(d1, d2):
|
8
16
|
"""
|
@@ -13,6 +21,9 @@ def cohen_d(d1, d2):
|
|
13
21
|
Returns:
|
14
22
|
Cohen's d with precision 3
|
15
23
|
"""
|
24
|
+
# Checks:
|
25
|
+
d1 = check_na(d1)
|
26
|
+
d2 = check_na(d2)
|
16
27
|
# calculate the size of samples
|
17
28
|
n1, n2 = len(d1), len(d2)
|
18
29
|
# calculate the variance of the samples
|
@@ -23,7 +34,7 @@ def cohen_d(d1, d2):
|
|
23
34
|
u1, u2 = np.mean(d1), np.mean(d2)
|
24
35
|
# calculate the effect size
|
25
36
|
if math.isnan(s) or s == 0:
|
26
|
-
return
|
37
|
+
return -1
|
27
38
|
return (int(1000 * np.abs((u1 - u2)) / s)) / 1000
|
28
39
|
|
29
40
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: nkululeko
|
3
|
-
Version: 0.65.
|
3
|
+
Version: 0.65.5
|
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
|
@@ -255,6 +255,10 @@ Nkululeko can be used under the [MIT license](https://choosealicense.com/license
|
|
255
255
|
Changelog
|
256
256
|
=========
|
257
257
|
|
258
|
+
Version 0.65.5
|
259
|
+
--------------
|
260
|
+
* added fill_na in plot effect size
|
261
|
+
|
258
262
|
Version 0.65.4
|
259
263
|
--------------
|
260
264
|
* added datasets to distribution
|
@@ -2,7 +2,7 @@ nkululeko/__init__.py,sha256=62f8HiEzJ8rG2QlTFJXUCMpvuH3fKI33DoJSj33mscc,63
|
|
2
2
|
nkululeko/augment.py,sha256=paq-vEf02XyaPsLjnCbDJbuZind6M6mm0NWAnK5_PKU,1751
|
3
3
|
nkululeko/balancer.py,sha256=64ftZN68sMDfkvuovCDHpAHmSJgCO6Kdk9bwmpSisec,12
|
4
4
|
nkululeko/cacheddataset.py,sha256=lIJ6hUo5LoxSrzXtWV8mzwO7wRtUETWnOQ4ws2XfL1E,969
|
5
|
-
nkululeko/constants.py,sha256=
|
5
|
+
nkululeko/constants.py,sha256=KGYcdgRK9DOOWiYr-901PUaOgmccfRuUhfuYAEyFvZM,36
|
6
6
|
nkululeko/demo.py,sha256=1JFayJBUqOwj8fDtNF6siuB_5aG6dkb_TeIFPhYv1YI,1858
|
7
7
|
nkululeko/demo_predictor.py,sha256=f3tghu3KxrLFPSrMMqT3E_Owy8alAuHEbkoZuahikEE,2310
|
8
8
|
nkululeko/experiment.py,sha256=fV-TdDPlFhS8DdALuzme0n9-3HnGwi_GxiTak3u_ZAY,24779
|
@@ -14,7 +14,7 @@ nkululeko/filter_data.py,sha256=LD46OLYfA6UuLvFgaA1LvCVSqmi6JXN2xd_fTZdr-ag,7029
|
|
14
14
|
nkululeko/glob_conf.py,sha256=KOsmB2_9AVoKNyhtCkaamj-ZYCme6-NjTYF-4wlLgOY,241
|
15
15
|
nkululeko/modelrunner.py,sha256=NYdV4z9TKhtC9LGhOxXa7aBC2AxRjnFJ42Ah01rsbqg,6025
|
16
16
|
nkululeko/nkululeko.py,sha256=SVOY3CPvlmG-16kqV8YOvR2HYCgHkaiVo3GBiwu38W0,1681
|
17
|
-
nkululeko/plots.py,sha256=
|
17
|
+
nkululeko/plots.py,sha256=wwUvHIlpP6wYlukYNWtgqhxh6avqo_okslNgoT4S6u0,13023
|
18
18
|
nkululeko/predict.py,sha256=3ei4wn2by0p9Vkv7cllMcszmEjSM2vX0T6x_5rlgT28,1851
|
19
19
|
nkululeko/reporter.py,sha256=359aeQWt0ZGLseaJnOfafYG8BrwumiM2Q58DWiaoyWQ,10177
|
20
20
|
nkululeko/resample.py,sha256=NDZLIhmGPcxSZwzIZul9oeNfbaHfAmzjTvRWs6isIr4,2120
|
@@ -90,9 +90,9 @@ nkululeko/segmenting/seg_inaspeechsegmenter.py,sha256=pmLHuXsaqvcdYxB4PSW9l1mbQW
|
|
90
90
|
nkululeko/segmenting/seg_silero.py,sha256=bbLQxUste1lKEwNRHG4wOTCaFMevNt8TOe2DfmLtu5w,3306
|
91
91
|
nkululeko/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
92
92
|
nkululeko/utils/files.py,sha256=82EsGvTN85lDdSzetm1ZHTVOUm0AcfQhTeurwsfHN_Q,3547
|
93
|
-
nkululeko/utils/stats.py,sha256=
|
94
|
-
nkululeko-0.65.
|
95
|
-
nkululeko-0.65.
|
96
|
-
nkululeko-0.65.
|
97
|
-
nkululeko-0.65.
|
98
|
-
nkululeko-0.65.
|
93
|
+
nkululeko/utils/stats.py,sha256=nRuZEbHpeRTAcvW8b12ZWi_kDnpC5Ztrmvy0_J621cE,2241
|
94
|
+
nkululeko-0.65.5.dist-info/LICENSE,sha256=0zGP5B_W35yAcGfHPS18Q2B8UhvLRY3dQq1MhpsJU_U,1076
|
95
|
+
nkululeko-0.65.5.dist-info/METADATA,sha256=y2ttA1LEwXgflc2MLb1krzgq3zazj780wZ3fIWR8fAg,23458
|
96
|
+
nkululeko-0.65.5.dist-info/WHEEL,sha256=yQN5g4mg4AybRjkgi-9yy4iQEFibGQmlz78Pik5Or-A,92
|
97
|
+
nkululeko-0.65.5.dist-info/top_level.txt,sha256=DPFNNSHPjUeVKj44dVANAjuVGRCC3MusJ08lc2a8xFA,10
|
98
|
+
nkululeko-0.65.5.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|