Alteryx Designer Discussions

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

How to Building Prediction model

whiran
8 - Asteroid

ABC Cookies is a well-known cookie company having distribution all part of the country. They have 20 territories and each territory is having more than 2 towns. Some products issue  as bonus quantity without invoice quantity. Customers could return goods if they not satisfy with the product. At that time, they have to return both invoiced and bonus quantity that they have received.     The company used to store most of the records of the invoice and return notes.  In the data base they have stored following information on movement of quantities. They want to predict the quantity for each town for certain period with minimum of 80% accuracy.

 

Column

 Description

Ter_Code

 There are more than 20 territories but here we consider only one territory

Town_Code

 Each territory has 2 or more towns

St_Ter

 Stock territory is each stock code pertaining to each territory

Cus_Order_Ref

 

Each customer can place many orders

Order_num

 Every order has unique order number

Inv_Date

 Date of invoice

Ret_Code

 Retailer code used to track retailer details

ExecutiveCode

 In charger code

Prod_Code

 Product cod is unique for each product

Prod_SK

 Product SK

Inv_Qty

 Total quantity

Bonus_Qty

 Bonus quantity

Ret_Qty

Return quantity

Ret_Bonus_Qty

 Return Bonus quantity

 

Training dataset consist of data 2018/2019 and validating data consist only 2020 data. We should be couscous when validate data for certain period. I suggest to take Jan – Feb data for validation as we had to face global pandemic period thereafter.

 

Please check how Alteryx help to  achieve this as It's more towards ML based model.

12 REPLIES 12
atcodedog05
18 - Pollux

Hi @whiran 

 

I could build you a model.

 

But i feel it will help you better if you go through it.

https://community.alteryx.com/t5/Interactive-Lessons/tkb-p/interactive-lessons/label-name/Predictive...

 

Hope this helps : )

 

If this helps please mark the post as solution.

 

 

 

 

 

 

mceleavey
16 - Nebula

Hi @whiran ,

 

I second what @atcodedog05 says, as there are a lot of factors that you will need to consider. One thing I would say is that you will need to encode your categorical variables, and you will need to isolate and format your time variables.

You are looking to extrapolate figures over a time element, and so I would probably point you in the direction of the Time Series models.

 

I've attached my One-Hot Encoding tool which will help you with the encoding part.

 

M.

whiran
8 - Asteroid

@atcodedog05 , @mceleavey 

thanks for your replies. 

atcodedog05
18 - Pollux

Hi @whiran 

 

If it helped you don't forget to mark it as solution so it can be findable by others.

 

Go through the content if you get stuck anywhere will always be help

 

All the best

Happy Analysing : )

whiran
8 - Asteroid

Some of community members are keep on trying on this question. So, shall I wait couple of days to mark the solution. 

atcodedog05
18 - Pollux

Sure @whiran 

 

@ImadZidan any inputs from your end

ImadZidan
12 - Quasar

Hello @whiran ,

 

Thank you @atcodedog05  for including me.

 

Looking at the data, my take on it is as follows:

 

1- data does not have many features for prediction purposes, however, I agree with @mceleavey, it looks like it is more of a date/period driven dataset.

2- What can be done is to derive a a trend and a forecast on the target field (Quantity)

 

Now some questions that needs answering please @whiran 

 

If I understand the data correctly:

 

1- you have an INV and RTN Doc type, I guess in this case you will use the RTN type to join to the INV to get the correct quantity, am I correct? In this case the actual quantity would be quantity - RTN quantity.

 

2- I notice some dates are missing, will it be ok to fill those dates with zero values. Other options would be filling with previous day values. 

 

If we agree on those conditions, the model would look  to produce a forecast quantity value per town for a given number of days or if you want it monthly or quarterly, data will need to be aggregated accordingly.

 

Please let me know what you think.

 

 

whiran
8 - Asteroid

HI @ImadZidan 

 

Thanks for your prompt reply. 

 

1- you have an INV and RTN Doc type, I guess in this case you will use the RTN type to join to the INV to get the correct quantity, am I correct? In this case the actual quantity would be quantity - RTN quantity.

Ans : Your approach is correct and acceptable

 

2- I notice some dates are missing, will it be ok to fill those dates with zero values. Other options would be filling with previous day values. 

AnsFilling with previous day values (If we impute zeros , training model might go wrong. When we do the validation this can be observed)

whiran
8 - Asteroid

@ImadZidan 

 

Make sure to remove outliers in the training dataset as it may ruin the model.

Labels