Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.

XGBoost Regression

Ivaturi_Vighnesh
7 - Meteor

Hi Everyone, Can Someone guide me how to use Xgboost regression for time series data?

10 REPLIES 10
CharlieS
17 - Castor
17 - Castor

The general sentiment is that XGBoost isn't meant for time series applications. It can be done, but would require transformation/modification of the input data and procedures.

Is there a reason why you're looking to boosted models instead of the time series tools available in Alteryx? 

 

Ivaturi_Vighnesh
7 - Meteor

Hi @CharlieS  Reason behind using Boosting model is Time series tools in Alteryx is not customizable for the data i have.

CharlieS
17 - Castor
17 - Castor

Could you tell/show/share more about your current data? A sample would be best if you can share that (even with dummy data). 

This sounds like an opportunity to transform the data for analysis. I think that's a better path to take rather than forcing the current data into alternative modeling methods. 

Ivaturi_Vighnesh
7 - Meteor

Hi @CharlieS  The sample data consists of 3 years(2018 to 2020) historical data of 6 customers with 12 months per year per customer. Need to forecast cost amount for 2021 for every customer for every month

LiuZhang
9 - Comet

workflowworkflow0's0's

 

You can download TS Model Factory tool to answer your question, it does a group by TS model.

 

I assume in practice you will use all three years of data to feed the model rather than using average, otherwise you won't have enough rows, so I created some dummy values to pad out the data you supplied.

Though I would be much more concerned about the 0 in the data, they would significantly impact your model. If there is only a few rows missing, you can estimate them, but there are too many dates missing, then you need find additional data or may need to drop some ID.

Ivaturi_Vighnesh
7 - Meteor

Hi @LiuZhang Thanks for the workflow. I've gone through it and found that the forecast is having a constant value for most of the IDs throughout the year. Why is it like that?

CharlieS
17 - Castor
17 - Castor

@Ivaturi_Vighnesh wrote:

Hi @LiuZhang Thanks for the workflow. I've gone through it and found that the forecast is having a constant value for most of the IDs throughout the year. Why is it like that?


The default settings of the ARIMA tools is to use the most recent value as the forecast the future values (which is called the naïve method).  Now that the tool is working, it is up to the user to configure the model for the particular scenario based on the available data and desired hypothesis testing. The model customization settings allow the user to adjust parameters like differencing, seasonality, drift, and many more. 

 

Here's a link to the suggested handbook for time series modeling:

https://otexts.com/fpp2/

 

 

LiuZhang
9 - Comet

In the model, it is chosen ETS, which if there is not too much fluctuation in the data, It is likely to return the constant model, i.e. no trend, no seasonality.

 

You can build individual ETS model to see.

Screenshot 2022-04-26 165843.png

In this case, A, N, N stands for Additive for error (i.e. flat), None for trend, None for Seasonal, hence it produced constant as best model.

Ivaturi_Vighnesh
7 - Meteor

But i need different predictions for all the months. Constant value doesn't help my project. Is there any other way?

Labels