How to run multiple experiments in one go with Nkululeko

With nkululeko since version 0.98.0 there is a new module that allows for the run of several classifier / feature combinations in one go, it's called flags.

Here is an example how to run this with any database:

[MODEL]
layers = [1024, 16]
patience = 5
[FLAGS]
models = ['xgb', 'svm', 'mlp']
features = ['os', 'praat']   

You run this with the python command

python -m nkululeko.flags --config exp.ini

and then would get the output (in this case for emodb)

=== SUMMARY OF 6 EXPERIMENTS ===
Experiment 1: {'models': 'xgb', 'features': 'os'}
  Result: 0.571226718262931
Experiment 2: {'models': 'xgb', 'features': 'praat'}
  Result: 0.571226718262931
Experiment 3: {'models': 'svm', 'features': 'os'}
  Result: 0.3257565615802607
Experiment 4: {'models': 'svm', 'features': 'praat'}
  Result: 0.3257565615802607
Experiment 5: {'models': 'mlp', 'features': 'os'}
  Result: 0.36177991225837364
Experiment 6: {'models': 'mlp', 'features': 'praat'}
  Result: 0.3472090337439332

=== BEST CONFIGURATION ===
Best Result: 0.571226718262931
Best Parameters:
  models: xgb
  features: os

To use these parameters, set in your config file:
[MODEL]
type = xgb
[FEATS]
type = ['os']

Flags experiments time: 29.04 seconds (0.48 minutes)
DONE

Leave a Reply

Your email address will not be published. Required fields are marked *