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

Performance of HOFTS on erratic dataset. #23

Open
pintuiitbhi opened this issue Jun 6, 2019 · 0 comments
Open

Performance of HOFTS on erratic dataset. #23

pintuiitbhi opened this issue Jun 6, 2019 · 0 comments

Comments

@pintuiitbhi
Copy link

pintuiitbhi commented Jun 6, 2019

I trained a HOFTS with order 3 on erratic data. Dataset is montly. I predicted on train data and it looks like it has overfitted.

Here is the code:

from pyFTS.models import hofts, pwfts

fig, ax = plt.subplots(nrows=1, ncols=1, figsize=[15,8])


ax.plot(train_uv[:100], label='Original')
rows = []
# for method in [hofts.HighOrderFTS, hofts.WeightedHighOrderFTS, pwfts.ProbabilisticWeightedFTS]:
for method in [hofts.HighOrderFTS]:
#     for order in [1, 2,3]:
    for order in [3]:
        model = method(partitioner=part, order=order)

        model.shortname += str(order)

        model.fit(train_uv)

        forecasts = model.predict(train_uv)
#         forecasts = model.predict([0,792,492], steps_ahead=142)
        forecast_fuzzy = forecasts
        for k in np.arange(order):
            forecasts.insert(0,None)

        ax.plot(forecasts[:100], label=model.shortname)

        models.append(model.shortname)

#         Util.persist_obj(model, model.shortname)

#         del(model)

handles, labels = ax.get_legend_handles_labels()
lgd = ax.legend(handles, labels, loc=2, bbox_to_anchor=(1, 1))  

I want to predict next 3 months data ie. 12 data points. How I can use the "predict" function to do this?

This is how I tried.

fig, ax = plt.subplots(nrows=1, ncols=1, figsize=[15,8])

ax.plot(test_uv, label='Original')
forecasts = model.predict([1068,2280,4392], steps_ahead=12)
order = 3
for k in np.arange(order):
    forecasts.insert(0,None)
ax.plot(forecasts, label=model.shortname)
handles, labels = ax.get_legend_handles_labels()
lgd = ax.legend(handles, labels, loc=2, bbox_to_anchor=(1, 1))

test

Why is it remains constant after predicting 3 points in future?

[1068,2280,4392] is the last three data points of train dataset.

Originally posted by @pintuiitbhi in #6 (comment)

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

1 participant