Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

intertiment issunes and fixes #25

Open
wentixiaogege opened this issue Mar 26, 2021 · 1 comment
Open

intertiment issunes and fixes #25

wentixiaogege opened this issue Mar 26, 2021 · 1 comment

Comments

@wentixiaogege
Copy link

wentixiaogege commented Mar 26, 2021

replace like this

@staticmethod
    def multistage(X, y, forecast_period, num_sample_points=200):
        glm = multistage_glm.MultiStageGLM()
        Xtrain = X[:-forecast_period]
        ytrain = y
        Xtest = X[-forecast_period:]
        #######      ytest = y[-forecast_period:]
        print(Xtrain.shape,ytrain.shape)
        glm.fit(Xtrain, ytrain)
        yfit = glm.predict(Xtrain)
        ypred_list = []
        for _ in range(num_sample_points):
            ypred = glm.predict(Xtest)
            ypred_list.append(ypred.reshape((-1, 1)))
        ypred = np.concatenate(ypred_list, axis=1)
        
        p50 = np.quantile(ypred, 0.5, axis=1)
        p25 = np.quantile(ypred, 0.25, axis=1)
        p90 = np.quantile(ypred, 0.90, axis=1)

        return yfit, p50
@jingw2
Copy link
Owner

jingw2 commented Oct 13, 2021

Thanks,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants