Auto-Learning Mechanism
- ensemble.py # Ensemble learning framework.
- main.py # main function.
- model.py # candidate model set.
- Optim.py # optimization strategy.
EA Mechanism
- EAmain.py # main function.
- EAmodel.py # EA model.
- EAutils.py # EA utils.
DK SR component
- DKSRmain.py # main function to execute DK and SR.
- DKSRmodels.py # the code of DK and SR.
- DKSRmodel_runner.py # model train and test with parameter assignment.
- DKSRoptimize.py # optimization strategies.
- SAmodel.py # LSTM with attention mechanism.
- coint.py and cointMP.py # co-integration function with mutli-cores.
- utils document # util functions.
- loss ducument # loss functions.
DP component
- Dpcontrollers.py # train and test DP component with parameter assignment.
- DpDataProcessers.py # input data processing.
- DpModels.py # the code of dot processing.
- DpOptimizers # optimization strategies of DP.
- DpUtils.py # util functions of DP component.
Data acquisition module.
- Code path:-FastAuto-Learning/spider/jd.py.
- Function: Crawl Jingdong e-commerce page on the commodity information
- Output: Commodity pictures, titles and other information on the e-commerce platform
- Modify paths: (1)Line 18 : csv_file = "./jd.csv" ,Specifies the address to save the text content (2)Line 101:pname = product['name'].replace("\t","").replace(" ",""),Specify the location to save the image content
- Run: python jd.py
Data pre-process
- Code path:-FastAuto-Learning/process_data/fencang.py
- Input: Historical sales data
- Output: Sales data after warehouse division processing
- Modify paths: (1)Line 22 : with open("../galanz_data.json", 'r', encoding='utf-8') as f1:,指定读入的历史销量数据 (2)line31: filename='../fencang/'+warehouse+'.json',指定输出路径
- run: python fencang.py
Get Picture Feature
- Code path:-FastAuto-Learning/process_data/picture_feature.py
- Function: Get figure embedding accroding to towhee
- Input: Figure
- Output: Figure embedding
- run:trans_SelectBasic_new_1.py call this function
Get Text Feature
- Code path:-FastAuto-Learning/process_data/text_feature.py
- Function: Get text embedding accroding to towhee
- Input: Text
- Output: Text embedding
- run:trans_SelectBasic_new_1.py call this function
Feature engineering
- Code path:-FastAuto-Learning/process_data/trans_SelectBasic_new_1.py
- Function: Generate a script for sorting warehouse features after cleaning, normalization, and feature screening
- Input:Historical inventory data, pictures, text features
- Output: Feature file
- Modify paths (1)Line 29 : inputDir = '/data1/lxt/Galanz-TimeSeries/gfy/fencang_selected/',Enter historical inventory information (2)Line 32:inputDir = '/data1/lxt/Galanz-TimeSeries/gfy/fencang_selected/',Specifies the save address for the feature file
- run: python trans_SelectBasic_new_1.py
Time series tensor
- Code path:-FastAuto-Learning/src/Time-Series-Tensor/models/change_tensor.py -
- Function: Gets a tensor representation of a historical time series
- Input: Time series of historical sales of products
- Output: Time series tensor
- Modify paths (1)Line128: data = '../galanz/0e117c1684b5ebd6093fc17b468455d1.json',Specifies the historical sales data entry path (2)Line191:df.to_csv("./time_tensor.csv"), Specifies the tensor output path
- Run: python change_tensor.py
Ensemble
- Code path:-FastAuto-Learning/src/ensemble.py
- Input: Feature File
- Output: Future sales forecast
- Modify paths: (1)Line 44: Input_future_folder = '/data/gfy2021/gfy/KDD/process_data/fencang_feature_selected_normal_for_1214_1227_text+pic/',Specifies the signature file input path (2)Line 52:Output_future_folder = '/data/gfy2021/gfy/KDD/stacking/stacking_result/ result_future_sim_0.75/' 指定预测结果输出路径
- Run: python ensemble.py
STL COST
- Code path:-FastAuto-Learning/src/changeCSV_for_compare.py
- Function:According to the sales volume predicted by the model, the inventory cost caused by replenishing with the predicted value of the model is calculated
- Input: Model prediction result
- Output: Inventory costing results (STL COST)
- Modify path: (1)Line 11: raw_test_result = '/data1/lxt/galanz_test/stacking/FeatureResult /result_'+date_+'/',Specifies the prediction result file path (2)Line 29:ALL_result_file_future = '/data1/lxt/galanz_test/stacking/allResult /ALL_future_'+date_+'成本.csv',Specify an output path for the costing results
- Run: python changeCSV_for_compare.py