forecasting

ImportError: cannot import name 'NDArray' from 'numpy.typing' (Prophet)

ImportError: cannot import name 'NDArray' from 'numpy.typing' (Prophet) Question: I have not had as much trouble trying to install any other package in my Python experience than I have with Prophet. Here is a snippet of my code: #Import libraries import pandas as pd from prophet import Prophet #Load data test = pd.read_csv(‘https://raw.githubusercontent.com/facebook/prophet/main/examples/example_wp_log_peyton_manning.csv’) test.head() # …

Total answers: 1

Scikit-Learn Linear Regression using Datetime Values and forecasting

Scikit-Learn Linear Regression using Datetime Values and forecasting Question: Below is a sample of the dataset. row_id datetime energy 1 2008-03-01 00:00:00 1259.985563 2 2008-03-01 01:00:00 1095.541500 3 2008-03-01 02:00:00 1056.247500 4 2008-03-01 03:00:00 1034.742000 5 2008-03-01 04:00:00 1026.334500 The dataset has datetime values and energy consumption for that hour in object and float64 dtypes. …

Total answers: 1

Electricity Price Forecast Naive Benchmark

Electricity Price Forecast Naive Benchmark Question: I have been struggling with making a naive forecast in Python in accordance with the Standard Naive Forecast used in many EPF studies as a benchmark: So the data is below, which is hourly data from 4 different price regions. Note that ‘date’ initially have it’s own column. date …

Total answers: 1

Error in Data frame definition while Multiple TS Stat Forecasting in Python

Error in Data frame definition while Multiple TS Stat Forecasting in Python Question: I was trying to replicate this code for stat forecasting in python, I came across an odd error "name ‘forecasts’ is not defined" which is quite strange as I was able to replicate the code without any errors before. The difference here …

Total answers: 1

Failed to Importing Adida from statsforecast.models in Python

Failed to Importing Adida from statsforecast.models in Python Question: I was trying to replicate this code for stat forecasting in python, I came across the issue of not being able to load this model ‘adida’ form statsforecast library, Here is the link for reference : https://towardsdatascience.com/time-series-forecasting-with-statistical-models-f08dcd1d24d1 import random from itertools import product from IPython.display import …

Total answers: 1

Interpret the results of ADF and KPSS tests

Interpret the results of ADF and KPSS tests Question: I have time series with length (1204) I need to check if the series is stationary or not, so I used statsmodels firstly I used KPSS and this is the result: KPSS Statistic: 0.5599265678349569 p-value: 0.028169691929063764 Critial Values: 10% : 0.347 5% : 0.463 2.5% : …

Total answers: 1

Get integer prediction for regressor models with sklearn

Get integer prediction for regressor models with sklearn Question: I’m using sklearn regressor models to forecast sales by day. However, I want the output to be an integer (because I cannot sell half product) so I’m trying to get the prediction output as an integer, but I cannot find the way. I know I can …

Total answers: 1

How to take confidence interval of statsmodels.tsa.holtwinters-ExponentialSmoothing Models in python?

How to take confidence interval of statsmodels.tsa.holtwinters-ExponentialSmoothing Models in python? Question: I did time series forecasting analysis with ExponentialSmoothing in python. I used statsmodels.tsa.holtwinters. model = ExponentialSmoothing(df, seasonal=’mul’, seasonal_periods=12).fit() pred = model.predict(start=df.index[0], end=122) plt.plot(df_fc.index, df_fc, label=’Train’) plt.plot(pred.index, pred, label=’Holt-Winters’) plt.legend(loc=’best’) I want to take confidence interval of the model result. But I couldn’t find any …

Total answers: 4

Forecast the remaining time of a loop

Forecast the remaining time of a loop Question: Good Evening, I am trying to estimate the remaining time to the end of a loop; I’ve used: start = datetime.now() progress = 0 for i in range(1000): #do a few calculations progress += 1 stop = datetime.now() execution_time = stop-start remaining = execution_time * ( 1000 …

Total answers: 4