Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
felixbur committed Jan 26, 2022
1 parent d664c66 commit 1de9879
Show file tree
Hide file tree
Showing 7 changed files with 80 additions and 7 deletions.
3 changes: 2 additions & 1 deletion tests/exp_add_learned.ini
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ epochs = 1
save = True
[DATA]
databases = ['emodb', 'learned']
emodb = /home/audeering.local/fburkhardt/audb/emodb/1.1.1/135fc543/
emodb = /home/felix/data/audb/emodb/
emodb.split_strategy = speaker_split
emodb.mapping = {'anger':'angry', 'happiness':'happy', 'sadness':'sad', 'neutral':'neutral'}
learned = predict_and_store_test.csv
Expand All @@ -20,3 +20,4 @@ type = os
type = xgb
save = True
[PLOT]
tsne = True
2 changes: 1 addition & 1 deletion tests/exp_bdtg.ini
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ epochs = 1
type = regression
[DATA]
databases = ['bdtg']
bdtg = /home/audeering.local/fburkhardt/audb/bundestag-age/3.1.0/135fc543
bdtg = /home/felix/data/audb/bundestag-age/3.1.0/d3b62a9b/
bdtg.files_tables = ['files']
bdtg.split_strategy = specified
bdtg.test_tables = ['age.test']
Expand Down
24 changes: 24 additions & 0 deletions tests/exp_bdtg_class.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
[EXP]
root = ./tests/
name = exp_bdtg_class
runs = 1
epochs = 1
type = classification
[DATA]
databases = ['bdtg']
type = continuous
bdtg = /home/felix/data/audb/bundestag-age/3.1.0/d3b62a9b/
bdtg.files_tables = ['files']
bdtg.split_strategy = specified
bdtg.test_tables = ['age.test']
bdtg.train_tables = ['age.train']
bdtg.limit = 1000
target = age
labels = ['u40', '40ies', '50ies', '60ies', 'ü70']
bins = [-1000, 40, 50, 60, 70, 1000]
[FEATS]
type = os
needs_feature_extraction = True
[MODEL]
type = xgb
[PLOT]
41 changes: 41 additions & 0 deletions tests/exp_bdtg_class.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# main.py
# Demonstration code to use the ML-experiment framework

import sys
sys.path.append("./src")
import experiment as exp
import configparser
from util import Util
import constants

def main(config_file):
# load one configuration per experiment
config = configparser.ConfigParser()
config.read(config_file)
util = Util()

# create a new experiment
expr = exp.Experiment(config)
print(f'running {expr.name}, nkululeko version {constants.VERSION}')

# load the data
expr.load_datasets()

# split into train and test
expr.fill_train_and_tests()
util.debug(f'train shape : {expr.df_train.shape}, test shape:{expr.df_test.shape}')

# extract features
expr.extract_feats()
util.debug(f'train feats shape : {expr.feats_train.df.shape}, test feats shape:{expr.feats_test.df.shape}')

# initialize a run manager
expr.init_runmanager()

# run the experiment
expr.run()

print('DONE')

if __name__ == "__main__":
main('./tests/exp_bdtg_class.ini')
10 changes: 7 additions & 3 deletions tests/exp_cross.ini
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@ trains = ['emodb']
tests = ['polish']
target = emotion
strategy = cross_data
emodb = /home/audeering.local/fburkhardt/audb/emodb/1.1.1/135fc543/
emodb = /home/felix/data/audb/emodb/
emodb.mapping = {'anger':'angry', 'happiness':'happy', 'sadness':'sad', 'neutral':'neutral'}
polish = /home/audeering.local/fburkhardt/audb/polish-emotional-speech/1.0.0/135fc543/
emodb.value_counts = True
polish = /home/felix/data/audb/polish-emotional-speech/
polish.mapping = {'anger':'angry', 'joy':'happy', 'sadness':'sad', 'neutral':'neutral'}
polish.value_counts = True
labels = ['angry', 'happy', 'neutral', 'sad']
[FEATS]
type = os
Expand All @@ -26,4 +28,6 @@ device = cpu
save = True
[PLOT]
plot_epoch_progression = 1
plot_best_model = 1
plot_best_model = 1
value_counts = True
tsne = True
5 changes: 4 additions & 1 deletion tests/exp_emodb.ini
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ epochs = 1
save = True
[DATA]
databases = ['emodb']
emodb = /home/audeering.local/fburkhardt/audb/emodb/1.1.1/135fc543/
emodb = /home/felix/data/audb/emodb/
emodb.split_strategy = speaker_split
emodb.mapping = {'anger':'angry', 'happiness':'happy', 'sadness':'sad', 'neutral':'neutral'}
emodb.value_counts = True
target = emotion
labels = ['angry', 'happy', 'neutral', 'sad']
[FEATS]
Expand All @@ -17,3 +18,5 @@ type = os
type = xgb
save = True
[PLOT]
value_counts = True
tsne = True
2 changes: 1 addition & 1 deletion tests/exp_msp.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ runs = 1
epochs = 1
[DATA]
databases = ['msp']
msp = /home/audeering.local/fburkhardt/audb/msppodcast/2.4.0/135fc543
msp = /home/felix/data/audb/msppodcast/2.4.0/135fc543
msp.files_tables = ['files.test-1', 'files.train']
msp.target_tables = ['emotion.test-1', 'emotion.train']
msp.split_strategy = specified
Expand Down

0 comments on commit 1de9879

Please sign in to comment.