Answers.Body: <p>If you have sold only once or very few items you will need some prior input (domain knowledge). One term for search is <em>intermittent time series</em>. <a href="https://stats.stackexchange.com/search?q=forecast+intermittent+sales">Here is a stored search</a>.</p>
  <p>When you have many time series, related, and interest in both totals and single series, that is called <em>hierarchical forecasting</em>.  <a href="https://robjhyndman.com/publications/hierarchical-forecasting/" rel="nofollow noreferrer">One expert is here</a> (the author of that blog was the founder of sister site Cross Validated).</p>
  <p>With time series forecasting it is often difficult to beat simple methods,  see <a href="https://stats.stackexchange.com/questions/135061/best-method-for-short-time-series/135146#135146">https://stats.stackexchange.com/questions/135061/best-method-for-short-time-series/135146#135146</a></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-02-03T00:50:35.450Z
Answers.LastActivityDate: 2021-02-03T00:50:35.450Z
Answers.UserDisplayName: kjetil b halvorsen
Body: <ul>
  <li>PROJECT: I am working on an e-commerce site where digital products can run out so there is need to reorder them 72h before they run out (reordering them sooner is not a problem but having notification a bit later so if the product would sell better that would be a problem because we cannot reorder products in time).</li>
  <li>GOAL: is to know if products run out at least 72h earlier.</li>
  <li>DATA COLUMNS: sales datetime, product id, current number of products, price of product, what currency it was purchased in, other data like profit currency was used for the purchase…</li>
  <li>SIZE: Before grouping I have a few millions of rows after grouping hundreds of thousands so it is a lot of data point but DASK can handle them.</li>
  <li>GRUPPING COLUMNS: I have grouped the data by PURCAHSEDATE &amp; ID so each day has the product that were sold with all its feature. Features have been aggregated mostly buy summing (profit, expenses) and mean (percentage features like margin%)</li>
  <li>HOW FAR I HAVE GONE WITH THE PROECJT: I have looked up a couple of Kaggle projects online that were focused on use <a href="https://www.kaggle.com/tejasrinivas/simple-xgb-starter" rel="nofollow noreferrer">https://www.kaggle.com/tejasrinivas/simple-xgb-starter</a></li>
  <li>PROBLEMS: A.) Some product has been sold in the past but they are selling out in 1-2 days so it is hard to put trendline on it. B.) Some item just has 1-2 days of data because it just started to sell a few days ago. C.) I also have data of products that have been sold a lot for a mid or long run (hundreds of days thousands of times). So I could do time series modelling on the whole of the sales but for each individual item I don't always have data on it</li>
  <li>CURRENT RESULTS: I have used XGBOSOT Regression like It predicts well number of products sales after the days is over with all the features, but that is not the goal  - <a href="https://www.kaggle.com/tejasrinivas/simple-xgb-starter" rel="nofollow noreferrer">https://www.kaggle.com/tejasrinivas/simple-xgb-starter</a></li>
  <li>PROJECT RECOMMEND:I am trying to use the following pick ideas from the following competitions: <a href="https://www.kaggle.com/c/demand-forecasting-kernels-only/notebooks?competitionId=9999&amp;sortBy=voteCount" rel="nofollow noreferrer">https://www.kaggle.com/c/demand-forecasting-kernels-only/notebooks?competitionId=9999&amp;sortBy=voteCount</a>  ,  <a href="https://www.kaggle.com/c/competitive-data-science-predict-future-sales/code" rel="nofollow noreferrer">https://www.kaggle.com/c/competitive-data-science-predict-future-sales/code</a></li>
  <li>GOAL: simple and easy solution, not LSTM or something complicated but something quick and easy (like xgboost regression so if I have more data I can use rapids.ai to GPU teach it) to implement because as I said it is not a problem if it is missing on the time frame on the positive side and the item gets reordered 96h early and not 72h early. I am guessing that somehow, I should shift the dates but as I said in many case items have not enough dates to shift their sales date.</li>
  </ul>
  
Tags: <python><time-series><regression>
Title: What model to use to get a robust model to predict next 3 days of sales even for products that have just sold once ever?
UserDisplayName: sogu
ThreadText: # What model to use to get a robust model to predict next 3 days of sales even for products that have just sold once ever?
  
  (Asked by: username_0 on 2021-02-01)
  
  * PROJECT: I am working on an e-commerce site where digital products can run out so there is need to reorder them 72h before they run out (reordering them sooner is not a problem but having notification a bit later so if the product would sell better that would be a problem because we cannot reorder products in time).
  * GOAL: is to know if products run out at least 72h earlier.
  * DATA COLUMNS: sales datetime, product id, current number of products, price of product, what currency it was purchased in, other data like profit currency was used for the purchase…
  * SIZE: Before grouping I have a few millions of rows after grouping hundreds of thousands so it is a lot of data point but DASK can handle them.
  * GRUPPING COLUMNS: I have grouped the data by PURCAHSEDATE & ID so each day has the product that were sold with all its feature. Features have been aggregated mostly buy summing (profit, expenses) and mean (percentage features like margin%)
  * HOW FAR I HAVE GONE WITH THE PROECJT: I have looked up a couple of Kaggle projects online that were focused on use <https://www.kaggle.com/tejasrinivas/simple-xgb-starter>
  * PROBLEMS: A.) Some product has been sold in the past but they are selling out in 1-2 days so it is hard to put trendline on it. B.) Some item just has 1-2 days of data because it just started to sell a few days ago. C.) I also have data of products that have been sold a lot for a mid or long run (hundreds of days thousands of times). So I could do time series modelling on the whole of the sales but for each individual item I don't always have data on it
  * CURRENT RESULTS: I have used XGBOSOT Regression like It predicts well number of products sales after the days is over with all the features, but that is not the goal - <https://www.kaggle.com/tejasrinivas/simple-xgb-starter>
  * PROJECT RECOMMEND:I am trying to use the following pick ideas from the following competitions: <https://www.kaggle.com/c/demand-forecasting-kernels-only/notebooks?competitionId=9999&sortBy=voteCount> , <https://www.kaggle.com/c/competitive-data-science-predict-future-sales/code>
  * GOAL: simple and easy solution, not LSTM or something complicated but something quick and easy (like xgboost regression so if I have more data I can use rapids.ai to GPU teach it) to implement because as I said it is not a problem if it is missing on the time frame on the positive side and the item gets reordered 96h early and not 72h early. I am guessing that somehow, I should shift the dates but as I said in many case items have not enough dates to shift their sales date.
  
  **Tags:** python, time-series, regression
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2021-02-03. Score: 0 | Accepted answer
  
  If you have sold only once or very few items you will need some prior input (domain knowledge). One term for search is *intermittent time series*. [Here is a stored search](https://stats.stackexchange.com/search?q=forecast+intermittent+sales).
  
  When you have many time series, related, and interest in both totals and single series, that is called *hierarchical forecasting*. [One expert is here](https://robjhyndman.com/publications/hierarchical-forecasting/) (the author of that blog was the founder of sister site Cross Validated).
  
  With time series forecasting it is often difficult to beat simple methods, see <https://stats.stackexchange.com/questions/135061/best-method-for-short-time-series/135146#135146>
  
  
  ---
  
  