def climate(): lambd = 1e2 gamma = 1e2 season = "DJF" data = pickle.load(open("/scratch/vandal.t/experiments/DownscaleData/monthly_804_3150.pkl", "r")) model = pMSSL(lambd=lambd, gamma=gamma, max_epochs=1000) dmodel = DownscaleModel(data, model, season=season) dmodel.train() print dmodel.model.Omega[:5, :5] print dmodel.model.W[:5, :5] print "Omega to zero", numpy.sum(dmodel.model.Omega == 0) print "W to zero", numpy.sum(dmodel.model.W == 0)
def climate(): lambd = 1e2 gamma = 1e2 season = "DJF" data = pickle.load( open( "/scratch/vandal.t/experiments/DownscaleData/monthly_804_3150.pkl", "r")) model = pMSSL(lambd=lambd, gamma=gamma, max_epochs=1000) dmodel = DownscaleModel(data, model, season=season) dmodel.train() print dmodel.model.Omega[:5, :5] print dmodel.model.W[:5, :5] print "Omega to zero", numpy.sum(dmodel.model.Omega == 0) print "W to zero", numpy.sum(dmodel.model.W == 0)
def qrnn_test(data, loc, season): model = QRNNCV(tol=1e-2, hidden_nodes=[3], n_jobs=1, ntrails=3) #model = QRNN(tol=1e-2, ntrails=3) dmodel = DownscaleModel(data, model, season=season) dmodel.train(location={'lat': loc[0], 'lon': loc[1]}) return pandas.DataFrame(dmodel.get_results())
def bma_test(data, loc, season): model = BMA() dmodel = DownscaleModel(data, model, season=season) dmodel.train(location={'lat': loc[0], 'lon': loc[1]}) return pandas.DataFrame(dmodel.get_results())
def mssl_test(data, loc, season): model = pMSSL(gamma=0.1, lambd=0.1) dmodel = DownscaleModel(data, model, season=season) dmodel.train() return pandas.DataFrame(dmodel.get_results())
def mtlasso_test(data, loc, season): model = MultiTaskLassoCV(max_iter=2000, normalize=True) dmodel = DownscaleModel(data, model, season=season) dmodel.train() return pandas.DataFrame(dmodel.get_results())
def lasso_test(data, loc, season): model = LassoCV(max_iter=2000, normalize=True) dmodel = DownscaleModel(data, model, season=season) dmodel.train(location={'lat': loc[0], 'lon': loc[1]}) return pandas.DataFrame(dmodel.get_results())
def stepwiseregression_test(data, loc, season): model = BackwardStepwiseRegression() dmodel = DownscaleModel(data, model, season=season) dmodel.train(location={'lat': loc[0], 'lon': loc[1]}) return pandas.DataFrame(dmodel.get_results())