datupapi 1.115.2__tar.gz → 1.116.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {datupapi-1.115.2 → datupapi-1.116.0}/PKG-INFO +43 -50
- {datupapi-1.115.2 → datupapi-1.116.0}/datupapi/configure/config.py +93 -93
- {datupapi-1.115.2 → datupapi-1.116.0}/datupapi/distribution/src/DistributionFunctions/functions_distribution.py +249 -249
- {datupapi-1.115.2 → datupapi-1.116.0}/datupapi/distribution/src/Format/distribution_format.py +97 -97
- {datupapi-1.115.2 → datupapi-1.116.0}/datupapi/evaluate/anomaly.py +631 -631
- {datupapi-1.115.2 → datupapi-1.116.0}/datupapi/evaluate/errors.py +271 -271
- {datupapi-1.115.2 → datupapi-1.116.0}/datupapi/extract/io.py +1617 -1617
- {datupapi-1.115.2 → datupapi-1.116.0}/datupapi/extract/io_citrix.py +235 -235
- {datupapi-1.115.2 → datupapi-1.116.0}/datupapi/extract/io_opt.py +2014 -2014
- {datupapi-1.115.2 → datupapi-1.116.0}/datupapi/feateng/relation.py +178 -178
- {datupapi-1.115.2 → datupapi-1.116.0}/datupapi/feateng/scale.py +109 -109
- {datupapi-1.115.2 → datupapi-1.116.0}/datupapi/inventory/src/DailyUsage/daily_usage.py +225 -225
- {datupapi-1.115.2 → datupapi-1.116.0}/datupapi/inventory/src/Format/inventory_format.py +159 -159
- {datupapi-1.115.2 → datupapi-1.116.0}/datupapi/inventory/src/FutureInventory/daily_usage_future.py +92 -92
- {datupapi-1.115.2 → datupapi-1.116.0}/datupapi/inventory/src/FutureInventory/future_reorder.py +1664 -1664
- {datupapi-1.115.2 → datupapi-1.116.0}/datupapi/inventory/src/InventoryFunctions/functions_inventory.py +323 -323
- {datupapi-1.115.2 → datupapi-1.116.0}/datupapi/inventory/src/ProcessForecast/define_periods.py +210 -210
- {datupapi-1.115.2 → datupapi-1.116.0}/datupapi/inventory/src/ProcessForecast/extract_forecast.py +131 -131
- {datupapi-1.115.2 → datupapi-1.116.0}/datupapi/inventory/src/SuggestedForecast/suggested_forecast.py +243 -243
- {datupapi-1.115.2 → datupapi-1.116.0}/datupapi/inventory/src/Transformation/inventory_transformation.py +31 -31
- {datupapi-1.115.2 → datupapi-1.116.0}/datupapi/predict/forecast.py +573 -573
- {datupapi-1.115.2 → datupapi-1.116.0}/datupapi/prepare/cleanse.py +62 -62
- {datupapi-1.115.2 → datupapi-1.116.0}/datupapi/prepare/format.py +478 -478
- {datupapi-1.115.2 → datupapi-1.116.0}/datupapi/prepare/format_dask.py +96 -96
- {datupapi-1.115.2 → datupapi-1.116.0}/datupapi/prepare/format_opt.py +399 -399
- {datupapi-1.115.2 → datupapi-1.116.0}/datupapi/training/attup.py +514 -514
- {datupapi-1.115.2 → datupapi-1.116.0}/datupapi/training/deepar.py +669 -669
- {datupapi-1.115.2 → datupapi-1.116.0}/datupapi/training/tft.py +1049 -622
- {datupapi-1.115.2 → datupapi-1.116.0}/datupapi/transform/backtesting.py +356 -356
- {datupapi-1.115.2 → datupapi-1.116.0}/datupapi/transform/forecasting.py +860 -860
- {datupapi-1.115.2 → datupapi-1.116.0}/datupapi/transform/ranking.py +170 -170
- {datupapi-1.115.2 → datupapi-1.116.0}/datupapi/utils/utils.py +112 -112
- {datupapi-1.115.2 → datupapi-1.116.0}/datupapi.egg-info/PKG-INFO +43 -50
- {datupapi-1.115.2 → datupapi-1.116.0}/pyproject.toml +3 -3
- {datupapi-1.115.2 → datupapi-1.116.0}/setup.cfg +4 -4
- {datupapi-1.115.2 → datupapi-1.116.0}/setup.py +75 -75
- {datupapi-1.115.2 → datupapi-1.116.0}/datupapi/__init__.py +0 -0
- {datupapi-1.115.2 → datupapi-1.116.0}/datupapi/configure/__init__.py +0 -0
- {datupapi-1.115.2 → datupapi-1.116.0}/datupapi/distribution/conf/__init__.py +0 -0
- {datupapi-1.115.2 → datupapi-1.116.0}/datupapi/distribution/src/DistributionFunctions/__init__.py +0 -0
- {datupapi-1.115.2 → datupapi-1.116.0}/datupapi/distribution/src/Format/__init__.py +0 -0
- {datupapi-1.115.2 → datupapi-1.116.0}/datupapi/evaluate/__init__.py +0 -0
- {datupapi-1.115.2 → datupapi-1.116.0}/datupapi/extract/__init__.py +0 -0
- {datupapi-1.115.2 → datupapi-1.116.0}/datupapi/feateng/__init__.py +0 -0
- {datupapi-1.115.2 → datupapi-1.116.0}/datupapi/inventory/conf/__init__.py +0 -0
- {datupapi-1.115.2 → datupapi-1.116.0}/datupapi/inventory/src/DailyUsage/__init__.py +0 -0
- {datupapi-1.115.2 → datupapi-1.116.0}/datupapi/inventory/src/Format/__init__.py +0 -0
- {datupapi-1.115.2 → datupapi-1.116.0}/datupapi/inventory/src/FutureInventory/__init__.py +0 -0
- {datupapi-1.115.2 → datupapi-1.116.0}/datupapi/inventory/src/InventoryFunctions/__init__.py +0 -0
- {datupapi-1.115.2 → datupapi-1.116.0}/datupapi/inventory/src/ProcessForecast/__init__.py +0 -0
- {datupapi-1.115.2 → datupapi-1.116.0}/datupapi/inventory/src/SuggestedForecast/__init__.py +0 -0
- {datupapi-1.115.2 → datupapi-1.116.0}/datupapi/inventory/src/Transformation/__init__.py +0 -0
- {datupapi-1.115.2 → datupapi-1.116.0}/datupapi/predict/__init__.py +0 -0
- {datupapi-1.115.2 → datupapi-1.116.0}/datupapi/prepare/__init__.py +0 -0
- {datupapi-1.115.2 → datupapi-1.116.0}/datupapi/training/__init__.py +0 -0
- {datupapi-1.115.2 → datupapi-1.116.0}/datupapi/transform/__init__.py +0 -0
- {datupapi-1.115.2 → datupapi-1.116.0}/datupapi/utils/__init__.py +0 -0
- {datupapi-1.115.2 → datupapi-1.116.0}/datupapi.egg-info/SOURCES.txt +0 -0
- {datupapi-1.115.2 → datupapi-1.116.0}/datupapi.egg-info/dependency_links.txt +0 -0
- {datupapi-1.115.2 → datupapi-1.116.0}/datupapi.egg-info/requires.txt +0 -0
- {datupapi-1.115.2 → datupapi-1.116.0}/datupapi.egg-info/top_level.txt +0 -0
|
@@ -1,50 +1,43 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
2
|
-
Name: datupapi
|
|
3
|
-
Version: 1.
|
|
4
|
-
Summary: Utility library to support Datup AI MLOps processes
|
|
5
|
-
Author: Datup AI
|
|
6
|
-
Author-email: ramiro@datup.ai
|
|
7
|
-
Description-Content-Type: text/markdown
|
|
8
|
-
Requires-Dist: s3fs<2026.0.0,>=2024.6.1
|
|
9
|
-
Requires-Dist: aiobotocore[boto3]<3.0.0,>=2.5.4
|
|
10
|
-
Requires-Dist: boto3<2.0.0,>=1.33.13
|
|
11
|
-
Requires-Dist: botocore<2.0.0,>=1.33.13
|
|
12
|
-
Requires-Dist: beautifulsoup4>=4.9.3
|
|
13
|
-
Requires-Dist: catboost>=1.0.4
|
|
14
|
-
Requires-Dist: datetime>=4.3
|
|
15
|
-
Requires-Dist: google-cloud-bigquery>=2.34.2
|
|
16
|
-
Requires-Dist: google-cloud-storage>=2.1.0
|
|
17
|
-
Requires-Dist: hdbcli>=2.17.22
|
|
18
|
-
Requires-Dist: lxml>=4.9.2
|
|
19
|
-
Requires-Dist: mysql-connector-python>=8.0.24
|
|
20
|
-
Requires-Dist: numpy>=2.0.0
|
|
21
|
-
Requires-Dist: openpyxl>=3.0.6
|
|
22
|
-
Requires-Dist: pandas>=2.2.2
|
|
23
|
-
Requires-Dist: pulp>=2.7.0
|
|
24
|
-
Requires-Dist: pyarrow>=10.0.1
|
|
25
|
-
Requires-Dist: pymssql>=2.2.7
|
|
26
|
-
Requires-Dist: pymysql>=1.0.2
|
|
27
|
-
Requires-Dist: pyod>=2.0.2
|
|
28
|
-
Requires-Dist: pytest>=6.2.1
|
|
29
|
-
Requires-Dist: python-dateutil>=2.8.2
|
|
30
|
-
Requires-Dist: pyyaml>=5.3.1
|
|
31
|
-
Requires-Dist: requests>=2.25.1
|
|
32
|
-
Requires-Dist: scikit-learn>=0.24.1
|
|
33
|
-
Requires-Dist: shap>=0.40.0
|
|
34
|
-
Requires-Dist: SQLAlchemy>=1.3.22
|
|
35
|
-
Requires-Dist: sqlalchemy-hana>=0.5.0
|
|
36
|
-
Requires-Dist: unidecode>=1.1.2
|
|
37
|
-
Requires-Dist: xlrd>=1.0.0
|
|
38
|
-
Requires-Dist: fuzzywuzzy>=0.18.0
|
|
39
|
-
Requires-Dist: statsmodels>=0.13.2
|
|
40
|
-
Provides-Extra: dev
|
|
41
|
-
Requires-Dist: pytest>=6.2.1; extra == "dev"
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
Dynamic: description
|
|
45
|
-
Dynamic: description-content-type
|
|
46
|
-
Dynamic: provides-extra
|
|
47
|
-
Dynamic: requires-dist
|
|
48
|
-
Dynamic: summary
|
|
49
|
-
|
|
50
|
-
foo bar baz
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: datupapi
|
|
3
|
+
Version: 1.116.0
|
|
4
|
+
Summary: Utility library to support Datup AI MLOps processes
|
|
5
|
+
Author: Datup AI
|
|
6
|
+
Author-email: ramiro@datup.ai
|
|
7
|
+
Description-Content-Type: text/markdown
|
|
8
|
+
Requires-Dist: s3fs<2026.0.0,>=2024.6.1
|
|
9
|
+
Requires-Dist: aiobotocore[boto3]<3.0.0,>=2.5.4
|
|
10
|
+
Requires-Dist: boto3<2.0.0,>=1.33.13
|
|
11
|
+
Requires-Dist: botocore<2.0.0,>=1.33.13
|
|
12
|
+
Requires-Dist: beautifulsoup4>=4.9.3
|
|
13
|
+
Requires-Dist: catboost>=1.0.4
|
|
14
|
+
Requires-Dist: datetime>=4.3
|
|
15
|
+
Requires-Dist: google-cloud-bigquery>=2.34.2
|
|
16
|
+
Requires-Dist: google-cloud-storage>=2.1.0
|
|
17
|
+
Requires-Dist: hdbcli>=2.17.22
|
|
18
|
+
Requires-Dist: lxml>=4.9.2
|
|
19
|
+
Requires-Dist: mysql-connector-python>=8.0.24
|
|
20
|
+
Requires-Dist: numpy>=2.0.0
|
|
21
|
+
Requires-Dist: openpyxl>=3.0.6
|
|
22
|
+
Requires-Dist: pandas>=2.2.2
|
|
23
|
+
Requires-Dist: pulp>=2.7.0
|
|
24
|
+
Requires-Dist: pyarrow>=10.0.1
|
|
25
|
+
Requires-Dist: pymssql>=2.2.7
|
|
26
|
+
Requires-Dist: pymysql>=1.0.2
|
|
27
|
+
Requires-Dist: pyod>=2.0.2
|
|
28
|
+
Requires-Dist: pytest>=6.2.1
|
|
29
|
+
Requires-Dist: python-dateutil>=2.8.2
|
|
30
|
+
Requires-Dist: pyyaml>=5.3.1
|
|
31
|
+
Requires-Dist: requests>=2.25.1
|
|
32
|
+
Requires-Dist: scikit-learn>=0.24.1
|
|
33
|
+
Requires-Dist: shap>=0.40.0
|
|
34
|
+
Requires-Dist: SQLAlchemy>=1.3.22
|
|
35
|
+
Requires-Dist: sqlalchemy-hana>=0.5.0
|
|
36
|
+
Requires-Dist: unidecode>=1.1.2
|
|
37
|
+
Requires-Dist: xlrd>=1.0.0
|
|
38
|
+
Requires-Dist: fuzzywuzzy>=0.18.0
|
|
39
|
+
Requires-Dist: statsmodels>=0.13.2
|
|
40
|
+
Provides-Extra: dev
|
|
41
|
+
Requires-Dist: pytest>=6.2.1; extra == "dev"
|
|
42
|
+
|
|
43
|
+
foo bar baz
|
|
@@ -1,94 +1,94 @@
|
|
|
1
|
-
import logging
|
|
2
|
-
import os
|
|
3
|
-
import yaml
|
|
4
|
-
|
|
5
|
-
from datetime import date, datetime, timedelta
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
class Config():
|
|
9
|
-
|
|
10
|
-
LOCAL_PATH = '/tmp'
|
|
11
|
-
|
|
12
|
-
def __init__(self, config_file=None, logfile=None):
|
|
13
|
-
try:
|
|
14
|
-
#Initialize config parameters
|
|
15
|
-
with open(config_file) as file:
|
|
16
|
-
params = yaml.full_load(file)
|
|
17
|
-
self.access_key = params.get('aws_access_key')
|
|
18
|
-
self.secret_key = params.get('aws_secret_key')
|
|
19
|
-
self.region = params.get('aws_region')
|
|
20
|
-
self.sql_database = params.get('sql_database')
|
|
21
|
-
self.forecast_role = params.get('forecast_role')
|
|
22
|
-
# Initialize Prepare training parameters
|
|
23
|
-
self.dataset_orig_cols = params.get('prepare')[0].get('dataset_orig_cols')
|
|
24
|
-
self.items_metadata = params.get('prepare')[1].get('items_metadata')
|
|
25
|
-
# Initialize Paths parameters
|
|
26
|
-
self.tenant_id = params.get('paths')[0].get('tenant_id')
|
|
27
|
-
self.datalake = params.get('paths')[1].get('datalake')
|
|
28
|
-
self.config_path = params.get('paths')[2].get('config_path')
|
|
29
|
-
self.response_path = params.get('paths')[3].get('response_path')
|
|
30
|
-
self.dataset_import_path = params.get('paths')[4].get('dataset_import_path')
|
|
31
|
-
self.backtest_export_path = params.get('paths')[5].get('backtest_export_path')
|
|
32
|
-
self.forecast_export_path = params.get('paths')[6].get('forecast_export_path')
|
|
33
|
-
self.results_path = params.get('paths')[7].get('results_path')
|
|
34
|
-
self.multiforecast_path = params.get('paths')[8].get('multiforecast_path')
|
|
35
|
-
self.sftp_export = params.get('paths')[9].get('sftp_export')
|
|
36
|
-
# Initialize Training parameters
|
|
37
|
-
self.dataset_frequency = params.get('training')[0].get('dataset_frequency')
|
|
38
|
-
self.forecast_types = params.get('training')[1].get('forecast_types')
|
|
39
|
-
self.forecast_horizon = params.get('training')[2].get('forecast_horizon')
|
|
40
|
-
self.input_window = params.get('training')[3].get('input_window')
|
|
41
|
-
self.backtests = params.get('training')[4].get('backtests')
|
|
42
|
-
self.backtest_ids = params.get('training')[5].get('backtest_ids')[:self.backtests]
|
|
43
|
-
self.use_location = params.get('training')[6].get('use_location')
|
|
44
|
-
self.normalization = params.get('training')[7].get('normalization')
|
|
45
|
-
self.dropout_train = params.get('training')[8].get('dropout_train')
|
|
46
|
-
# Initialize DeepAR training parameters
|
|
47
|
-
self.epochs = params.get('deepar')[0].get('epochs')
|
|
48
|
-
self.neurons = params.get('deepar')[1].get('neurons')
|
|
49
|
-
self.hidden_layers = params.get('deepar')[2].get('hidden_layers')
|
|
50
|
-
self.backtest_horizon = params.get('deepar')[3].get('backtest_horizon')
|
|
51
|
-
self.use_automl = params.get('deepar')[4].get('use_automl')
|
|
52
|
-
# Initialize Attention model training parameters
|
|
53
|
-
self.epochs_attup = params.get('attup')[0].get('epochs_attup')
|
|
54
|
-
self.save_last_epoch = params.get('attup')[1].get('save_last_epoch')
|
|
55
|
-
self.lr = params.get('attup')[2].get('lr')
|
|
56
|
-
self.units = params.get('attup')[3].get('units')
|
|
57
|
-
self.batch_size = params.get('attup')[4].get('batch_size')
|
|
58
|
-
self.n_iter = params.get('attup')[5].get('n_iter')
|
|
59
|
-
self.momentum = params.get('attup')[6].get('momentum')
|
|
60
|
-
self.lrS = params.get('attup')[7].get('lrS')
|
|
61
|
-
# Initialize TFT
|
|
62
|
-
self.epochs_tft = params.get('tft')[0].get('epochs_tft')
|
|
63
|
-
self.gradient_clip_val = params.get('tft')[1].get('gradient_clip_val')
|
|
64
|
-
self.lr_tft = params.get('tft')[2].get('lr_tft')
|
|
65
|
-
self.lstm_layers = params.get('tft')[3].get('lstm_layers')
|
|
66
|
-
self.hidden_size = params.get('tft')[4].get('hidden_size')
|
|
67
|
-
self.attention_head_size = params.get('tft')[5].get('attention_head_size')
|
|
68
|
-
self.hidden_continuous_size = params.get('tft')[6].get('hidden_continuous_size')
|
|
69
|
-
self.n_iter_tft = params.get('tft')[7].get('n_iter_tft')
|
|
70
|
-
self.batch_size_tft = params.get('tft')[8].get('batch_size_tft')
|
|
71
|
-
# Initialize Importance parameters
|
|
72
|
-
self.sku_impct = params.get('importance')[0].get('sku_impct')
|
|
73
|
-
self.items_simulation= params.get('importance')[1].get('items_simulation')
|
|
74
|
-
# Initialize Transform parameters
|
|
75
|
-
self.abc_threshold = params.get('transform')[0].get('abc_threshold')
|
|
76
|
-
self.fsn_threshold = params.get('transform')[1].get('fsn_threshold')
|
|
77
|
-
self.xyz_threshold = params.get('transform')[2].get('xyz_threshold')
|
|
78
|
-
self.export_item_ranking = params.get('transform')[3].get('export_item_ranking')
|
|
79
|
-
self.error_ids = params.get('transform')[4].get('error_ids')
|
|
80
|
-
self.upsample_frequency = params.get('transform')[5].get('upsample_frequency')
|
|
81
|
-
# Initialize logger
|
|
82
|
-
self.logfile = logfile + '_' + datetime.today().strftime("%Y%m%d-%H%M%S") + '.log'
|
|
83
|
-
self.logger = logging.getLogger('__name__')
|
|
84
|
-
self.logger.setLevel(logging.DEBUG)
|
|
85
|
-
self.file_handler = logging.FileHandler(os.path.join(Config.LOCAL_PATH, self.logfile))
|
|
86
|
-
self.file_format = logging.Formatter('%(asctime)s|%(levelname)s|%(name)s|%(message)s', datefmt='%Y-%m-%d %H:%M:%S')
|
|
87
|
-
self.file_handler.setLevel(logging.DEBUG)
|
|
88
|
-
self.file_handler.setFormatter(self.file_format)
|
|
89
|
-
self.logger.addHandler(self.file_handler)
|
|
90
|
-
except FileNotFoundError as err:
|
|
91
|
-
self.logger.exception(f'Config file not found. Please check entered path: {err}')
|
|
92
|
-
raise
|
|
93
|
-
finally:
|
|
1
|
+
import logging
|
|
2
|
+
import os
|
|
3
|
+
import yaml
|
|
4
|
+
|
|
5
|
+
from datetime import date, datetime, timedelta
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class Config():
|
|
9
|
+
|
|
10
|
+
LOCAL_PATH = '/tmp'
|
|
11
|
+
|
|
12
|
+
def __init__(self, config_file=None, logfile=None):
|
|
13
|
+
try:
|
|
14
|
+
#Initialize config parameters
|
|
15
|
+
with open(config_file) as file:
|
|
16
|
+
params = yaml.full_load(file)
|
|
17
|
+
self.access_key = params.get('aws_access_key')
|
|
18
|
+
self.secret_key = params.get('aws_secret_key')
|
|
19
|
+
self.region = params.get('aws_region')
|
|
20
|
+
self.sql_database = params.get('sql_database')
|
|
21
|
+
self.forecast_role = params.get('forecast_role')
|
|
22
|
+
# Initialize Prepare training parameters
|
|
23
|
+
self.dataset_orig_cols = params.get('prepare')[0].get('dataset_orig_cols')
|
|
24
|
+
self.items_metadata = params.get('prepare')[1].get('items_metadata')
|
|
25
|
+
# Initialize Paths parameters
|
|
26
|
+
self.tenant_id = params.get('paths')[0].get('tenant_id')
|
|
27
|
+
self.datalake = params.get('paths')[1].get('datalake')
|
|
28
|
+
self.config_path = params.get('paths')[2].get('config_path')
|
|
29
|
+
self.response_path = params.get('paths')[3].get('response_path')
|
|
30
|
+
self.dataset_import_path = params.get('paths')[4].get('dataset_import_path')
|
|
31
|
+
self.backtest_export_path = params.get('paths')[5].get('backtest_export_path')
|
|
32
|
+
self.forecast_export_path = params.get('paths')[6].get('forecast_export_path')
|
|
33
|
+
self.results_path = params.get('paths')[7].get('results_path')
|
|
34
|
+
self.multiforecast_path = params.get('paths')[8].get('multiforecast_path')
|
|
35
|
+
self.sftp_export = params.get('paths')[9].get('sftp_export')
|
|
36
|
+
# Initialize Training parameters
|
|
37
|
+
self.dataset_frequency = params.get('training')[0].get('dataset_frequency')
|
|
38
|
+
self.forecast_types = params.get('training')[1].get('forecast_types')
|
|
39
|
+
self.forecast_horizon = params.get('training')[2].get('forecast_horizon')
|
|
40
|
+
self.input_window = params.get('training')[3].get('input_window')
|
|
41
|
+
self.backtests = params.get('training')[4].get('backtests')
|
|
42
|
+
self.backtest_ids = params.get('training')[5].get('backtest_ids')[:self.backtests]
|
|
43
|
+
self.use_location = params.get('training')[6].get('use_location')
|
|
44
|
+
self.normalization = params.get('training')[7].get('normalization')
|
|
45
|
+
self.dropout_train = params.get('training')[8].get('dropout_train')
|
|
46
|
+
# Initialize DeepAR training parameters
|
|
47
|
+
self.epochs = params.get('deepar')[0].get('epochs')
|
|
48
|
+
self.neurons = params.get('deepar')[1].get('neurons')
|
|
49
|
+
self.hidden_layers = params.get('deepar')[2].get('hidden_layers')
|
|
50
|
+
self.backtest_horizon = params.get('deepar')[3].get('backtest_horizon')
|
|
51
|
+
self.use_automl = params.get('deepar')[4].get('use_automl')
|
|
52
|
+
# Initialize Attention model training parameters
|
|
53
|
+
self.epochs_attup = params.get('attup')[0].get('epochs_attup')
|
|
54
|
+
self.save_last_epoch = params.get('attup')[1].get('save_last_epoch')
|
|
55
|
+
self.lr = params.get('attup')[2].get('lr')
|
|
56
|
+
self.units = params.get('attup')[3].get('units')
|
|
57
|
+
self.batch_size = params.get('attup')[4].get('batch_size')
|
|
58
|
+
self.n_iter = params.get('attup')[5].get('n_iter')
|
|
59
|
+
self.momentum = params.get('attup')[6].get('momentum')
|
|
60
|
+
self.lrS = params.get('attup')[7].get('lrS')
|
|
61
|
+
# Initialize TFT
|
|
62
|
+
self.epochs_tft = params.get('tft')[0].get('epochs_tft')
|
|
63
|
+
self.gradient_clip_val = params.get('tft')[1].get('gradient_clip_val')
|
|
64
|
+
self.lr_tft = params.get('tft')[2].get('lr_tft')
|
|
65
|
+
self.lstm_layers = params.get('tft')[3].get('lstm_layers')
|
|
66
|
+
self.hidden_size = params.get('tft')[4].get('hidden_size')
|
|
67
|
+
self.attention_head_size = params.get('tft')[5].get('attention_head_size')
|
|
68
|
+
self.hidden_continuous_size = params.get('tft')[6].get('hidden_continuous_size')
|
|
69
|
+
self.n_iter_tft = params.get('tft')[7].get('n_iter_tft')
|
|
70
|
+
self.batch_size_tft = params.get('tft')[8].get('batch_size_tft')
|
|
71
|
+
# Initialize Importance parameters
|
|
72
|
+
self.sku_impct = params.get('importance')[0].get('sku_impct')
|
|
73
|
+
self.items_simulation= params.get('importance')[1].get('items_simulation')
|
|
74
|
+
# Initialize Transform parameters
|
|
75
|
+
self.abc_threshold = params.get('transform')[0].get('abc_threshold')
|
|
76
|
+
self.fsn_threshold = params.get('transform')[1].get('fsn_threshold')
|
|
77
|
+
self.xyz_threshold = params.get('transform')[2].get('xyz_threshold')
|
|
78
|
+
self.export_item_ranking = params.get('transform')[3].get('export_item_ranking')
|
|
79
|
+
self.error_ids = params.get('transform')[4].get('error_ids')
|
|
80
|
+
self.upsample_frequency = params.get('transform')[5].get('upsample_frequency')
|
|
81
|
+
# Initialize logger
|
|
82
|
+
self.logfile = logfile + '_' + datetime.today().strftime("%Y%m%d-%H%M%S") + '.log'
|
|
83
|
+
self.logger = logging.getLogger('__name__')
|
|
84
|
+
self.logger.setLevel(logging.DEBUG)
|
|
85
|
+
self.file_handler = logging.FileHandler(os.path.join(Config.LOCAL_PATH, self.logfile))
|
|
86
|
+
self.file_format = logging.Formatter('%(asctime)s|%(levelname)s|%(name)s|%(message)s', datefmt='%Y-%m-%d %H:%M:%S')
|
|
87
|
+
self.file_handler.setLevel(logging.DEBUG)
|
|
88
|
+
self.file_handler.setFormatter(self.file_format)
|
|
89
|
+
self.logger.addHandler(self.file_handler)
|
|
90
|
+
except FileNotFoundError as err:
|
|
91
|
+
self.logger.exception(f'Config file not found. Please check entered path: {err}')
|
|
92
|
+
raise
|
|
93
|
+
finally:
|
|
94
94
|
file.close()
|