felixbur / nkululeko

Machine learning speaker characteristics
MIT License
31 stars 5 forks source link

processed_results.csv is written in directory, where Python is executed and not in the specified results folder #148

Closed Pascal-H closed 2 months ago

Pascal-H commented 2 months ago

When running the basic emodb example, but with sub-directories for the experiment, a processed_results.csv file is created in the base path of the project of VSCode.
The expected behavior would be that the processed_results.csv file is placed in the \<root>\<name> folder along with the other results.

Excerpt of the .ini file:

[EXP]
root = ./sandbox-emodb/
name = sandbox-emodb-classification
[DATA]
databases = ['emodb']
emodb = ./sandbox-emodb/emodb/
bagustris commented 2 months ago

@Pascal-H

Could you share full INI file and which module you used (e.g., nkululeko.nkululeko or nkululeko.aug_train)? I experienced this in the past when no slash was given at the end of the root, but should have been solved.

I think this is related to praat feature, which saves the results directly in the current directory, https://github.com/felixbur/nkululeko/blob/0ff42a7157dcdc88c3329123293842c0e8bfab53/nkululeko/feat_extract/feinberg_praat.py#L386 cc @felixbur

Pascal-H commented 2 months ago

Ah sure, here is the full setup from my side:

[EXP]
root = ./sandbox-emodb/
name = sandbox-emodb-classification
[DATA]
databases = ['emodb']
emodb = ./sandbox-emodb/emodb/
emodb.split_strategy = speaker_split
target = emotion
labels = ['anger', 'boredom', 'disgust', 'fear']
[FEATS]
type = ['praat']
[MODEL]
type = svm
[EXPL]
model = tree
plot_tree = True
[PLOT]
combine_per_speaker = mode

The base directory of my VSCode workspace is experiments/ and from there, I do:
python -m nkululeko.nkululeko --config sandbox-emodb/sandbox-emodb-classification.ini

Version of nkululeko, installed through pip:
nkululeko 0.88.9

Also when omitting the trailing slash of the root directory, processed_results.csv is put into the workspace's base directory:

[EXP]
root = ./sandbox-emodb
name = sandbox-emodb-classification
[DATA]
databases = ['emodb']
emodb = ./sandbox-emodb/emodb

I had to delete the sandbox-emodb-classification/ folder so that the features would get extracted again.

Pascal-H commented 2 months ago

I also just ran meta/demos/exp_emodb.ini with sub-directories:

[EXP]
root = ./sandbox-emodb/results/
name = sandbox-emodb-demo
[DATA]
databases = ['emodb']
emodb = ./sandbox-emodb/emodb
emodb.split_strategy = specified
emodb.train_tables = ['emotion.categories.train.gold_standard']
emodb.test_tables = ['emotion.categories.test.gold_standard']
target = emotion
labels = ['anger', 'boredom', 'disgust', 'fear', 'happiness', 'neutral', 'sadness']
[FEATS]
type = ['os']
[MODEL]
type = xgb
[PLOT]

And no processed_results.csv was created.

@felixbur also mentioned that he suspected processed_results.csv to come from the logits of the uncertainty predictions.
Looking at the file itself, this is how it looks like:

duration,meanF0Hz,stdevF0Hz,HNR,localJitter,localabsoluteJitter,rapJitter,ppq5Jitter,ddpJitter,localShimmer,localdbShimmer,apq3Shimmer,apq5Shimmer,apq11Shimmer,ddaShimmer,f1_mean,f2_mean,f3_mean,f4_mean,f1_median,f2_median,f3_median,f4_median,JitterPCA,ShimmerPCA
1.8778125,203.60971635538138,42.47590625871061,7.639282313716755,0.024391396312657833,0.00012107155994028162,0.008413809079689905,0.01068176557211156,0.025241427239069716,0.13683031756677322,1.141223595937736,0.05047427398427331,0.05979095580280943,0.09644036920282621,0.15142282195281992,603.4801179383704,1681.8927413275244,2620.671582487745,3526.9288297517064,559.1577146721875,1739.7929576950887,2631.59903171107,3449.039406511525,0.19241990179525015,0.03999553090171859
2.123625,199.04675543849777,43.19657036448981,8.161075454467616,0.02379647142652169,0.00012117739577950492,0.008930284255202434,0.01217817925308896,0.026790852765607304,0.0964774721398056,0.8683033144459271,0.03335758683069767,0.044495005808842,0.0751809892044902,0.10007276049209302,561.381940645297,1878.6806380024184,2737.8164072145605,3634.0501647528804,401.4444711560659,1996.8271772082398,2742.2980493417017,3592.0356054563254,-0.08928372786298411,0.023684288167918725
1.4980625,221.34505667049555,49.01528996755336,9.464978457855796,0.023106956474726447,0.00010593833034635891,0.007979565091086358,0.00990793314066936,0.023938695273259075,0.10330018585817545,0.9653807231029805,0.034994113532047094,0.043513332461997824,0.06789037172284451,0.10498234059614128,692.9209185623598,1829.2225800678966,2591.9727535431557,3520.2437843197463,592.7262449609921,1892.7485317013184,2576.605470254447,3492.18751306694,0.005751151395036902,0.02274029183070035
1.504875,234.88672990007578,28.345842383394437,9.232337442831332,0.02801544830049937,0.00012009266538634826,0.012947064548301029,0.013420153803576695,0.038841193644903085,0.14127730876498182,1.2125281830476435,0.05649802831783962,0.08677099472792672,0.12658297961930184,0.16949408495351886,519.3556577509185,1540.7682671513326,2585.0463046382306,3702.543374269189,485.8542578879228,1487.3665955292315,2569.747345167839,3706.3562402544258,0.2706319541970408,0.037844507745990116
1.931,106.33282791430862,24.854751652330794,14.028218208772573,0.026709498991448154,0.00025088851792130914,0.010147050792028536,0.013878838458561709,0.030441152376085606,0.08384484817973364,0.9070461764769973,0.024481975769286617,0.04291565315016582,0.09160229737818056,0.07344592730785984,478.29906310325543,1450.9569600266504,2516.556340198074,3524.658458958373,459.1166963908871,1391.7307838436363,2478.923610138465,3509.427479339224,-0.05546160823551993,-0.01475082024352413

So it might indeed be the Praat features :+1:

felixbur commented 2 months ago

we found it, it was just a Feinberg hack in the praat script, is removed now