import pickle from simulation import plotMulti, plotY1Y2, holdoutRealWorkers ###################################### ###########simulated dataset########## ###################################### logscale = False dirty = 0.2 n_items = 1000 n_rep = 10 print 'Sensitivity of Total Error Estimation' #estimators_sim = [vNominal, chao92, lambda x:sChao92(x,shift=1),lambda x:vRemainSwitch2(x)] #legend_sim = ['VOTING','Chao92','V-CHAO','SWITCH'] #gt_list_sim = [lambda x:gt,lambda x:gt,lambda x:gt,lambda x:gt] estimators_sim = [lambda x: vNominal(x), chao92, lambda x: vRemainSwitch2(x)] gt_list_sim = [lambda x: gt, lambda x: gt, lambda x: gt] legend_sim = ['VOTING', 'Chao92', 'SWITCH'] legend_gt = ["Ground Truth"] yaxis = 'SRMSE' #'Relative Error %' rel_err = True err_skew = False ''' title = 'Tradeoff: False Positives' recall = 0.1 n_worker=50 font = 20 Xs = [] Ys = [] GTs = []
from estimator import chao92, sChao92, nominal, vNominal, sNominal, remain_switch, gt_switch, extrapolation, extrapolation2, extrapolation3, vRemainSwitch, vRemainSwitch2, extrapolateFromSample, sampleCoverage, minTasks, minTasksToCleanAll from datagen import generateDist, generateDataset, generateWeightedDataset, shuffleList from dataload import simulatedData, loadCrowdFlowerData, loadRestaurant2, loadProduct, loadRestaurantExtSample, loadAddress import pickle from simulation import plotMulti, plotY1Y2, holdoutRealWorkers ############################################## ########### real-world datasets ############## ############################################## #====total error==== estimators = [ lambda x: extrapolateFromSample(x, slist, 0.05) + obvious_err, lambda x: vNominal(x) + obvious_err, lambda x: sChao92(x, shift=1) + obvious_err, lambda x: vRemainSwitch2(x) + obvious_err ] #estimators = [lambda x: vNominal(x) + obvious_err, lambda x: chao92(x)+obvious_err] legend = ["EXTRAPOL", "VOTING", "V-CHAO", "SWITCH"] gt_list = [ lambda x: gt + obvious_err, lambda x: gt + obvious_err, lambda x: gt + obvious_err, lambda x: gt + obvious_err ] legend_gt = ["Ground Truth"] #====switch==== estimators2 = [lambda x: remain_switch(x) - sNominal(x)] estimators2a = [ lambda x: remain_switch(x, neg_switch=False) - sNominal(x, neg_switch=False) ]