def svm_data(args): ''' Functinon runs data regeneration according to input arguments ''' t = SVMTest() t.regenerate_data(dbfile=args.db_file, count=args.count, max_token_size=args.max_token_size)
def _thread_svm(db_file, count, max_token_size, n_fold_cv, kernel): from src.svm.svm_test import SVMTest t = SVMTest() # load data t.regenerate_data(dbfile=db_file, count=count, max_token_size=max_token_size) # run simulated annealing state, energy = t.run_annealing(n_fold_cv=n_fold_cv, kernel=kernel) # run test with optimal parameters result = t.run(c=state[1], param=state[0], n_fold_cv=n_fold_cv, kernel=kernel) # return results return {'type':'svm', 'result': result, 'state':state, 'emergy':energy}