https://drive.google.com/file/d/1SrrT1Bgcrmwspo7bkn3fuZRRx1kMi2TC/view?usp=sharing
由於有兩份資料檔案資料較大,因此需另外下載 檔案下載連結
壓縮檔內含「data資料夾」與「data.pkl」,解壓縮直接放在repo的資料夾中即可,如下圖所示:
pip install -r requirements.txt
python Training.py
python DataPre-processing.py
DataPre-processing.py
: 關於資料前處理(包含資料清洗、特徵製作與測試資料處理)的程式碼,運用data資料夾內部的檔案來進行製作,最後把特徵保存到data.pkl
。Training.py
: 模型訓練與競賽預測,預設為Lightgbm
的模型訓練,可以透過更改if __name__ == '__main__'
來更改想要訓練的模型(包含CatBoost
與XGBoost
),訓練結束後會進行競賽預測並且輸出submission.py
,此檔案為競賽預測繳交檔案。data.pkl
: 保存特徵的檔案。submission.csv
: 為競賽最終所繳交的檔案。data
資料夾文件說明sales_train.csv
- the training set. Daily historical data from January 2013 to October 2015.test.csv
- the test set. You need to forecast the sales for these shops and products for November 2015.sample_submission.csv
- a sample submission file in the correct format.items.csv
- supplemental information about the items/products.item_categories.csv
- supplemental information about the items categories.shops.csv
- supplemental information about the shops.
每個月的平均銷售量:
透過刪除離群值讓模型擬合過程更順利
- item_category_id : 商品類別ID
- data_black_num : 時間編號
- shop_id : 商店ID
- Item_id : 商品ID
- city : 每間商店位於的城市
- main_type : 商品的主要類別(例如:遊戲機、配件)
- sub_type : 商品的子類別(例如:PS4、XBOX)
- month : 月份
- year : 年(1或2)
- Item_shop_last_sales : 從商品與商店的組合中找出最後一次銷售的時間
- Item_last_sales : 商品最後一次銷售的時間
- Item_shop_first_sales : 從商品與商店的組合中找出第一次銷售的時間
- Item_first_sales : 商品第一次銷售的時間
採用Kaggle競賽常用的模型,包含XGBoost
、LightGBM
、CatBoost
。
此競賽採用RMSE來做為評分標準