nkululeko 0.89.0__py3-none-any.whl → 0.89.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 +1 -1
- nkululeko/ensemble.py +9 -1
- nkululeko/feat_extract/feats_analyser.py +7 -4
- {nkululeko-0.89.0.dist-info → nkululeko-0.89.1.dist-info}/METADATA +5 -1
- {nkululeko-0.89.0.dist-info → nkululeko-0.89.1.dist-info}/RECORD +8 -8
- {nkululeko-0.89.0.dist-info → nkululeko-0.89.1.dist-info}/LICENSE +0 -0
- {nkululeko-0.89.0.dist-info → nkululeko-0.89.1.dist-info}/WHEEL +0 -0
- {nkululeko-0.89.0.dist-info → nkululeko-0.89.1.dist-info}/top_level.txt +0 -0
nkululeko/constants.py
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
VERSION="0.89.
|
1
|
+
VERSION="0.89.1"
|
2
2
|
SAMPLING_RATE = 16000
|
nkululeko/ensemble.py
CHANGED
@@ -26,7 +26,11 @@ from pathlib import Path
|
|
26
26
|
|
27
27
|
import numpy as np
|
28
28
|
import pandas as pd
|
29
|
-
from sklearn.metrics import
|
29
|
+
from sklearn.metrics import(
|
30
|
+
balanced_accuracy_score,
|
31
|
+
classification_report,
|
32
|
+
f1_score
|
33
|
+
)
|
30
34
|
|
31
35
|
from nkululeko.constants import VERSION
|
32
36
|
from nkululeko.experiment import Experiment
|
@@ -284,6 +288,10 @@ def ensemble_predictions(
|
|
284
288
|
predicted = ensemble_preds["predicted"]
|
285
289
|
uar = balanced_accuracy_score(truth, predicted)
|
286
290
|
acc = (truth == predicted).mean()
|
291
|
+
# print classification report
|
292
|
+
Util("ensemble").debug(f"\n {classification_report(truth, predicted)}")
|
293
|
+
# f1 = f1_score(truth, predicted, pos_label='p')
|
294
|
+
# Util("ensemble").debug(f"F1: {f1:.3f}")
|
287
295
|
Util("ensemble").debug(f"{method}: UAR: {uar:.3f}, ACC: {acc:.3f}")
|
288
296
|
|
289
297
|
return ensemble_preds
|
@@ -139,7 +139,7 @@ class FeatureAnalyser:
|
|
139
139
|
elif model_s == "svm":
|
140
140
|
from sklearn.svm import SVC
|
141
141
|
|
142
|
-
c = float(self.util.config_val("MODEL", "C_val", "0
|
142
|
+
c = float(self.util.config_val("MODEL", "C_val", "1.0"))
|
143
143
|
model = SVC(kernel="linear", C=c, gamma="scale")
|
144
144
|
result_importances[model_s] = self._get_importance(
|
145
145
|
model, permutation
|
@@ -205,7 +205,7 @@ class FeatureAnalyser:
|
|
205
205
|
model, permutation
|
206
206
|
)
|
207
207
|
elif model_s == "xgr":
|
208
|
-
from xgboost import
|
208
|
+
from xgboost import XGBRegressor
|
209
209
|
|
210
210
|
model = XGBRegressor()
|
211
211
|
result_importances[model_s] = self._get_importance(
|
@@ -270,12 +270,14 @@ class FeatureAnalyser:
|
|
270
270
|
)
|
271
271
|
)
|
272
272
|
|
273
|
+
# print feature importance values to file and debug and save to result
|
274
|
+
self.util.debug(f"Importance features from {model_name}: features = \n{df_imp['feats'].values.tolist()}")
|
273
275
|
# result file
|
274
276
|
res_dir = self.util.get_path("res_dir")
|
275
277
|
filename = f"_EXPL_{model_name}"
|
276
278
|
if permutation:
|
277
279
|
filename += "_perm"
|
278
|
-
filename = f"{res_dir}{self.util.get_exp_name(only_data=True)}{filename}_{
|
280
|
+
filename = f"{res_dir}{self.util.get_exp_name(only_data=True)}{filename}_{max_feat_num}_fi.txt"
|
279
281
|
with open(filename, "w") as text_file:
|
280
282
|
text_file.write(
|
281
283
|
"features in order of decreasing importance according to model"
|
@@ -283,7 +285,8 @@ class FeatureAnalyser:
|
|
283
285
|
)
|
284
286
|
|
285
287
|
df_imp.to_csv(filename, mode="a")
|
286
|
-
|
288
|
+
self.util.debug(f"Saved feature importance values to {filename}")
|
289
|
+
|
287
290
|
# check if feature distributions should be plotted
|
288
291
|
plot_feats = self.util.config_val("EXPL", "feature_distributions", False)
|
289
292
|
if plot_feats:
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: nkululeko
|
3
|
-
Version: 0.89.
|
3
|
+
Version: 0.89.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
|
@@ -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.89.1
|
360
|
+
--------------
|
361
|
+
* print and save result of feature importance
|
362
|
+
|
359
363
|
Version 0.89.0
|
360
364
|
--------------
|
361
365
|
* added Roc plots and classification report on Debug
|
@@ -2,11 +2,11 @@ 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=
|
5
|
+
nkululeko/constants.py,sha256=nRA0bWrvi-5tXm8QWv4dzDE-3sujMiz26U4QgSVuck0,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=zs1bjhpnKuNCPLJeiyDm19ME1NEDOQT3QNeyVKJq9Yc,4882
|
9
|
-
nkululeko/ensemble.py,sha256=
|
9
|
+
nkululeko/ensemble.py,sha256=egtOFxEp7gjuM5cKBfETnhTn1-7_4zWBPEah65K1C3U,12927
|
10
10
|
nkululeko/experiment.py,sha256=L4PzoScPLG2xTyniVy9evcBy_8CIe3RTeTEUVTqiuvQ,31186
|
11
11
|
nkululeko/explore.py,sha256=_GOgcRaPvh2xBbKPAkSJjYzgHhD_xb3ZCB6M1MPA6ao,3867
|
12
12
|
nkululeko/export.py,sha256=mHeEAAmtZuxdyebLlbSzPrHSi9OMgJHbk35d3DTxRBc,4632
|
@@ -51,7 +51,7 @@ nkululeko/data/dataset_csv.py,sha256=UGEpi__eT2KFS6Fop6N4HkMrzO-u5VP71gt44kwZavo
|
|
51
51
|
nkululeko/feat_extract/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
52
52
|
nkululeko/feat_extract/feats_agender.py,sha256=tMK3_qs8adylNNSR0CS1RjU9RxmpumLqmuyzmc2ZYjA,3184
|
53
53
|
nkululeko/feat_extract/feats_agender_agender.py,sha256=19NoRT0KJ8WoZ3EabTYexXymD7bDy58-H20jYmdqjD0,3498
|
54
|
-
nkululeko/feat_extract/feats_analyser.py,sha256=
|
54
|
+
nkululeko/feat_extract/feats_analyser.py,sha256=eW0v7Boybfj2gXi77MPjaLyHUQ1C42mx9hgoQeDwNac,12999
|
55
55
|
nkululeko/feat_extract/feats_ast.py,sha256=ycJn5eSVOxcEpmeHVk0FPB8q5XiTC8VSKz61L9n0Wa4,4638
|
56
56
|
nkululeko/feat_extract/feats_auddim.py,sha256=ulP_o4SGeQDFTs8YYCGKgccARAo6-wcjPK6-hhGjmn8,3155
|
57
57
|
nkululeko/feat_extract/feats_audmodel.py,sha256=aRGTBDKdYaTT_9xDaFZqpuyPhzxSNN_3b1PJDUHtYW4,3180
|
@@ -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=363Lgmcg6fPKCGbroX0DDyW_zcYNx-Ayqv67qdpfYcw,16710
|
110
|
-
nkululeko-0.89.
|
111
|
-
nkululeko-0.89.
|
112
|
-
nkululeko-0.89.
|
113
|
-
nkululeko-0.89.
|
114
|
-
nkululeko-0.89.
|
110
|
+
nkululeko-0.89.1.dist-info/LICENSE,sha256=0zGP5B_W35yAcGfHPS18Q2B8UhvLRY3dQq1MhpsJU_U,1076
|
111
|
+
nkululeko-0.89.1.dist-info/METADATA,sha256=AuVssWNRMXlseH5xSzcls--AAYLFSeEbFtHbAFT2o_o,40667
|
112
|
+
nkululeko-0.89.1.dist-info/WHEEL,sha256=UvcQYKBHoFqaQd6LKyqHw9fxEolWLQnlzP0h_LgJAfI,91
|
113
|
+
nkululeko-0.89.1.dist-info/top_level.txt,sha256=DPFNNSHPjUeVKj44dVANAjuVGRCC3MusJ08lc2a8xFA,10
|
114
|
+
nkululeko-0.89.1.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|