ins-pricing 0.4.5__py3-none-any.whl → 0.5.0__py3-none-any.whl
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.
- ins_pricing/README.md +48 -22
- ins_pricing/__init__.py +142 -90
- ins_pricing/cli/BayesOpt_entry.py +52 -50
- ins_pricing/cli/BayesOpt_incremental.py +39 -105
- ins_pricing/cli/Explain_Run.py +31 -23
- ins_pricing/cli/Explain_entry.py +532 -579
- ins_pricing/cli/Pricing_Run.py +31 -23
- ins_pricing/cli/bayesopt_entry_runner.py +11 -9
- ins_pricing/cli/utils/cli_common.py +256 -256
- ins_pricing/cli/utils/cli_config.py +375 -375
- ins_pricing/cli/utils/import_resolver.py +382 -365
- ins_pricing/cli/utils/notebook_utils.py +340 -340
- ins_pricing/cli/watchdog_run.py +209 -201
- ins_pricing/frontend/__init__.py +10 -10
- ins_pricing/frontend/example_workflows.py +1 -1
- ins_pricing/governance/__init__.py +20 -20
- ins_pricing/governance/release.py +159 -159
- ins_pricing/modelling/__init__.py +147 -92
- ins_pricing/modelling/{core/bayesopt → bayesopt}/README.md +2 -2
- ins_pricing/modelling/{core/bayesopt → bayesopt}/__init__.py +64 -102
- ins_pricing/modelling/{core/bayesopt → bayesopt}/config_preprocess.py +562 -562
- ins_pricing/modelling/{core/bayesopt → bayesopt}/core.py +965 -964
- ins_pricing/modelling/{core/bayesopt → bayesopt}/model_explain_mixin.py +296 -296
- ins_pricing/modelling/{core/bayesopt → bayesopt}/model_plotting_mixin.py +482 -548
- ins_pricing/modelling/{core/bayesopt → bayesopt}/models/__init__.py +27 -27
- ins_pricing/modelling/{core/bayesopt → bayesopt}/models/model_ft_trainer.py +915 -913
- ins_pricing/modelling/{core/bayesopt → bayesopt}/models/model_gnn.py +788 -785
- ins_pricing/modelling/{core/bayesopt → bayesopt}/models/model_resn.py +448 -446
- ins_pricing/modelling/bayesopt/trainers/__init__.py +19 -0
- ins_pricing/modelling/{core/bayesopt → bayesopt}/trainers/trainer_base.py +1308 -1308
- ins_pricing/modelling/{core/bayesopt → bayesopt}/trainers/trainer_ft.py +3 -3
- ins_pricing/modelling/{core/bayesopt → bayesopt}/trainers/trainer_glm.py +197 -198
- ins_pricing/modelling/{core/bayesopt → bayesopt}/trainers/trainer_gnn.py +344 -344
- ins_pricing/modelling/{core/bayesopt → bayesopt}/trainers/trainer_resn.py +283 -283
- ins_pricing/modelling/{core/bayesopt → bayesopt}/trainers/trainer_xgb.py +346 -347
- ins_pricing/modelling/bayesopt/utils/__init__.py +67 -0
- ins_pricing/modelling/bayesopt/utils/constants.py +21 -0
- ins_pricing/modelling/bayesopt/utils/io_utils.py +7 -0
- ins_pricing/modelling/bayesopt/utils/losses.py +27 -0
- ins_pricing/modelling/bayesopt/utils/metrics_and_devices.py +17 -0
- ins_pricing/modelling/{core/bayesopt → bayesopt}/utils/torch_trainer_mixin.py +623 -623
- ins_pricing/modelling/{core/evaluation.py → evaluation.py} +113 -104
- ins_pricing/modelling/explain/__init__.py +55 -55
- ins_pricing/modelling/explain/metrics.py +27 -174
- ins_pricing/modelling/explain/permutation.py +237 -237
- ins_pricing/modelling/plotting/__init__.py +40 -36
- ins_pricing/modelling/plotting/compat.py +228 -0
- ins_pricing/modelling/plotting/curves.py +572 -572
- ins_pricing/modelling/plotting/diagnostics.py +163 -163
- ins_pricing/modelling/plotting/geo.py +362 -362
- ins_pricing/modelling/plotting/importance.py +121 -121
- ins_pricing/pricing/__init__.py +27 -27
- ins_pricing/production/__init__.py +35 -25
- ins_pricing/production/{predict.py → inference.py} +140 -57
- ins_pricing/production/monitoring.py +8 -21
- ins_pricing/reporting/__init__.py +11 -11
- ins_pricing/setup.py +1 -1
- ins_pricing/tests/production/test_inference.py +90 -0
- ins_pricing/utils/__init__.py +116 -83
- ins_pricing/utils/device.py +255 -255
- ins_pricing/utils/features.py +53 -0
- ins_pricing/utils/io.py +72 -0
- ins_pricing/{modelling/core/bayesopt/utils → utils}/losses.py +125 -129
- ins_pricing/utils/metrics.py +158 -24
- ins_pricing/utils/numerics.py +76 -0
- ins_pricing/utils/paths.py +9 -1
- {ins_pricing-0.4.5.dist-info → ins_pricing-0.5.0.dist-info}/METADATA +182 -182
- ins_pricing-0.5.0.dist-info/RECORD +131 -0
- ins_pricing/modelling/core/BayesOpt.py +0 -146
- ins_pricing/modelling/core/__init__.py +0 -1
- ins_pricing/modelling/core/bayesopt/trainers/__init__.py +0 -19
- ins_pricing/modelling/core/bayesopt/utils/__init__.py +0 -86
- ins_pricing/modelling/core/bayesopt/utils/constants.py +0 -183
- ins_pricing/modelling/core/bayesopt/utils/io_utils.py +0 -126
- ins_pricing/modelling/core/bayesopt/utils/metrics_and_devices.py +0 -555
- ins_pricing/modelling/core/bayesopt/utils.py +0 -105
- ins_pricing/modelling/core/bayesopt/utils_backup.py +0 -1503
- ins_pricing/tests/production/test_predict.py +0 -233
- ins_pricing-0.4.5.dist-info/RECORD +0 -130
- /ins_pricing/modelling/{core/bayesopt → bayesopt}/config_components.py +0 -0
- /ins_pricing/modelling/{core/bayesopt → bayesopt}/models/model_ft_components.py +0 -0
- /ins_pricing/modelling/{core/bayesopt → bayesopt}/utils/distributed_utils.py +0 -0
- {ins_pricing-0.4.5.dist-info → ins_pricing-0.5.0.dist-info}/WHEEL +0 -0
- {ins_pricing-0.4.5.dist-info → ins_pricing-0.5.0.dist-info}/top_level.txt +0 -0
|
@@ -1,102 +1,64 @@
|
|
|
1
|
-
"""BayesOpt subpackage (split from monolithic BayesOpt.py)."""
|
|
2
|
-
|
|
3
|
-
from __future__ import annotations
|
|
4
|
-
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
"
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
|
|
65
|
-
"BayesOptModel",
|
|
66
|
-
"FeatureTokenizer",
|
|
67
|
-
"FTTransformerCore",
|
|
68
|
-
"FTTransformerSklearn",
|
|
69
|
-
"GraphNeuralNetSklearn",
|
|
70
|
-
"MaskedTabularDataset",
|
|
71
|
-
"ResBlock",
|
|
72
|
-
"ResNetSequential",
|
|
73
|
-
"ResNetSklearn",
|
|
74
|
-
"ScaledTransformerEncoderLayer",
|
|
75
|
-
"SimpleGraphLayer",
|
|
76
|
-
"SimpleGNN",
|
|
77
|
-
"TabularDataset",
|
|
78
|
-
"FTTrainer",
|
|
79
|
-
"GLMTrainer",
|
|
80
|
-
"GNNTrainer",
|
|
81
|
-
"ResNetTrainer",
|
|
82
|
-
"TrainerBase",
|
|
83
|
-
"XGBTrainer",
|
|
84
|
-
"_xgb_cuda_available",
|
|
85
|
-
"EPS",
|
|
86
|
-
"DistributedUtils",
|
|
87
|
-
"IOUtils",
|
|
88
|
-
"PlotUtils",
|
|
89
|
-
"TorchTrainerMixin",
|
|
90
|
-
"TrainingUtils",
|
|
91
|
-
"compute_batch_size",
|
|
92
|
-
"csv_to_dict",
|
|
93
|
-
"ensure_parent_dir",
|
|
94
|
-
"free_cuda",
|
|
95
|
-
"infer_factor_and_cate_list",
|
|
96
|
-
"plot_dlift_list",
|
|
97
|
-
"plot_lift_list",
|
|
98
|
-
"set_global_seed",
|
|
99
|
-
"split_data",
|
|
100
|
-
"tweedie_loss",
|
|
101
|
-
"torch",
|
|
102
|
-
]
|
|
1
|
+
"""BayesOpt subpackage (split from monolithic BayesOpt.py)."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from ins_pricing.utils.torch_compat import disable_torch_dynamo_if_requested
|
|
6
|
+
|
|
7
|
+
disable_torch_dynamo_if_requested()
|
|
8
|
+
|
|
9
|
+
from ins_pricing.modelling.bayesopt.config_preprocess import (
|
|
10
|
+
BayesOptConfig,
|
|
11
|
+
DatasetPreprocessor,
|
|
12
|
+
OutputManager,
|
|
13
|
+
VersionManager,
|
|
14
|
+
)
|
|
15
|
+
from ins_pricing.modelling.bayesopt.core import BayesOptModel
|
|
16
|
+
from ins_pricing.modelling.bayesopt.models import (
|
|
17
|
+
FeatureTokenizer,
|
|
18
|
+
FTTransformerCore,
|
|
19
|
+
FTTransformerSklearn,
|
|
20
|
+
GraphNeuralNetSklearn,
|
|
21
|
+
MaskedTabularDataset,
|
|
22
|
+
ResBlock,
|
|
23
|
+
ResNetSequential,
|
|
24
|
+
ResNetSklearn,
|
|
25
|
+
ScaledTransformerEncoderLayer,
|
|
26
|
+
SimpleGraphLayer,
|
|
27
|
+
SimpleGNN,
|
|
28
|
+
TabularDataset,
|
|
29
|
+
)
|
|
30
|
+
from ins_pricing.modelling.bayesopt.trainers import (
|
|
31
|
+
FTTrainer,
|
|
32
|
+
GLMTrainer,
|
|
33
|
+
GNNTrainer,
|
|
34
|
+
ResNetTrainer,
|
|
35
|
+
TrainerBase,
|
|
36
|
+
XGBTrainer,
|
|
37
|
+
_xgb_cuda_available,
|
|
38
|
+
)
|
|
39
|
+
__all__ = [
|
|
40
|
+
"BayesOptConfig",
|
|
41
|
+
"DatasetPreprocessor",
|
|
42
|
+
"OutputManager",
|
|
43
|
+
"VersionManager",
|
|
44
|
+
"BayesOptModel",
|
|
45
|
+
"FeatureTokenizer",
|
|
46
|
+
"FTTransformerCore",
|
|
47
|
+
"FTTransformerSklearn",
|
|
48
|
+
"GraphNeuralNetSklearn",
|
|
49
|
+
"MaskedTabularDataset",
|
|
50
|
+
"ResBlock",
|
|
51
|
+
"ResNetSequential",
|
|
52
|
+
"ResNetSklearn",
|
|
53
|
+
"ScaledTransformerEncoderLayer",
|
|
54
|
+
"SimpleGraphLayer",
|
|
55
|
+
"SimpleGNN",
|
|
56
|
+
"TabularDataset",
|
|
57
|
+
"FTTrainer",
|
|
58
|
+
"GLMTrainer",
|
|
59
|
+
"GNNTrainer",
|
|
60
|
+
"ResNetTrainer",
|
|
61
|
+
"TrainerBase",
|
|
62
|
+
"XGBTrainer",
|
|
63
|
+
"_xgb_cuda_available",
|
|
64
|
+
]
|