def printScoresFromCollectionFile(feExFun, clf, lt, collFi, out_file, labelsHierarchy): """ clf : classifier le : label encoder (object) collfi : annotated wav collection (*.txt) out_file : out file (*.txt) """ coll = fex.readCols( collFi, colIndexes=(0, 1)) # np.loadtxt(collFi, delimiter='\t', dtype='|S') printScoresFromCollection(feExFun, clf, lt, coll, out_file, labelsHierarchy)
Tpipe = fex.makeTransformationsPipeline(T_settings) ## clf settings clfStr = 'cv{}-'.format(cv) settingsStr = "{}-{}".format(Tpipe.string, clfStr) settingsStr += '-labsHierarchy_' + '_'.join(labsHierarchy) ## write in out file out_file = open(out_fN, 'a') out_file.write("#WSD1\n###--------- {} ---------###\n".format( time.strftime("%Y.%m.%d\t\t%H:%M:%S"))) out_file.write("#" + settingsStr + '\n') out_file.close() ## load collections train_coll = fex.readCols(collFi_train, colIndexes=(0, 1)) test_coll = np.genfromtxt(collFi_test, dtype=object) lt = myML.labelTransformer(clf_labs) def runWSD2Experiment(train_coll, test_coll, lt, T_settings, labsHierarchy, cv, out_fN, testColl_scoreClassLabels, readSections, param=None,