# add the paths necessary for clustering algorithm and ibcc - currently only works on Greg's computer if os.path.exists("/home/ggdhines"): sys.path.append("/home/ggdhines/PycharmProjects/reduction/experimental/clusteringAlg") elif os.path.exists("/Users/greg"): sys.path.append("/Users/greg/Code/reduction/experimental/clusteringAlg") else: sys.path.append("/home/greg/github/reduction/experimental/clusteringAlg") from divisiveKmeans import DivisiveKmeans from zeroFix import ZeroFix clusterAlg = DivisiveKmeans().__fit__ fixAlg = ZeroFix().__fix__ penguin = PenguinAggregation() client = pymongo.MongoClient() db = client['penguin_2015-01-18'] collection = db["penguin_classifications"] subject_collection = db["penguin_subjects"] accuracy = [] numGold = [] penguin.__readin_subject__("APZ00035nr") penguin.__display_raw_markings__("APZ00035nr")
# add the paths necessary for clustering algorithm and ibcc - currently only works on Greg's computer if os.path.exists("/home/ggdhines"): sys.path.append( "/home/ggdhines/PycharmProjects/reduction/experimental/clusteringAlg") else: sys.path.append("/home/greg/github/reduction/experimental/clusteringAlg") from agglomerativeClustering import Ward, TooBig clusterAlg = Ward().__fit__ penguin = PenguinAggregation() subject_ids = pickle.load( open(aggregation.base_directory + "/Databases/penguin_gold.pickle", "rb")) for i, subject in enumerate(random.sample(subject_ids, 50)): #subject = "APZ000173v" print i, subject penguin.__readin_subject__(subject, users_to_skip=["caitlin.black"]) try: numClusters, time = penguin.__cluster_subject__(subject, clusterAlg) except TooBig: print "too big" continue if not blankImage: penguin.__display_raw_markings__(subject) penguin.__display__markings__(subject)
import matplotlib.cbook as cbook # add the paths necessary for clustering algorithm and ibcc - currently only works on Greg's computer if os.path.exists("/home/ggdhines"): sys.path.append( "/home/ggdhines/PycharmProjects/reduction/experimental/clusteringAlg") elif os.path.exists("/Users/greg"): sys.path.append("/Users/greg/Code/reduction/experimental/clusteringAlg") else: sys.path.append("/home/greg/github/reduction/experimental/clusteringAlg") from divisiveKmeans import DivisiveKmeans from zeroFix import ZeroFix clusterAlg = DivisiveKmeans().__fit__ fixAlg = ZeroFix().__fix__ penguin = PenguinAggregation() client = pymongo.MongoClient() db = client['penguin_2015-01-18'] collection = db["penguin_classifications"] subject_collection = db["penguin_subjects"] accuracy = [] numGold = [] penguin.__readin_subject__("APZ00035nr") penguin.__display_raw_markings__("APZ00035nr")
import cPickle as pickle import aggregation # add the paths necessary for clustering algorithm and ibcc - currently only works on Greg's computer if os.path.exists("/home/ggdhines"): sys.path.append("/home/ggdhines/PycharmProjects/reduction/experimental/clusteringAlg") else: sys.path.append("/home/greg/github/reduction/experimental/clusteringAlg") from agglomerativeClustering import Ward, TooBig clusterAlg = Ward().__fit__ penguin = PenguinAggregation() subject_ids = pickle.load(open(aggregation.base_directory + "/Databases/penguin_gold.pickle", "rb")) for i, subject in enumerate(random.sample(subject_ids, 50)): # subject = "APZ000173v" print i, subject penguin.__readin_subject__(subject, users_to_skip=["caitlin.black"]) try: numClusters, time = penguin.__cluster_subject__(subject, clusterAlg) except TooBig: print "too big" continue if not blankImage: penguin.__display_raw_markings__(subject) penguin.__display__markings__(subject)