Python Forum
Urgent:help about prediction size
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Urgent:help about prediction size
#1
Hi all,
I'm a bit new to pyhton. In my jupyter lab code, I'm working on time series project. The code below doesn't give last 2 prediction from test tes (I should have 2 more prediction as last 2 rows of test set). I cannot find where the problem is although I tried many things. I would really appreciate If you can help and have and idea on it? I attach it as picture as well as the codes below.

start=len(train)
end=len(train)+len(test)-1
pred=model_fit.predict(start=start,end=end,typ='levels').rename('SARIMA predictions')
pred.plot(legend=True)
test['Mindex'].plot(legend=True)
print(pred)

2023-01-01 96.906580
2023-02-01 101.013176
2023-03-01 110.153657
2023-04-01 107.056124
2023-05-01 110.506556
2023-06-01 112.223209
2023-07-01 106.282959
2023-08-01 106.446757
2023-09-01 110.362227
2023-10-01 114.193317
Freq: MS, Name: SARIMA predictions, dtype: float64

Attached Files

Thumbnail(s)
   
Reply
#2
What makes you think you are not getting the last two predictions?
Reply
#3
(Apr-29-2024, 11:36 AM)deanhystad Wrote: What makes you think you are not getting the last two predictions?

In my first post I attached the screenshot. In blue line in plot, there are no last two predicitions. This is important because in othe line I cannot calculate MSE, MAE error rates since no last two predictions.
Reply
#4
When I look at the plot I see two lines with different x axis values. The number of points looks to be the same.
Reply
#5
(Apr-29-2024, 01:04 PM)deanhystad Wrote: When I look at the plot I see two lines with different x axis values. The number of points looks to be the same.

blue line doesn't go paralelly with the orange line although it has to go normally. I dont know what is the problem in the code above.
Reply
#6
You should compare the values returned by model_fit.predict against the values in test['Mindex']. Maybe that will help you identify the problem.

I have no clue. You don't show how you create the model, or even what the model is. I don't know what the relationship is between predicted outputs and test[Mindex]. Is test[Mindex] also values for the first 10 days in January 2023, or is it the first 10 months? You need to provide a lot more info before anyone can help.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Can't make Random Forest Prediction work donnertrud 0 1,671 May-23-2020, 12:26 PM
Last Post: donnertrud
  Prediction of Coal Fire Power Plant Pollutants Emission Dalpi 2 2,221 May-08-2020, 06:28 PM
Last Post: Dalpi
  Linear regression doubt - Urgent kumarants 6 3,196 May-05-2020, 04:11 PM
Last Post: kumarants
  prediction using linear regression (extrapolation?) in a loop karlito 0 3,304 Feb-05-2020, 10:56 AM
Last Post: karlito
  Random Forest high R2 Score but poor prediction donnertrud 5 5,156 Jan-13-2020, 11:23 PM
Last Post: jefsummers

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020