예제 #1
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)
예제 #2
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)
예제 #3
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())
예제 #4
0
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())
예제 #5
0
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())
예제 #6
0
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())
예제 #7
0
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())
예제 #8
0
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())
예제 #9
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())
예제 #10
0
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())
예제 #11
0
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())
예제 #12
0
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())
예제 #13
0
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())
예제 #14
0
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())