np.array(next_train_y[t]), t) # acc = util.model_roc_score(learner, test_dat) acc = util.model_score(learner, test_dat) test_acc.append(acc) learned_size.append(total_pool_size - prof.get_pool_size() + init_size) if ITER_ENABLE: if count < 0: break count -= 1 return test_acc, learned_size pool_dat = load_pool() init_dat = load_init() test_dat = load_test() train_pool = np.array(gen_land_pool(pool_dat)) shuffle(train_pool) print "[info]Start passive learning..." test_acc_ps, learned_size_ps = run_stl_landm(pool_dat, init_dat, test_dat, do_active=False) util.curve_to_csv("res/ps_stl_non.csv", test_acc_ps, learned_size_ps) print "[info]Start active learning..." test_acc_ac, learned_size_ac = run_stl_landm(pool_dat,
def reload_dat(): gc.collect() pool_dat = load_pool() init_dat = load_init() test_dat = load_test() return pool_dat, init_dat, test_dat
ELLA_DIR = "/home/stpanda/Dropbox/STDreamSoft/Academics/SeniorThesis/Projects/al_ella/lib/ELLAv1.0" eng.addpath("/home/stpanda/Dropbox/STDreamSoft/Academics/SeniorThesis/Projects/al_ella/ml") eng.addpath(eng.genpath(ELLA_DIR)) # res = eng.runExperimentActiveTask() # print res ######## Panda ###### # Comparing Multiple Active Learner vs ELLA + ATS vs ELLA + ATS + AL vs # ELLA + AL # This file runs ELLA + Active Task Selection ##################### ## Load all files test_dat = util.add_bias(load_test()) pool_dat = util.add_bias(load_pool()) init_dat = util.add_bias(load_init()) init_size = util.dat_size(init_dat) ## Init ELLA Model with init set ## ella_model = ELLA(eng, init_dat) init_acc = ella_score(ella_model, test_dat) test_acc = [init_acc] learned_size = [init_size] prof = Professor(init_dat, pool_dat, multi_t=True, random=True) total_pool_size = prof.get_pool_size() print "train pool size", total_pool_size # ### Training Until No more data available OR Reach the set N_ITER ###