-
Notifications
You must be signed in to change notification settings - Fork 293
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
Add Developments folder via upload #286
base: main
Are you sure you want to change the base?
Conversation
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
View / edit / reply to this conversation on ReviewNB MMenchero commented on 2022-11-09T16:54:13Z Suggested title: How to do an ensemble model for time series forecasting.
StatsForecast allows you to create ensemble models in a very easy way. First we need to import the data that we are going to use, in this case the M4 Dataset. After that, we´ll |
View / edit / reply to this conversation on ReviewNB MMenchero commented on 2022-11-09T16:54:13Z Let's try to summarize the information in a table
|Frequency| Min # observations training set| Forecasting horizon| |Yearly | 13 | 6 | |
View / edit / reply to this conversation on ReviewNB MMenchero commented on 2022-11-09T16:54:14Z Give a brief introduction to this section, saying that we'll now generate the forecasts and the ensemble for every frequency. |
View / edit / reply to this conversation on ReviewNB MMenchero commented on 2022-11-09T16:54:15Z Use overall instead of total. |
View / edit / reply to this conversation on ReviewNB MMenchero commented on 2022-11-09T16:54:16Z Expand the conclusions and add the table comparing our results with the other competitors. Mention the ease of use of StatsForecast for generating multiple models in one go and for creating the ensembles. |
View / edit / reply to this conversation on ReviewNB MMenchero commented on 2022-11-15T07:20:37Z Hay que checar esta tabla. Para el Naive2, se obtuvieron los siguientes valores:
Entonces
OWA = 1/2*( sMAPE_Nixtla/sMAPE_Naive2 + MASE_Nixtla/MASE_Naive2) = 0.841 != 0.853
Tomando los valores del Naive2 de arriba, para el primer lugar de M4 obtenemos
OWA = 1/2*(11.374/13.564+1.536/1.912) = 0.8209
Este es el valor que aparece en la tabla de resultados https://www.sciencedirect.com/science/article/pii/S0169207019301128
Sugiero también agregar a los autores de los métodos ya que hay varias afiliaciones que aparecen como Individual. |
View / edit / reply to this conversation on ReviewNB MMenchero commented on 2022-11-18T06:27:51Z Line #1. # Get trarin dataframe: Typo: Train. Seems to be in other frequencies as well. |
View / edit / reply to this conversation on ReviewNB MMenchero commented on 2022-11-18T06:27:52Z I think we can compute the accuracy of every frequency and model more efficiently since the code for it seems to be the same, just with different names. One way of doing this is with this function. The only argument it takes is the name of the frequency.
def compute_accuracy(freq): """""Computes the accuracy of a given frequency and model""" data = pd.read_csv(freq.lower()+'_df_forecast.csv') data = data.drop(columns=['Unnamed: 0']) # add 'Unnamed: 0.1' if requiered data['ds'] = data.groupby('unique_id')['ds'].transform(lambda data: np.arange(1, len(data) + 1)) data = pd.melt(data, id_vars=['unique_id', 'ds'], var_name='model') data = pd.pivot(data, index=['unique_id', 'model'], columns='ds', values='value').reset_index()
We can call it using compute_accuracy('Yearly')
This should produce the same table as above.
I think the following are good practices to keep in mind: - Keep the variable names as short as possible. - If you need to do a process more than once, write a function for it if possible. |
|
Developments folder contain Ensemble notebook