Azure / cortana-intelligence-price-optimization

Retail industry solutions for product price optimization using the Cortana Intelligence Suite with end-to-end walkthrough
82 stars 59 forks source link

Daily forecast vs Weekly Forecast #8

Open ananth3010 opened 6 years ago

ananth3010 commented 6 years ago

Hi

I am using this solution to deploy a POC for the forecasting solution. One of the demand from the customers is to run a daily forecast vs a weekly forecast.

I've made the below changes to the code in the file 'Sales_Data_Agrgregation_2.0_Blob.py file. I do not see the predictions being accurate. Could you please confirm if the changes are accurate?

########################## 2.2 aggregate the sales data and join with store and product attributes

create week_start for df_sales

df_sales_date_min=processed_time_d[0]

##I do not "roll" the daily dates to be identified as a week. I leave the dates as is. df_sales=df_sales.withColumn('week_start',col('date_date')) df_sales=df_sales.groupBy(['week_start','store_id','product_id']).agg({"*": "count"}).withColumnRenamed('count(1)', 'sales')

## join the df_sales with df_price_change, warning: under this scenario, since every week each product in each department in each store has an entry in df_price_change will this accurately reflect the daily prediction?

df_sales=df_sales.join(df_price_change,["week_start","store_id","product_id"],'left_outer') ## join df_sales with df_products and df_stores to get products and stores attributes df_sales=df_sales.join(df_products,["product_id"],"inner").join(df_stores_join,["store_id"],"inner")

lbenassi commented 5 years ago

Hi, sorry you can help me with my issue? https://github.com/Azure/cortana-intelligence-price-optimization/issues/9 Thanks in advance