-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
80 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters