Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix shap value calculation and plot #158

Merged
merged 9 commits into from
Sep 6, 2024
Merged

Conversation

bagustris
Copy link
Collaborator

No description provided.

@felixbur
Copy link
Owner

felixbur commented Sep 4, 2024

@bagustris ?
when i try this, i get 4 errors on our tests, eg:

DEBUG: explore: running exp_emodb_explore from config tests/exp_emodb_explore_data.ini, nkululeko version 0.89.1
DEBUG: experiment: value for type not found, using default: audformat
DEBUG: dataset: emodb: loading from ./data/emodb/emodb
DEBUG: dataset: emodb: reusing previously stored file ./tests/results/exp_emodb_explore/./store/emodb.pkl
DEBUG: dataset: emodb: loaded with 100 samples: got targets: True, got speakers: True (10), got sexes: True
DEBUG: datafilter: emodb: limited samples to 100, reduced samples from 100 to 100
DEBUG: experiment: target: emotion
DEBUG: experiment: Labels (from database): ['neutral', 'disgust', 'sadness', 'fear', 'happiness', 'boredom', 'anger']
DEBUG: experiment: loaded databases emodb
DEBUG: experiment: reusing previously stored ./tests/results/exp_emodb_explore/./store/testdf.csv and ./tests/results/exp_emodb_explore/./store/traindf.csv
DEBUG: experiment: value for type is not found, using default: dummy
DEBUG: experiment: Categories test (nd.array): ['fear' 'neutral' 'anger' 'boredom' 'happiness' 'disgust']
DEBUG: experiment: Categories train (nd.array): ['happiness' 'boredom' 'anger' 'sadness' 'fear' 'disgust' 'neutral']
DEBUG: experiment: 10 speakers in test and 10 speakers in train
DEBUG: explore: train shape : (80, 8), test shape:(20, 8)
Traceback (most recent call last):
  File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/home/audeering.local/fburkhardt/research/nkululeko/nkululeko/explore.py", line 105, in <module>
    main(cwd)  # use this if you want to state the config file path on command line
  File "/home/audeering.local/fburkhardt/research/nkululeko/nkululeko/explore.py", line 95, in main
    expr.init_runmanager()
  File "/home/audeering.local/fburkhardt/research/nkululeko/nkululeko/experiment.py", line 508, in init_runmanager
    self.df_train, self.df_test, self.feats_train, self.feats_test
AttributeError: 'Experiment' object has no attribute 'feats_train'

@bagustris
Copy link
Collaborator Author

I'll check...

@bagustris
Copy link
Collaborator Author

With my recent push, there is no error on running test.

./run_test2.sh -spotlight

DEBUG: explore: running exp_polish_os from config tests/exp_polish_gmm.ini, nkululeko version 0.89.1
DEBUG: experiment: sampling selection: all
DEBUG: model: value for n_jobs is not found, using default: 8
DEBUG: feats_analyser: loading ./tests/results/exp_polish_os/./store//my_shap_values.pkl
DEBUG: feats_analyser: plotted SHAP feature importance to ./tests/results/exp_polish_os/./images/run_0/../train_dev_test_SHAP_gmm.png
DEBUG: experiment: value for scatter.target is not found, using default: ['class_label']
DONE
Total tests passed: 44
Total tests failed: 0
Total time taken: 235 seconds

@bagustris bagustris marked this pull request as draft September 5, 2024 04:49
@bagustris bagustris marked this pull request as ready for review September 5, 2024 07:11
@felixbur felixbur merged commit 4d93482 into felixbur:main Sep 6, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants