timecols = [11] valcols = [3,4,5,6,7,8,9,11] parser = Parser("prunedPhones.csv",namecols,timecols,valcols) #Get either every dimension or a single dimension val1s = [parser.getProperties()[0]] val2s = [parser.getProperties()[1]] weightFactors = [0.2] Cs = [20] gammas = [0.2] #''' od = ObservedDistribution(parser, val1s[0], contours, val2s[0], weightFactors[0]) ed = ExpectedDistribution(od,parallel=False) edv = ExpectedDistributionVisualiser(ed,od,50,50) fig = od.plotObservedContours(title='', alpha=0.25) edv.save('dummy.pdf') #''' print "---------------------Parallel=True---------------------" for val1 in val1s: for val2 in val2s: if val1 is not val2: start_time = time.time() #print "Modelling",val1,"(independent) against",val2,"(dependent)." od = ObservedDistribution(parser, val1, contours, val2, weightFactors[0]) ed = ExpectedDistribution(od,{'C':Cs[0],'gamma':gammas[0]},parallel=True) edv = ExpectedDistributionVisualiser(ed,od,50,50)
def __init__(self, parser_train, ind_attr, contours , dep_attr, weight_std_ratio=1, parser_test=None, retrain=True, prefix=None): ObservedDistribution.__init__(self, parser_train, ind_attr, contours , dep_attr, weight_std_ratio, retrain, prefix, save=False) if parser_test is not None: self.addTestData(parser_test) else: self.test_parser = None