from nodes import setup, speciesList import numpy as np import matplotlib.pyplot as plt from scipy.stats.stats import pearsonr tauRange = range(0,101,10) algPercent = [] currPercent = [] for tau in tauRange: print tau algPercent.append([]) currPercent.append([]) for j in range(5): print "--" + str(j) photos,users = setup(tau=tau) for p in photos.values(): p.__sample__(5) for u in users.values(): u.__prune__() #initialize things using majority voting for p in photos.values(): p.__majorityVote__() #estimate the user's "correctness" for u in users.values(): for s in speciesList: u.__speciesCorrect__(s,beta=0.2)
"gazelleGrants": [], "guineaFowl": [], "hyenaSpotted": [], "otherBird": [], "hippopotamus": [], "reedbuck": [], "eland": [], "baboon": [], "lionFemale": [], "topi": [] } total = {s: 0. for s in correct.keys()} print len(correct) for j in range(1): print j photos, users = setup(tau=50) for p in photos.values(): p.__sample__(25) for u in users.values(): u.__prune__() #initialize things using majority voting for p in photos.values(): p.__majorityVote__() #estimate the user's "correctness" for u in users.values(): for s in speciesList: u.__speciesCorrect__(s, beta=0.01)
#!/usr/bin/env python __author__ = 'greg' from nodes import setup import numpy as np import matplotlib.pyplot as plt from scipy.stats.stats import pearsonr photos, users = setup() for p in photos.values(): p.__majorityVote__() X = [] Y = [] for u in users.values(): e, h = u.__getStats__() if (e != -1) and (h != -1): X.append(e * 100) Y.append(h * 100) plt.plot(X, Y, '.', color="black") plt.xlabel("Percentage of easy pictures correctly classified") plt.ylabel("Percentage of hard pictures correctly classified") print pearsonr(X, Y) plt.show()
import numpy as np import matplotlib.pyplot as plt from scipy.stats.stats import pearsonr numUser = [5, 10, 15, 20, 25] tauRange = [1, 10, 100] algPercent = {t: [] for t in tauRange} for nn in numUser: print nn for t in tauRange: algPercent[t].append([]) for j in range(10): print "== " + str(j) photos, users = setup(tau=10) for p in photos.values(): p.__sample__(nn) for u in users.values(): u.__prune__() #initialize things using majority voting for p in photos.values(): p.__majorityVote__() for t in tauRange: #estimate the user's "correctness" for u in users.values(): for s in speciesList:
#!/usr/bin/env python __author__ = 'greg' from nodes import setup import numpy as np import matplotlib.pyplot as plt from scipy.stats.stats import pearsonr photos,users = setup() for p in photos.values(): p.__majorityVote__() X = [] Y = [] for u in users.values(): e,h = u.__getStats__() if (e != -1) and (h != -1): X.append(e*100) Y.append(h*100) plt.plot(X,Y,'.',color="black") plt.xlabel("Percentage of easy pictures correctly classified") plt.ylabel("Percentage of hard pictures correctly classified") print pearsonr(X,Y) plt.show()
from nodes import setup, speciesList import numpy as np import matplotlib.pyplot as plt from scipy.stats.stats import pearsonr tauRange = range(0, 101, 10) algPercent = [] currPercent = [] for tau in tauRange: print tau algPercent.append([]) currPercent.append([]) for j in range(5): print "--" + str(j) photos, users = setup(tau=tau) for p in photos.values(): p.__sample__(5) for u in users.values(): u.__prune__() #initialize things using majority voting for p in photos.values(): p.__majorityVote__() #estimate the user's "correctness" for u in users.values(): for s in speciesList: u.__speciesCorrect__(s, beta=0.2)
import numpy as np import matplotlib.pyplot as plt from scipy.stats.stats import pearsonr numUser = [5,10,15,20,25] algPercent = [] currPercent = [] speciesList = ['elephant','zebra','warthog','impala','buffalo','wildebeest','gazelleThomsons','dikDik','giraffe','gazelleGrants','lionFemale','baboon','hippopotamus','ostrich','human','otherBird','hartebeest','secretaryBird','hyenaSpotted','mongoose','reedbuck','topi','guineaFowl','eland','aardvark','lionMale','porcupine','koriBustard','bushbuck','hyenaStriped','jackal','cheetah','waterbuck','leopard','reptiles','serval','aardwolf','vervetMonkey','rodents','honeyBadger','batEaredFox','rhinoceros','civet','genet','zorilla','hare','caracal','wildcat'] correct = {"wildebeest":[],"zebra":[],"hartebeest":[],"gazelleThomsons":[],"buffalo":[],"impala":[],"warthog":[],"giraffe":[],"elephant":[],"human":[],"gazelleGrants":[],"guineaFowl":[],"hyenaSpotted":[],"otherBird":[],"hippopotamus":[],"reedbuck":[],"eland":[],"baboon":[],"lionFemale":[],"topi":[]} total = {s:0. for s in correct.keys()} print len(correct) for j in range(1): print j photos,users = setup(tau=50) for p in photos.values(): p.__sample__(25) for u in users.values(): u.__prune__() #initialize things using majority voting for p in photos.values(): p.__majorityVote__() #estimate the user's "correctness" for u in users.values(): for s in speciesList: u.__speciesCorrect__(s,beta=0.01)
import numpy as np import matplotlib.pyplot as plt from scipy.stats.stats import pearsonr numUser = [5,10,15,20,25] tauRange = [1,10,100] algPercent = {t:[] for t in tauRange} for nn in numUser: print nn for t in tauRange: algPercent[t].append([]) for j in range(10): print "== " + str(j) photos,users = setup(tau=10) for p in photos.values(): p.__sample__(nn) for u in users.values(): u.__prune__() #initialize things using majority voting for p in photos.values(): p.__majorityVote__() for t in tauRange: #estimate the user's "correctness" for u in users.values():