ins-pricing 0.3.3__py3-none-any.whl → 0.4.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/docs/LOSS_FUNCTIONS.md +78 -0
- ins_pricing/docs/modelling/BayesOpt_USAGE.md +3 -3
- ins_pricing/frontend/QUICKSTART.md +152 -0
- ins_pricing/frontend/README.md +388 -0
- ins_pricing/frontend/__init__.py +10 -0
- ins_pricing/frontend/app.py +903 -0
- ins_pricing/frontend/config_builder.py +352 -0
- ins_pricing/frontend/example_config.json +36 -0
- ins_pricing/frontend/example_workflows.py +979 -0
- ins_pricing/frontend/ft_workflow.py +316 -0
- ins_pricing/frontend/runner.py +388 -0
- ins_pricing/modelling/core/bayesopt/config_preprocess.py +12 -0
- ins_pricing/modelling/core/bayesopt/core.py +21 -8
- ins_pricing/modelling/core/bayesopt/models/model_ft_trainer.py +16 -6
- ins_pricing/modelling/core/bayesopt/models/model_gnn.py +16 -6
- ins_pricing/modelling/core/bayesopt/models/model_resn.py +16 -7
- ins_pricing/modelling/core/bayesopt/trainers/trainer_base.py +2 -0
- ins_pricing/modelling/core/bayesopt/trainers/trainer_ft.py +25 -8
- ins_pricing/modelling/core/bayesopt/trainers/trainer_glm.py +14 -11
- ins_pricing/modelling/core/bayesopt/trainers/trainer_gnn.py +29 -10
- ins_pricing/modelling/core/bayesopt/trainers/trainer_resn.py +28 -12
- ins_pricing/modelling/core/bayesopt/trainers/trainer_xgb.py +13 -14
- ins_pricing/modelling/core/bayesopt/utils/losses.py +129 -0
- ins_pricing/modelling/core/bayesopt/utils/metrics_and_devices.py +18 -3
- ins_pricing/modelling/core/bayesopt/utils/torch_trainer_mixin.py +24 -3
- ins_pricing/production/predict.py +693 -635
- ins_pricing/setup.py +1 -1
- ins_pricing/utils/metrics.py +27 -3
- {ins_pricing-0.3.3.dist-info → ins_pricing-0.4.0.dist-info}/METADATA +162 -162
- {ins_pricing-0.3.3.dist-info → ins_pricing-0.4.0.dist-info}/RECORD +32 -21
- {ins_pricing-0.3.3.dist-info → ins_pricing-0.4.0.dist-info}/WHEEL +1 -1
- {ins_pricing-0.3.3.dist-info → ins_pricing-0.4.0.dist-info}/top_level.txt +0 -0
ins_pricing/setup.py
CHANGED
ins_pricing/utils/metrics.py
CHANGED
|
@@ -22,9 +22,16 @@ import numpy as np
|
|
|
22
22
|
import pandas as pd
|
|
23
23
|
|
|
24
24
|
try:
|
|
25
|
-
from sklearn.metrics import
|
|
25
|
+
from sklearn.metrics import (
|
|
26
|
+
log_loss,
|
|
27
|
+
mean_absolute_error,
|
|
28
|
+
mean_squared_error,
|
|
29
|
+
mean_tweedie_deviance,
|
|
30
|
+
)
|
|
26
31
|
except ImportError:
|
|
27
32
|
log_loss = None
|
|
33
|
+
mean_absolute_error = None
|
|
34
|
+
mean_squared_error = None
|
|
28
35
|
mean_tweedie_deviance = None
|
|
29
36
|
|
|
30
37
|
|
|
@@ -198,6 +205,7 @@ class MetricFactory:
|
|
|
198
205
|
self,
|
|
199
206
|
task_type: str = "regression",
|
|
200
207
|
tweedie_power: float = 1.5,
|
|
208
|
+
loss_name: str = "tweedie",
|
|
201
209
|
clip_min: float = 1e-8,
|
|
202
210
|
clip_max: float = 1 - 1e-8,
|
|
203
211
|
):
|
|
@@ -206,11 +214,13 @@ class MetricFactory:
|
|
|
206
214
|
Args:
|
|
207
215
|
task_type: Either 'regression' or 'classification'
|
|
208
216
|
tweedie_power: Power parameter for Tweedie deviance (1.0-2.0)
|
|
217
|
+
loss_name: Regression loss name ('tweedie', 'poisson', 'gamma', 'mse', 'mae')
|
|
209
218
|
clip_min: Minimum value for clipping predictions
|
|
210
219
|
clip_max: Maximum value for clipping predictions (for classification)
|
|
211
220
|
"""
|
|
212
221
|
self.task_type = task_type
|
|
213
222
|
self.tweedie_power = tweedie_power
|
|
223
|
+
self.loss_name = loss_name
|
|
214
224
|
self.clip_min = clip_min
|
|
215
225
|
self.clip_max = clip_max
|
|
216
226
|
|
|
@@ -240,14 +250,28 @@ class MetricFactory:
|
|
|
240
250
|
y_pred_clipped = np.clip(y_pred, self.clip_min, self.clip_max)
|
|
241
251
|
return float(log_loss(y_true, y_pred_clipped, sample_weight=sample_weight))
|
|
242
252
|
|
|
243
|
-
|
|
253
|
+
loss_name = str(self.loss_name or "tweedie").strip().lower()
|
|
254
|
+
if loss_name in {"mse", "mae"}:
|
|
255
|
+
if mean_squared_error is None or mean_absolute_error is None:
|
|
256
|
+
raise ImportError("sklearn is required for metric computation")
|
|
257
|
+
if loss_name == "mse":
|
|
258
|
+
return float(mean_squared_error(
|
|
259
|
+
y_true, y_pred, sample_weight=sample_weight))
|
|
260
|
+
return float(mean_absolute_error(
|
|
261
|
+
y_true, y_pred, sample_weight=sample_weight))
|
|
262
|
+
|
|
244
263
|
y_pred_safe = np.maximum(y_pred, self.clip_min)
|
|
264
|
+
power = self.tweedie_power
|
|
265
|
+
if loss_name == "poisson":
|
|
266
|
+
power = 1.0
|
|
267
|
+
elif loss_name == "gamma":
|
|
268
|
+
power = 2.0
|
|
245
269
|
return float(
|
|
246
270
|
mean_tweedie_deviance(
|
|
247
271
|
y_true,
|
|
248
272
|
y_pred_safe,
|
|
249
273
|
sample_weight=sample_weight,
|
|
250
|
-
power=
|
|
274
|
+
power=power,
|
|
251
275
|
)
|
|
252
276
|
)
|
|
253
277
|
|
|
@@ -1,162 +1,162 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: ins_pricing
|
|
3
|
-
Version: 0.
|
|
4
|
-
Summary: Reusable modelling, pricing, governance, and reporting utilities.
|
|
5
|
-
Author: meishi125478
|
|
6
|
-
License: Proprietary
|
|
7
|
-
Keywords: pricing,insurance,bayesopt,ml
|
|
8
|
-
Classifier: Programming Language :: Python :: 3
|
|
9
|
-
Classifier: Programming Language :: Python :: 3 :: Only
|
|
10
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
11
|
-
Classifier: License :: Other/Proprietary License
|
|
12
|
-
Classifier: Operating System :: OS Independent
|
|
13
|
-
Classifier: Intended Audience :: Developers
|
|
14
|
-
Requires-Python: >=3.9
|
|
15
|
-
Description-Content-Type: text/markdown
|
|
16
|
-
Requires-Dist: numpy>=1.20
|
|
17
|
-
Requires-Dist: pandas>=1.4
|
|
18
|
-
Provides-Extra: bayesopt
|
|
19
|
-
Requires-Dist: torch>=1.13; extra == "bayesopt"
|
|
20
|
-
Requires-Dist: optuna>=3.0; extra == "bayesopt"
|
|
21
|
-
Requires-Dist: xgboost>=1.6; extra == "bayesopt"
|
|
22
|
-
Requires-Dist: scikit-learn>=1.1; extra == "bayesopt"
|
|
23
|
-
Requires-Dist: statsmodels>=0.13; extra == "bayesopt"
|
|
24
|
-
Requires-Dist: joblib>=1.2; extra == "bayesopt"
|
|
25
|
-
Requires-Dist: matplotlib>=3.5; extra == "bayesopt"
|
|
26
|
-
Provides-Extra: plotting
|
|
27
|
-
Requires-Dist: matplotlib>=3.5; extra == "plotting"
|
|
28
|
-
Requires-Dist: scikit-learn>=1.1; extra == "plotting"
|
|
29
|
-
Provides-Extra: explain
|
|
30
|
-
Requires-Dist: torch>=1.13; extra == "explain"
|
|
31
|
-
Requires-Dist: shap>=0.41; extra == "explain"
|
|
32
|
-
Requires-Dist: scikit-learn>=1.1; extra == "explain"
|
|
33
|
-
Provides-Extra: geo
|
|
34
|
-
Requires-Dist: contextily>=1.3; extra == "geo"
|
|
35
|
-
Requires-Dist: matplotlib>=3.5; extra == "geo"
|
|
36
|
-
Provides-Extra: gnn
|
|
37
|
-
Requires-Dist: torch>=1.13; extra == "gnn"
|
|
38
|
-
Requires-Dist: pynndescent>=0.5; extra == "gnn"
|
|
39
|
-
Requires-Dist: torch-geometric>=2.3; extra == "gnn"
|
|
40
|
-
Provides-Extra: all
|
|
41
|
-
Requires-Dist: torch>=1.13; extra == "all"
|
|
42
|
-
Requires-Dist: optuna>=3.0; extra == "all"
|
|
43
|
-
Requires-Dist: xgboost>=1.6; extra == "all"
|
|
44
|
-
Requires-Dist: scikit-learn>=1.1; extra == "all"
|
|
45
|
-
Requires-Dist: statsmodels>=0.13; extra == "all"
|
|
46
|
-
Requires-Dist: joblib>=1.2; extra == "all"
|
|
47
|
-
Requires-Dist: matplotlib>=3.5; extra == "all"
|
|
48
|
-
Requires-Dist: shap>=0.41; extra == "all"
|
|
49
|
-
Requires-Dist: contextily>=1.3; extra == "all"
|
|
50
|
-
Requires-Dist: pynndescent>=0.5; extra == "all"
|
|
51
|
-
Requires-Dist: torch-geometric>=2.3; extra == "all"
|
|
52
|
-
|
|
53
|
-
# Insurance-Pricing
|
|
54
|
-
|
|
55
|
-
A reusable toolkit for insurance modeling, pricing, governance, and reporting.
|
|
56
|
-
|
|
57
|
-
## Overview
|
|
58
|
-
|
|
59
|
-
Insurance-Pricing (ins_pricing) is an enterprise-grade Python library designed for machine learning model training, pricing calculations, and model governance workflows in the insurance industry.
|
|
60
|
-
|
|
61
|
-
### Core Modules
|
|
62
|
-
|
|
63
|
-
| Module | Description |
|
|
64
|
-
|--------|-------------|
|
|
65
|
-
| **modelling** | ML model training (GLM, XGBoost, ResNet, FT-Transformer, GNN) and model interpretability (SHAP, permutation importance) |
|
|
66
|
-
| **pricing** | Factor table construction, numeric binning, premium calibration, exposure calculation, PSI monitoring |
|
|
67
|
-
| **production** | Model prediction, batch scoring, data drift detection, production metrics monitoring |
|
|
68
|
-
| **governance** | Model registry, version management, approval workflows, audit logging |
|
|
69
|
-
| **reporting** | Report generation (Markdown format), report scheduling |
|
|
70
|
-
| **utils** | Data validation, performance profiling, device management, logging configuration |
|
|
71
|
-
|
|
72
|
-
### Quick Start
|
|
73
|
-
|
|
74
|
-
```python
|
|
75
|
-
# Model training with Bayesian optimization
|
|
76
|
-
from ins_pricing import bayesopt as ropt
|
|
77
|
-
|
|
78
|
-
model = ropt.BayesOptModel(
|
|
79
|
-
train_data, test_data,
|
|
80
|
-
model_name='my_model',
|
|
81
|
-
resp_nme='target',
|
|
82
|
-
weight_nme='weight',
|
|
83
|
-
factor_nmes=feature_list,
|
|
84
|
-
cate_list=categorical_features,
|
|
85
|
-
)
|
|
86
|
-
model.bayesopt_xgb(max_evals=100) # Train XGBoost
|
|
87
|
-
model.bayesopt_resnet(max_evals=50) # Train ResNet
|
|
88
|
-
model.bayesopt_ft(max_evals=50) # Train FT-Transformer
|
|
89
|
-
|
|
90
|
-
# Pricing: build factor table
|
|
91
|
-
from ins_pricing.pricing import build_factor_table
|
|
92
|
-
factors = build_factor_table(
|
|
93
|
-
df,
|
|
94
|
-
factor_col='age_band',
|
|
95
|
-
loss_col='claim_amount',
|
|
96
|
-
exposure_col='exposure',
|
|
97
|
-
)
|
|
98
|
-
|
|
99
|
-
# Production: batch scoring
|
|
100
|
-
from ins_pricing.production import batch_score
|
|
101
|
-
scores = batch_score(model.trainers['xgb'].predict, df)
|
|
102
|
-
|
|
103
|
-
# Model governance
|
|
104
|
-
from ins_pricing.governance import ModelRegistry
|
|
105
|
-
registry = ModelRegistry('models.json')
|
|
106
|
-
registry.register(model_name, version, metrics=metrics)
|
|
107
|
-
```
|
|
108
|
-
|
|
109
|
-
### Project Structure
|
|
110
|
-
|
|
111
|
-
```
|
|
112
|
-
ins_pricing/
|
|
113
|
-
├── cli/ # Command-line entry points
|
|
114
|
-
├── modelling/
|
|
115
|
-
│ ├── core/bayesopt/ # ML model training core
|
|
116
|
-
│ ├── explain/ # Model interpretability
|
|
117
|
-
│ └── plotting/ # Model visualization
|
|
118
|
-
├── pricing/ # Insurance pricing module
|
|
119
|
-
├── production/ # Production deployment module
|
|
120
|
-
├── governance/ # Model governance
|
|
121
|
-
├── reporting/ # Report generation
|
|
122
|
-
├── utils/ # Utilities
|
|
123
|
-
└── tests/ # Test suite
|
|
124
|
-
```
|
|
125
|
-
|
|
126
|
-
### Installation
|
|
127
|
-
|
|
128
|
-
```bash
|
|
129
|
-
# Basic installation
|
|
130
|
-
pip install ins_pricing
|
|
131
|
-
|
|
132
|
-
# Full installation (all optional dependencies)
|
|
133
|
-
pip install ins_pricing[all]
|
|
134
|
-
|
|
135
|
-
# Install specific extras
|
|
136
|
-
pip install ins_pricing[bayesopt] # Model training
|
|
137
|
-
pip install ins_pricing[explain] # Model explanation
|
|
138
|
-
pip install ins_pricing[plotting] # Visualization
|
|
139
|
-
pip install ins_pricing[gnn] # Graph neural networks
|
|
140
|
-
```
|
|
141
|
-
|
|
142
|
-
#### Multi-platform & GPU installation notes
|
|
143
|
-
|
|
144
|
-
- **PyTorch (CPU/GPU/MPS)**: Install the correct PyTorch build for your platform/GPU first (CUDA on
|
|
145
|
-
Linux/Windows, ROCm on supported AMD platforms, or MPS on Apple Silicon). Then install the
|
|
146
|
-
optional extras you need (e.g., `bayesopt`, `explain`, or `gnn`). This avoids pip pulling a
|
|
147
|
-
mismatched wheel.
|
|
148
|
-
- **Torch Geometric (GNN)**: `torch-geometric` often requires platform-specific wheels (e.g.,
|
|
149
|
-
`torch-scatter`, `torch-sparse`). Follow the official PyG installation instructions for your
|
|
150
|
-
CUDA/ROCm/CPU environment, then install `ins_pricing[gnn]`.
|
|
151
|
-
- **Multi-GPU**: Training code will use CUDA when available and can enable multi-GPU via
|
|
152
|
-
`torch.distributed`/`DataParallel` where supported. On Windows, CUDA DDP is not supported and will
|
|
153
|
-
fall back to single-GPU or DataParallel where possible.
|
|
154
|
-
|
|
155
|
-
### Requirements
|
|
156
|
-
|
|
157
|
-
- Python >= 3.9
|
|
158
|
-
- Core dependencies: numpy >= 1.20, pandas >= 1.4
|
|
159
|
-
|
|
160
|
-
### License
|
|
161
|
-
|
|
162
|
-
Proprietary
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: ins_pricing
|
|
3
|
+
Version: 0.4.0
|
|
4
|
+
Summary: Reusable modelling, pricing, governance, and reporting utilities.
|
|
5
|
+
Author: meishi125478
|
|
6
|
+
License: Proprietary
|
|
7
|
+
Keywords: pricing,insurance,bayesopt,ml
|
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
|
9
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
10
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
11
|
+
Classifier: License :: Other/Proprietary License
|
|
12
|
+
Classifier: Operating System :: OS Independent
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Requires-Python: >=3.9
|
|
15
|
+
Description-Content-Type: text/markdown
|
|
16
|
+
Requires-Dist: numpy>=1.20
|
|
17
|
+
Requires-Dist: pandas>=1.4
|
|
18
|
+
Provides-Extra: bayesopt
|
|
19
|
+
Requires-Dist: torch>=1.13; extra == "bayesopt"
|
|
20
|
+
Requires-Dist: optuna>=3.0; extra == "bayesopt"
|
|
21
|
+
Requires-Dist: xgboost>=1.6; extra == "bayesopt"
|
|
22
|
+
Requires-Dist: scikit-learn>=1.1; extra == "bayesopt"
|
|
23
|
+
Requires-Dist: statsmodels>=0.13; extra == "bayesopt"
|
|
24
|
+
Requires-Dist: joblib>=1.2; extra == "bayesopt"
|
|
25
|
+
Requires-Dist: matplotlib>=3.5; extra == "bayesopt"
|
|
26
|
+
Provides-Extra: plotting
|
|
27
|
+
Requires-Dist: matplotlib>=3.5; extra == "plotting"
|
|
28
|
+
Requires-Dist: scikit-learn>=1.1; extra == "plotting"
|
|
29
|
+
Provides-Extra: explain
|
|
30
|
+
Requires-Dist: torch>=1.13; extra == "explain"
|
|
31
|
+
Requires-Dist: shap>=0.41; extra == "explain"
|
|
32
|
+
Requires-Dist: scikit-learn>=1.1; extra == "explain"
|
|
33
|
+
Provides-Extra: geo
|
|
34
|
+
Requires-Dist: contextily>=1.3; extra == "geo"
|
|
35
|
+
Requires-Dist: matplotlib>=3.5; extra == "geo"
|
|
36
|
+
Provides-Extra: gnn
|
|
37
|
+
Requires-Dist: torch>=1.13; extra == "gnn"
|
|
38
|
+
Requires-Dist: pynndescent>=0.5; extra == "gnn"
|
|
39
|
+
Requires-Dist: torch-geometric>=2.3; extra == "gnn"
|
|
40
|
+
Provides-Extra: all
|
|
41
|
+
Requires-Dist: torch>=1.13; extra == "all"
|
|
42
|
+
Requires-Dist: optuna>=3.0; extra == "all"
|
|
43
|
+
Requires-Dist: xgboost>=1.6; extra == "all"
|
|
44
|
+
Requires-Dist: scikit-learn>=1.1; extra == "all"
|
|
45
|
+
Requires-Dist: statsmodels>=0.13; extra == "all"
|
|
46
|
+
Requires-Dist: joblib>=1.2; extra == "all"
|
|
47
|
+
Requires-Dist: matplotlib>=3.5; extra == "all"
|
|
48
|
+
Requires-Dist: shap>=0.41; extra == "all"
|
|
49
|
+
Requires-Dist: contextily>=1.3; extra == "all"
|
|
50
|
+
Requires-Dist: pynndescent>=0.5; extra == "all"
|
|
51
|
+
Requires-Dist: torch-geometric>=2.3; extra == "all"
|
|
52
|
+
|
|
53
|
+
# Insurance-Pricing
|
|
54
|
+
|
|
55
|
+
A reusable toolkit for insurance modeling, pricing, governance, and reporting.
|
|
56
|
+
|
|
57
|
+
## Overview
|
|
58
|
+
|
|
59
|
+
Insurance-Pricing (ins_pricing) is an enterprise-grade Python library designed for machine learning model training, pricing calculations, and model governance workflows in the insurance industry.
|
|
60
|
+
|
|
61
|
+
### Core Modules
|
|
62
|
+
|
|
63
|
+
| Module | Description |
|
|
64
|
+
|--------|-------------|
|
|
65
|
+
| **modelling** | ML model training (GLM, XGBoost, ResNet, FT-Transformer, GNN) and model interpretability (SHAP, permutation importance) |
|
|
66
|
+
| **pricing** | Factor table construction, numeric binning, premium calibration, exposure calculation, PSI monitoring |
|
|
67
|
+
| **production** | Model prediction, batch scoring, data drift detection, production metrics monitoring |
|
|
68
|
+
| **governance** | Model registry, version management, approval workflows, audit logging |
|
|
69
|
+
| **reporting** | Report generation (Markdown format), report scheduling |
|
|
70
|
+
| **utils** | Data validation, performance profiling, device management, logging configuration |
|
|
71
|
+
|
|
72
|
+
### Quick Start
|
|
73
|
+
|
|
74
|
+
```python
|
|
75
|
+
# Model training with Bayesian optimization
|
|
76
|
+
from ins_pricing import bayesopt as ropt
|
|
77
|
+
|
|
78
|
+
model = ropt.BayesOptModel(
|
|
79
|
+
train_data, test_data,
|
|
80
|
+
model_name='my_model',
|
|
81
|
+
resp_nme='target',
|
|
82
|
+
weight_nme='weight',
|
|
83
|
+
factor_nmes=feature_list,
|
|
84
|
+
cate_list=categorical_features,
|
|
85
|
+
)
|
|
86
|
+
model.bayesopt_xgb(max_evals=100) # Train XGBoost
|
|
87
|
+
model.bayesopt_resnet(max_evals=50) # Train ResNet
|
|
88
|
+
model.bayesopt_ft(max_evals=50) # Train FT-Transformer
|
|
89
|
+
|
|
90
|
+
# Pricing: build factor table
|
|
91
|
+
from ins_pricing.pricing import build_factor_table
|
|
92
|
+
factors = build_factor_table(
|
|
93
|
+
df,
|
|
94
|
+
factor_col='age_band',
|
|
95
|
+
loss_col='claim_amount',
|
|
96
|
+
exposure_col='exposure',
|
|
97
|
+
)
|
|
98
|
+
|
|
99
|
+
# Production: batch scoring
|
|
100
|
+
from ins_pricing.production import batch_score
|
|
101
|
+
scores = batch_score(model.trainers['xgb'].predict, df)
|
|
102
|
+
|
|
103
|
+
# Model governance
|
|
104
|
+
from ins_pricing.governance import ModelRegistry
|
|
105
|
+
registry = ModelRegistry('models.json')
|
|
106
|
+
registry.register(model_name, version, metrics=metrics)
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### Project Structure
|
|
110
|
+
|
|
111
|
+
```
|
|
112
|
+
ins_pricing/
|
|
113
|
+
├── cli/ # Command-line entry points
|
|
114
|
+
├── modelling/
|
|
115
|
+
│ ├── core/bayesopt/ # ML model training core
|
|
116
|
+
│ ├── explain/ # Model interpretability
|
|
117
|
+
│ └── plotting/ # Model visualization
|
|
118
|
+
├── pricing/ # Insurance pricing module
|
|
119
|
+
├── production/ # Production deployment module
|
|
120
|
+
├── governance/ # Model governance
|
|
121
|
+
├── reporting/ # Report generation
|
|
122
|
+
├── utils/ # Utilities
|
|
123
|
+
└── tests/ # Test suite
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
### Installation
|
|
127
|
+
|
|
128
|
+
```bash
|
|
129
|
+
# Basic installation
|
|
130
|
+
pip install ins_pricing
|
|
131
|
+
|
|
132
|
+
# Full installation (all optional dependencies)
|
|
133
|
+
pip install ins_pricing[all]
|
|
134
|
+
|
|
135
|
+
# Install specific extras
|
|
136
|
+
pip install ins_pricing[bayesopt] # Model training
|
|
137
|
+
pip install ins_pricing[explain] # Model explanation
|
|
138
|
+
pip install ins_pricing[plotting] # Visualization
|
|
139
|
+
pip install ins_pricing[gnn] # Graph neural networks
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
#### Multi-platform & GPU installation notes
|
|
143
|
+
|
|
144
|
+
- **PyTorch (CPU/GPU/MPS)**: Install the correct PyTorch build for your platform/GPU first (CUDA on
|
|
145
|
+
Linux/Windows, ROCm on supported AMD platforms, or MPS on Apple Silicon). Then install the
|
|
146
|
+
optional extras you need (e.g., `bayesopt`, `explain`, or `gnn`). This avoids pip pulling a
|
|
147
|
+
mismatched wheel.
|
|
148
|
+
- **Torch Geometric (GNN)**: `torch-geometric` often requires platform-specific wheels (e.g.,
|
|
149
|
+
`torch-scatter`, `torch-sparse`). Follow the official PyG installation instructions for your
|
|
150
|
+
CUDA/ROCm/CPU environment, then install `ins_pricing[gnn]`.
|
|
151
|
+
- **Multi-GPU**: Training code will use CUDA when available and can enable multi-GPU via
|
|
152
|
+
`torch.distributed`/`DataParallel` where supported. On Windows, CUDA DDP is not supported and will
|
|
153
|
+
fall back to single-GPU or DataParallel where possible.
|
|
154
|
+
|
|
155
|
+
### Requirements
|
|
156
|
+
|
|
157
|
+
- Python >= 3.9
|
|
158
|
+
- Core dependencies: numpy >= 1.20, pandas >= 1.4
|
|
159
|
+
|
|
160
|
+
### License
|
|
161
|
+
|
|
162
|
+
Proprietary
|
|
@@ -3,7 +3,7 @@ ins_pricing/README.md,sha256=W4V2xtzM6pyQzwJPvWP7cNn-We9rxM8xrxRlBVQwoY8,3399
|
|
|
3
3
|
ins_pricing/RELEASE_NOTES_0.2.8.md,sha256=KIJzk1jbZbZPKjwnkPSDHO_2Ipv3SP3CzCNDdf07jI0,9331
|
|
4
4
|
ins_pricing/__init__.py,sha256=46j1wCdLVrgrofeBwKl-3NXTxzjbTv-w3KjW-dyKGiY,2622
|
|
5
5
|
ins_pricing/exceptions.py,sha256=5fZavPV4zNJ7wPC75L215KkHXX9pRrfDAYZOdSKJMGo,4778
|
|
6
|
-
ins_pricing/setup.py,sha256=
|
|
6
|
+
ins_pricing/setup.py,sha256=VG4H2vA9aokEGoafQ1iM9N-G9Qb_OTMOQXbFNCtQigo,1702
|
|
7
7
|
ins_pricing/cli/BayesOpt_entry.py,sha256=6UBVxu36O3bXn1WC-BBi-l_W9_MqEoHmDGnwwDKNo5Q,1594
|
|
8
8
|
ins_pricing/cli/BayesOpt_incremental.py,sha256=_Klr5vvNoq_TbgwrH_T3f0a6cHmA9iVJMViiji6ahJY,35927
|
|
9
9
|
ins_pricing/cli/Explain_Run.py,sha256=gEPQjqHiXyXlCTKjUzwSvbAn5_h74ABgb_sEGs-YHVE,664
|
|
@@ -19,8 +19,18 @@ ins_pricing/cli/utils/evaluation_context.py,sha256=0zuDOcVzkWiuj4HyAT0psaAfEbSqp
|
|
|
19
19
|
ins_pricing/cli/utils/import_resolver.py,sha256=Ut-SBN4F2sw8O7B3GveMoZn4__1IGwljvxC4sLU0tpk,12531
|
|
20
20
|
ins_pricing/cli/utils/notebook_utils.py,sha256=xjSjn6z4_x2vfX1SV4X_VG0jXdK1KJzWJ5tJ4CHFxy0,12037
|
|
21
21
|
ins_pricing/cli/utils/run_logging.py,sha256=V3Wh2EV6c1Mo0QTvfe4hl2J4LOR6bdQsT210o__YBWk,3677
|
|
22
|
-
ins_pricing/docs/
|
|
22
|
+
ins_pricing/docs/LOSS_FUNCTIONS.md,sha256=PCiHcVHaEpwSLQEXZzusQxojY4UmmTHmVxIpSmacGsI,2381
|
|
23
|
+
ins_pricing/docs/modelling/BayesOpt_USAGE.md,sha256=O5A50RT-drWsEhKIooqWJPfTNN1AwB0166MLli0vMvw,40593
|
|
23
24
|
ins_pricing/docs/modelling/README.md,sha256=2a7m1dBnacxBKjEV9k16Qj9IPstlwwuis1QxdsMrFmA,1976
|
|
25
|
+
ins_pricing/frontend/QUICKSTART.md,sha256=uS5RuuICXt8J7BjPruoGOoAnTBjzgaNpwqemmUqZrZ4,4488
|
|
26
|
+
ins_pricing/frontend/README.md,sha256=LGcaCCz-OyCFfOty-4Poplsy3xgAC2YHMi6Sel-sTSU,11897
|
|
27
|
+
ins_pricing/frontend/__init__.py,sha256=KeL6QbUGAzWKbjGyZi_u7p289Zv5yslRCNZ6wHWY63Q,335
|
|
28
|
+
ins_pricing/frontend/app.py,sha256=tG3-cjxhtnbi2LZW2OcfklrVxbGRjiW2-HVsLee9FxY,36377
|
|
29
|
+
ins_pricing/frontend/config_builder.py,sha256=pKeWaC2KD3Slub5sJLetqBJVdBy01dcfmReJuf-8LCo,12230
|
|
30
|
+
ins_pricing/frontend/example_config.json,sha256=aDXH9_5bVlIclwMWH5WfgK572LVuraNbj4565o3d71k,741
|
|
31
|
+
ins_pricing/frontend/example_workflows.py,sha256=7iuFOIhN6l__3AVDkhDU7zvi2oWx_Z9lktpATPM336s,36813
|
|
32
|
+
ins_pricing/frontend/ft_workflow.py,sha256=CWrviErHEjZ2NPibIbPh69AYKPVkn-mXY7uncPihn-0,11206
|
|
33
|
+
ins_pricing/frontend/runner.py,sha256=0OB7C04PHpU04VrzZlEE-zOWrbdk5aztRck2BXKzbTc,13471
|
|
24
34
|
ins_pricing/governance/README.md,sha256=XnXLS5RPzWhEiicJ3WtGmpN935jppHhPftA9Lo2DPnQ,511
|
|
25
35
|
ins_pricing/governance/__init__.py,sha256=d8tiDhOvHvAvgSohY1xv0vuEeHj8Gl1apQtw7ryEKM0,517
|
|
26
36
|
ins_pricing/governance/approval.py,sha256=cjJQjU1ziR-d-9wVSXyMyX6S5zijJqDWERZNxjqGAUE,2879
|
|
@@ -36,30 +46,31 @@ ins_pricing/modelling/core/bayesopt/PHASE3_REFACTORING_SUMMARY.md,sha256=B8ZEzaL
|
|
|
36
46
|
ins_pricing/modelling/core/bayesopt/REFACTORING_SUMMARY.md,sha256=hJZKXe9-bBGJVN_5c5l8nHQ1X7NK4BbeE-uXQoH0rAM,7479
|
|
37
47
|
ins_pricing/modelling/core/bayesopt/__init__.py,sha256=nj6IA0r7D5U5-hYyiwXmcp_bEtoU-hRJ_prdtRmLMg0,2070
|
|
38
48
|
ins_pricing/modelling/core/bayesopt/config_components.py,sha256=OjRyM1EuSXL9_3THD1nGLRsioJs7lO_ZKVZDkUA3LX8,12156
|
|
39
|
-
ins_pricing/modelling/core/bayesopt/config_preprocess.py,sha256=
|
|
40
|
-
ins_pricing/modelling/core/bayesopt/core.py,sha256=
|
|
49
|
+
ins_pricing/modelling/core/bayesopt/config_preprocess.py,sha256=WaoVqxi9WcS7Xat7q91bUP65fTZJdtVfx8G558F-YvU,21270
|
|
50
|
+
ins_pricing/modelling/core/bayesopt/core.py,sha256=1m4pCrPP3iYIfU6QX3j6Eczjwz3-cD4ySzv9bll3PGg,44474
|
|
41
51
|
ins_pricing/modelling/core/bayesopt/model_explain_mixin.py,sha256=jCk1zPpwgwBBCndaq-A0_cQnc4RHueh2p5cAuE9ArTo,11620
|
|
42
52
|
ins_pricing/modelling/core/bayesopt/model_plotting_mixin.py,sha256=lD0rUvWV4eWatmTzMrmAUm2Flj8uAOa3R9S2JyYV94k,21807
|
|
43
53
|
ins_pricing/modelling/core/bayesopt/utils.py,sha256=fTDqBHCxsOVte0QhPqnMw8vkefIvkppufIRkt9iHqjU,2852
|
|
44
54
|
ins_pricing/modelling/core/bayesopt/utils_backup.py,sha256=5RKizpR3j6KwR87WqqaXPtgjQXWPW4vM75sIkx38SSM,57924
|
|
45
55
|
ins_pricing/modelling/core/bayesopt/models/__init__.py,sha256=vFFCkGnO6rm50TbxR6QekKKQjq-NW4UFwog6fng8-p8,700
|
|
46
56
|
ins_pricing/modelling/core/bayesopt/models/model_ft_components.py,sha256=oDhmJQ26zF0PhoDC5Z2McA-JpLbXFQjSREqy0w_hWlQ,11883
|
|
47
|
-
ins_pricing/modelling/core/bayesopt/models/model_ft_trainer.py,sha256=
|
|
48
|
-
ins_pricing/modelling/core/bayesopt/models/model_gnn.py,sha256=
|
|
49
|
-
ins_pricing/modelling/core/bayesopt/models/model_resn.py,sha256=
|
|
57
|
+
ins_pricing/modelling/core/bayesopt/models/model_ft_trainer.py,sha256=jk9pm7IzVLG8YYOneW1DPsULulbF9PQ9nNJ8EOlHF5I,39754
|
|
58
|
+
ins_pricing/modelling/core/bayesopt/models/model_gnn.py,sha256=blCTgML-fMkHDerzwoJZPw2XnEvuwVR_U5t0YWE1lZI,32901
|
|
59
|
+
ins_pricing/modelling/core/bayesopt/models/model_resn.py,sha256=Pddu0q04Sz8RwKqjP0fv4xXWd6KobwMsD47sCDBbB-Y,17581
|
|
50
60
|
ins_pricing/modelling/core/bayesopt/trainers/__init__.py,sha256=ODYKjT-v4IDxu4ohGLCXY8r1-pMME9LAaNx6pmj5_38,481
|
|
51
|
-
ins_pricing/modelling/core/bayesopt/trainers/trainer_base.py,sha256=
|
|
52
|
-
ins_pricing/modelling/core/bayesopt/trainers/trainer_ft.py,sha256=
|
|
53
|
-
ins_pricing/modelling/core/bayesopt/trainers/trainer_glm.py,sha256=
|
|
54
|
-
ins_pricing/modelling/core/bayesopt/trainers/trainer_gnn.py,sha256=
|
|
55
|
-
ins_pricing/modelling/core/bayesopt/trainers/trainer_resn.py,sha256=
|
|
56
|
-
ins_pricing/modelling/core/bayesopt/trainers/trainer_xgb.py,sha256=
|
|
61
|
+
ins_pricing/modelling/core/bayesopt/trainers/trainer_base.py,sha256=3oCKA-dcGC49ZvWwD5HXf9MFV7lJKcG3McnyFSCzl88,55163
|
|
62
|
+
ins_pricing/modelling/core/bayesopt/trainers/trainer_ft.py,sha256=w0cR81iVtER01NKIEXOl01qRH_qQc6p7mftZpTWrO00,35473
|
|
63
|
+
ins_pricing/modelling/core/bayesopt/trainers/trainer_glm.py,sha256=gMhx9IX9nz-rsf-zi9UYMtViBPD1nmQ5r8XVPGU21Ys,7912
|
|
64
|
+
ins_pricing/modelling/core/bayesopt/trainers/trainer_gnn.py,sha256=nPaiKXPNsN1NT6xuMLsLsGd3AbzftgLLFU9yTj7j-_M,14225
|
|
65
|
+
ins_pricing/modelling/core/bayesopt/trainers/trainer_resn.py,sha256=8O_kmdir8zJy9DNT9VASp4ZDE_fKH_-Lj63BW4CI9Z0,11799
|
|
66
|
+
ins_pricing/modelling/core/bayesopt/trainers/trainer_xgb.py,sha256=NlEqH0wxe5frwxXNTeymWX5_qC3_rIzF3QjDZz4RBMg,13752
|
|
57
67
|
ins_pricing/modelling/core/bayesopt/utils/__init__.py,sha256=dbf4DrWOH4rABOuaZdBF7drYOBH5prjvM0TexT6DYyg,1911
|
|
58
68
|
ins_pricing/modelling/core/bayesopt/utils/constants.py,sha256=0ihYxGlJ8tIElYvkhIDe5FfJShegvu29WZ_Xvfqa0iE,5790
|
|
59
69
|
ins_pricing/modelling/core/bayesopt/utils/distributed_utils.py,sha256=cu01dHyYE5EREbmtJgCHSH6z5mQIqajz8_-oWZV6zVc,5787
|
|
60
70
|
ins_pricing/modelling/core/bayesopt/utils/io_utils.py,sha256=vXDlAc_taCG2joxnC6wu0jVYA76UhRbX9OT_5z_im-E,3857
|
|
61
|
-
ins_pricing/modelling/core/bayesopt/utils/
|
|
62
|
-
ins_pricing/modelling/core/bayesopt/utils/
|
|
71
|
+
ins_pricing/modelling/core/bayesopt/utils/losses.py,sha256=yn3ggeM1NRkCzcTt_Nef_EvpD6Pb_jGs49bj-VV4uWU,3894
|
|
72
|
+
ins_pricing/modelling/core/bayesopt/utils/metrics_and_devices.py,sha256=kfQZnGE8FvGfl7WsTFShGGIA_sQhp5Th9mrwUXphiNQ,21200
|
|
73
|
+
ins_pricing/modelling/core/bayesopt/utils/torch_trainer_mixin.py,sha256=35suek4OfV29jfBdqh2tA-76JUlwc18m9H3L2HAmB70,25337
|
|
63
74
|
ins_pricing/modelling/explain/__init__.py,sha256=CPoGzGu8TTO3FOXjxoXC13VkuIDCf3YTH6L3BqJq3Ok,1171
|
|
64
75
|
ins_pricing/modelling/explain/gradients.py,sha256=9TqCws_p49nFxVMcjVxe4KCZ7frezeL0uV_LCdoM5yo,11088
|
|
65
76
|
ins_pricing/modelling/explain/metrics.py,sha256=K_xOY7ZrHWhbJ79RNB7eXN3VXeTe8vq68ZLH2BlZufA,5389
|
|
@@ -82,7 +93,7 @@ ins_pricing/pricing/rate_table.py,sha256=llDW95i7gR6cCtGFwcGqgpgFvOOPCURaJWmuQw1
|
|
|
82
93
|
ins_pricing/production/__init__.py,sha256=plUjyiwxrzHDDgXKezyGp9UHOg7Mav4f0ryXYtNmbfs,885
|
|
83
94
|
ins_pricing/production/drift.py,sha256=q_oE_h2NbVETTBkh9QUu8Y68ERuFFcrfKpOb3zBcvsA,383
|
|
84
95
|
ins_pricing/production/monitoring.py,sha256=A6Hyc5WSKhFkDZOIrqmFteuDee75CdcwdTq644vrk-U,4836
|
|
85
|
-
ins_pricing/production/predict.py,sha256=
|
|
96
|
+
ins_pricing/production/predict.py,sha256=Robvp63tlxqWJhgiZ3BoC4slX8qYJRh4GrM4L4BGycw,24571
|
|
86
97
|
ins_pricing/production/preprocess.py,sha256=cl20X0rVcKNCjVJswB8SdHffMgox6Qga4Ac29L6pW5g,9404
|
|
87
98
|
ins_pricing/production/scoring.py,sha256=yFmMmbYb7w_RC4uZOCMnAjLMRcjXQWIuT1nsfu-bwuc,1379
|
|
88
99
|
ins_pricing/reporting/README.md,sha256=kTVdB6pNewwh1HlCHrI2SzWTgprtQoQprLRQ2qLdgNA,486
|
|
@@ -115,12 +126,12 @@ ins_pricing/tests/production/test_scoring.py,sha256=fKz2tJomodrRt333apCrjtyJCwg9
|
|
|
115
126
|
ins_pricing/utils/__init__.py,sha256=ovtolxOvlYp_1SOxZ35OPBdn7JB2O4idzRSQgIlzCvc,2339
|
|
116
127
|
ins_pricing/utils/device.py,sha256=fePvqSaOkzHMBbrHCXAOCKRwdcR8YtiGI5K8Q3ljXJc,7543
|
|
117
128
|
ins_pricing/utils/logging.py,sha256=_AKB4ErmvygwGLtu7Ai7ESemj6Hh8FTgh4cs8j_gVW4,2258
|
|
118
|
-
ins_pricing/utils/metrics.py,sha256=
|
|
129
|
+
ins_pricing/utils/metrics.py,sha256=p4g6S1umtXh5-W9I86YJV7qlJm63ik0GvgsDW91kmQw,9313
|
|
119
130
|
ins_pricing/utils/paths.py,sha256=o_tBiclFvBci4cYg9WANwKPxrMcglEdOjDP-EZgGjdQ,8749
|
|
120
131
|
ins_pricing/utils/profiling.py,sha256=kmbykHLcYywlZxAf_aVU8HXID3zOvUcBoO5Q58AijhA,11132
|
|
121
132
|
ins_pricing/utils/torch_compat.py,sha256=UrRsqx2qboDG8WE0OmxNOi08ojwE-dCxTQh0N2s3Rgw,2441
|
|
122
133
|
ins_pricing/utils/validation.py,sha256=4Tw9VUJPk0N-WO3YUqZP-xXRl1Xpubkm0vi3WzzZrv4,13348
|
|
123
|
-
ins_pricing-0.
|
|
124
|
-
ins_pricing-0.
|
|
125
|
-
ins_pricing-0.
|
|
126
|
-
ins_pricing-0.
|
|
134
|
+
ins_pricing-0.4.0.dist-info/METADATA,sha256=9J_xcEhe5rR7E8wprEJ6qQnu_s1BlIhYWGcUno93eko,6263
|
|
135
|
+
ins_pricing-0.4.0.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
136
|
+
ins_pricing-0.4.0.dist-info/top_level.txt,sha256=haZuNQpHKNBEPZx3NjLnHp8pV3I_J9QG8-HyJn00FA0,12
|
|
137
|
+
ins_pricing-0.4.0.dist-info/RECORD,,
|
|
File without changes
|