workbench 0.8.170__py3-none-any.whl → 0.8.172__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.
Potentially problematic release.
This version of workbench might be problematic. Click here for more details.
- workbench/api/feature_set.py +4 -4
- workbench/core/artifacts/artifact.py +11 -3
- workbench/core/artifacts/model_core.py +37 -14
- workbench/core/cloud_platform/aws/aws_account_clamp.py +4 -1
- workbench/core/cloud_platform/aws/aws_meta.py +11 -4
- workbench/core/transforms/features_to_model/features_to_model.py +4 -4
- workbench/model_scripts/custom_models/uq_models/generated_model_script.py +319 -210
- workbench/model_scripts/custom_models/uq_models/mapie.template +502 -0
- workbench/model_scripts/custom_models/uq_models/meta_uq.template +154 -41
- workbench/model_scripts/custom_models/uq_models/ngboost.template +15 -2
- workbench/model_scripts/custom_models/uq_models/requirements.txt +1 -3
- workbench/model_scripts/script_generation.py +5 -0
- workbench/model_scripts/xgb_model/generated_model_script.py +11 -11
- workbench/model_scripts/xgb_model/xgb_model.template +7 -7
- workbench/scripts/{ml_pipeline_launcher.py → ml_pipeline_batch.py} +1 -1
- workbench/scripts/ml_pipeline_sqs.py +139 -0
- workbench/utils/model_utils.py +13 -1
- workbench/utils/workbench_sqs.py +1 -1
- workbench/utils/xgboost_model_utils.py +1 -0
- workbench/web_interface/components/plugins/dashboard_status.py +3 -1
- {workbench-0.8.170.dist-info → workbench-0.8.172.dist-info}/METADATA +1 -1
- {workbench-0.8.170.dist-info → workbench-0.8.172.dist-info}/RECORD +26 -25
- {workbench-0.8.170.dist-info → workbench-0.8.172.dist-info}/entry_points.txt +2 -1
- workbench/model_scripts/custom_models/uq_models/mapie_xgb.template +0 -203
- {workbench-0.8.170.dist-info → workbench-0.8.172.dist-info}/WHEEL +0 -0
- {workbench-0.8.170.dist-info → workbench-0.8.172.dist-info}/licenses/LICENSE +0 -0
- {workbench-0.8.170.dist-info → workbench-0.8.172.dist-info}/top_level.txt +0 -0
workbench/utils/workbench_sqs.py
CHANGED
|
@@ -12,7 +12,7 @@ class WorkbenchSQS:
|
|
|
12
12
|
self.log = logging.getLogger("workbench")
|
|
13
13
|
self.queue_url = queue_url
|
|
14
14
|
|
|
15
|
-
# Grab a Workbench Session
|
|
15
|
+
# Grab a Workbench Session
|
|
16
16
|
self.boto3_session = AWSAccountClamp().boto3_session
|
|
17
17
|
print(self.boto3_session)
|
|
18
18
|
|
|
@@ -57,6 +57,7 @@ def xgboost_model_from_s3(model_artifact_uri: str):
|
|
|
57
57
|
patterns = [
|
|
58
58
|
# Direct XGBoost model files
|
|
59
59
|
os.path.join(tmpdir, "xgboost-model"),
|
|
60
|
+
os.path.join(tmpdir, "xgb_model*.json"),
|
|
60
61
|
os.path.join(tmpdir, "model"),
|
|
61
62
|
os.path.join(tmpdir, "*.bin"),
|
|
62
63
|
os.path.join(tmpdir, "**", "*model*.json"),
|
|
@@ -72,7 +72,9 @@ class DashboardStatus(PluginInterface):
|
|
|
72
72
|
details = "**Redis:** 🔴 Failed to Connect<br>"
|
|
73
73
|
|
|
74
74
|
# Fill in the license details
|
|
75
|
-
|
|
75
|
+
redis_host = config_info.get("REDIS_HOST", "NOT SET")
|
|
76
|
+
redis_port = config_info.get("REDIS_PORT", "NOT SET")
|
|
77
|
+
details += f"**Redis Server:** {redis_host}:{redis_port}<br>"
|
|
76
78
|
details += f"**Workbench S3 Bucket:** {config_info['WORKBENCH_BUCKET']}<br>"
|
|
77
79
|
details += f"**Plugin Path:** {config_info.get('WORKBENCH_PLUGINS', 'unknown')}<br>"
|
|
78
80
|
details += f"**Themes Path:** {config_info.get('WORKBENCH_THEMES', 'unknown')}<br>"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: workbench
|
|
3
|
-
Version: 0.8.
|
|
3
|
+
Version: 0.8.172
|
|
4
4
|
Summary: Workbench: A Dashboard and Python API for creating and deploying AWS SageMaker Model Pipelines
|
|
5
5
|
Author-email: SuperCowPowers LLC <support@supercowpowers.com>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -32,7 +32,7 @@ workbench/api/compound.py,sha256=BHd3Qu4Ra45FEuwiowhFfGMI_HKRRB10XMmoS6ljKrM,254
|
|
|
32
32
|
workbench/api/data_source.py,sha256=Ngz36YZWxFfpJbmURhM1LQPYjh5kdpZNGo6_fCRePbA,8321
|
|
33
33
|
workbench/api/df_store.py,sha256=Wybb3zO-jPpAi2Ns8Ks1-lagvXAaBlRpBZHhnnl3Lms,6131
|
|
34
34
|
workbench/api/endpoint.py,sha256=RWGqxsCW_pMiENMb_XZlm2ZCldMS4suEBM3F5gT3hYI,3814
|
|
35
|
-
workbench/api/feature_set.py,sha256=
|
|
35
|
+
workbench/api/feature_set.py,sha256=Yxei3tvWR4gSLcdJnNndux07dNeKNu1HKgsChJtHxEM,6633
|
|
36
36
|
workbench/api/graph_store.py,sha256=LremJyPrQFgsHb7hxsctuCsoxx3p7TKtaY5qALHe6pc,4372
|
|
37
37
|
workbench/api/meta.py,sha256=1_9989cPvf3hd3tA-83hLijOGNnhwXAF8aZF45adeDQ,8596
|
|
38
38
|
workbench/api/model.py,sha256=RkFVXnlLcMlzNKRUFr_GCmZ7IQJMyhB2lwMwd22HBBo,4691
|
|
@@ -48,21 +48,21 @@ workbench/cached/cached_model.py,sha256=iMc_fySUE5qau3feduVXMNb24JY0sBjt1g6WeLLc
|
|
|
48
48
|
workbench/cached/cached_pipeline.py,sha256=QOVnEKu5RbIdlNpJUi-0Ebh0_-C68RigSPwKh4dvZTM,1948
|
|
49
49
|
workbench/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
50
50
|
workbench/core/artifacts/__init__.py,sha256=ps7rA_rbWnDbvWbg4kvu--IKMY8WmbPRyv4Si0xub1Q,965
|
|
51
|
-
workbench/core/artifacts/artifact.py,sha256=
|
|
51
|
+
workbench/core/artifacts/artifact.py,sha256=AtTw8wfMd-fi7cHJHsBAXHUk53kRW_6lyBwwsIbHw54,17750
|
|
52
52
|
workbench/core/artifacts/athena_source.py,sha256=RNmCe7s6uH4gVHpcdJcL84aSbF5Q1ahJBLLGwHYRXEU,26081
|
|
53
53
|
workbench/core/artifacts/cached_artifact_mixin.py,sha256=ngqFLZ4cQx_TFouXZgXZQsv_7W6XCvxVGXXSfzzaft8,3775
|
|
54
54
|
workbench/core/artifacts/data_source_abstract.py,sha256=5IRCzFVK-17cd4NXPMRfx99vQAmQ0WHE5jcm5RfsVTg,10619
|
|
55
55
|
workbench/core/artifacts/data_source_factory.py,sha256=YL_tA5fsgubbB3dPF6T4tO0rGgz-6oo3ge4i_YXVC-M,2380
|
|
56
56
|
workbench/core/artifacts/endpoint_core.py,sha256=CtLo_eqONpDvyyYtjRkrrujVVv6cJV-vRQxHef6MYdk,48841
|
|
57
57
|
workbench/core/artifacts/feature_set_core.py,sha256=055VdSYR09HP4ygAuYvIYtHQ7Ec4XxsZygpgEl5H5jQ,29136
|
|
58
|
-
workbench/core/artifacts/model_core.py,sha256=
|
|
58
|
+
workbench/core/artifacts/model_core.py,sha256=6d5dV4DGUBgD9E_Gpk0F5x7OEc4oiDKokvA8m42vnK4,51724
|
|
59
59
|
workbench/core/artifacts/monitor_core.py,sha256=BvJ8gMxZXYZeMzAC25PVTXWiyXKtxD1qK6LqDcIByzs,37657
|
|
60
60
|
workbench/core/cloud_platform/cloud_meta.py,sha256=-g4-LTC3D0PXb3VfaXdLR1ERijKuHdffeMK_zhD-koQ,8809
|
|
61
61
|
workbench/core/cloud_platform/aws/README.md,sha256=QT5IQXoUHbIA0qQ2wO6_2P2lYjYQFVYuezc22mWY4i8,97
|
|
62
|
-
workbench/core/cloud_platform/aws/aws_account_clamp.py,sha256=
|
|
62
|
+
workbench/core/cloud_platform/aws/aws_account_clamp.py,sha256=vAVC_HEk1YGSlo5F2bhQlWUxPN2QgRe3ht73O42faWQ,6452
|
|
63
63
|
workbench/core/cloud_platform/aws/aws_df_store.py,sha256=utRIlTCPwFneHHZ8_Z3Hw3rOJSeryiFA4wBtucxULRQ,15055
|
|
64
64
|
workbench/core/cloud_platform/aws/aws_graph_store.py,sha256=ytYxQTplUmeWbsPmxyZbf6mO9qyTl60ewlJG8MyfyEY,9414
|
|
65
|
-
workbench/core/cloud_platform/aws/aws_meta.py,sha256=
|
|
65
|
+
workbench/core/cloud_platform/aws/aws_meta.py,sha256=eY9Pn6pl2yAyseACFb2nitR-0vLwG4i8CSEXe8Iaswc,34778
|
|
66
66
|
workbench/core/cloud_platform/aws/aws_parameter_store.py,sha256=9ekuMOQFHFMIEV68UbHhS_fLB9iqG5Hvu4EV6iamEpk,10400
|
|
67
67
|
workbench/core/cloud_platform/aws/aws_secrets_manager.py,sha256=TUnddp1gX-OwxJ_oO5ONh7OI4Z2HC_6euGkJ-himCCk,8615
|
|
68
68
|
workbench/core/cloud_platform/aws/aws_session.py,sha256=2Gc_k4Q87BBeQDgXgVR-w-qmsF6ncZR8wvTeNnixM6k,6926
|
|
@@ -101,7 +101,7 @@ workbench/core/transforms/features_to_features/__init__.py,sha256=47DEQpj8HBSa-_
|
|
|
101
101
|
workbench/core/transforms/features_to_features/heavy/emr/Readme.md,sha256=YtQgCEQeKe0CQXQkhzMTYq9xOtCsCYb5P5LW2BmRKWQ,68
|
|
102
102
|
workbench/core/transforms/features_to_features/heavy/glue/Readme.md,sha256=TuyCatWfoDr99zUwvOcxf-TqMkQzaMqXlj5nmFcRzfo,48
|
|
103
103
|
workbench/core/transforms/features_to_model/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
104
|
-
workbench/core/transforms/features_to_model/features_to_model.py,sha256=
|
|
104
|
+
workbench/core/transforms/features_to_model/features_to_model.py,sha256=ALGH5UmCdMYv4Fs2ebh6qMlwzt34xYkVSMpn4YfPbaA,19773
|
|
105
105
|
workbench/core/transforms/model_to_endpoint/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
106
106
|
workbench/core/transforms/model_to_endpoint/model_to_endpoint.py,sha256=TIYXvuK0s383PwJ4iS6fCRhuif6oIxsoWb4CpMGJjY4,6358
|
|
107
107
|
workbench/core/transforms/pandas_transforms/__init__.py,sha256=xL4MT8-fZ1SFqDbTLc8XyxjupHtB1YR6Ej0AC2nwd7I,894
|
|
@@ -121,7 +121,7 @@ workbench/core/views/training_view.py,sha256=mUkv1oVhDG-896RdLNKxCg0j0yvudEcPnvL
|
|
|
121
121
|
workbench/core/views/view.py,sha256=Ujzw6zLROP9oKfKm3zJwaOyfpyjh5uM9fAu1i3kUOig,11764
|
|
122
122
|
workbench/core/views/view_utils.py,sha256=y0YuPW-90nAfgAD1UW_49-j7Mvncfm7-5rV8I_97CK8,12274
|
|
123
123
|
workbench/core/views/storage/mdq_view.py,sha256=qf_ep1KwaXOIfO930laEwNIiCYP7VNOqjE3VdHfopRE,5195
|
|
124
|
-
workbench/model_scripts/script_generation.py,sha256=
|
|
124
|
+
workbench/model_scripts/script_generation.py,sha256=dL23XYwEsHIStc7i53DtF_47FqOrI9gq0kQAT6sNpZ8,7923
|
|
125
125
|
workbench/model_scripts/custom_models/chem_info/Readme.md,sha256=mH1lxJ4Pb7F5nBnVXaiuxpi8zS_yjUw_LBJepVKXhlA,574
|
|
126
126
|
workbench/model_scripts/custom_models/chem_info/local_utils.py,sha256=Rsz_VRoA3O3-VoitmN8o5OymstsF433QgdSRHc-iZ24,29071
|
|
127
127
|
workbench/model_scripts/custom_models/chem_info/molecular_descriptors.py,sha256=E8SK4oOHaYnYx4ycQJ6R7yg799kjtbipM3KEc8SPArQ,3011
|
|
@@ -139,12 +139,12 @@ workbench/model_scripts/custom_models/uq_models/Readme.md,sha256=UVpL-lvtTrLqwBe
|
|
|
139
139
|
workbench/model_scripts/custom_models/uq_models/bayesian_ridge.template,sha256=U4LIlpp8Rbu3apyzPR7-55lvlutpTsCro_PUvQ5pklY,6457
|
|
140
140
|
workbench/model_scripts/custom_models/uq_models/ensemble_xgb.template,sha256=0IJnSBACQ556ldEiPqR7yPCOOLJs1hQhHmPBvB2d9tY,13491
|
|
141
141
|
workbench/model_scripts/custom_models/uq_models/gaussian_process.template,sha256=QbDUfkiPCwJ-c-4Twgu4utZuYZaAyeW_3T1IP-_tutw,6683
|
|
142
|
-
workbench/model_scripts/custom_models/uq_models/generated_model_script.py,sha256=
|
|
143
|
-
workbench/model_scripts/custom_models/uq_models/
|
|
144
|
-
workbench/model_scripts/custom_models/uq_models/meta_uq.template,sha256=
|
|
145
|
-
workbench/model_scripts/custom_models/uq_models/ngboost.template,sha256=
|
|
142
|
+
workbench/model_scripts/custom_models/uq_models/generated_model_script.py,sha256=Xu-bzX-8_uiV6USRQOmS2G-D_33XTSM9Gixt8wzOY40,21535
|
|
143
|
+
workbench/model_scripts/custom_models/uq_models/mapie.template,sha256=D94Y3U7IruGQlu9m6gXyLRjm502qZafYrwhEM9GP6oE,18337
|
|
144
|
+
workbench/model_scripts/custom_models/uq_models/meta_uq.template,sha256=eawh0Fp3DhbdCXzWN6KloczT5ZS_ou4ayW65yUTTE4o,14109
|
|
145
|
+
workbench/model_scripts/custom_models/uq_models/ngboost.template,sha256=9-O6P-SW50ul5Wl6es2DMWXSbrwOg7HWsdc8Qdln0MM,8278
|
|
146
146
|
workbench/model_scripts/custom_models/uq_models/proximity.py,sha256=zqmNlX70LnWXr5fdtFFQppSNTLjlOciQVrjGr-g9jRE,13716
|
|
147
|
-
workbench/model_scripts/custom_models/uq_models/requirements.txt,sha256=
|
|
147
|
+
workbench/model_scripts/custom_models/uq_models/requirements.txt,sha256=fw7T7t_YJAXK3T6Ysbesxh_Agx_tv0oYx72cEBTqRDY,98
|
|
148
148
|
workbench/model_scripts/custom_script_example/custom_model_script.py,sha256=T8aydawgRVAdSlDimoWpXxG2YuWWQkbcjBVjAeSG2_0,6408
|
|
149
149
|
workbench/model_scripts/custom_script_example/requirements.txt,sha256=jWlGc7HH7vqyukTm38LN4EyDi8jDUPEay4n45z-30uc,104
|
|
150
150
|
workbench/model_scripts/ensemble_xgb/ensemble_xgb.template,sha256=s8tPPk_q6UqA2nAzknD8viA-kN7f62Rim2XwMKcqHKc,10399
|
|
@@ -158,16 +158,17 @@ workbench/model_scripts/quant_regression/requirements.txt,sha256=jWlGc7HH7vqyukT
|
|
|
158
158
|
workbench/model_scripts/scikit_learn/generated_model_script.py,sha256=c73ZpJBlU5k13Nx-ZDkLXu7da40CYyhwjwwmuPq6uLg,12870
|
|
159
159
|
workbench/model_scripts/scikit_learn/requirements.txt,sha256=aVvwiJ3LgBUhM_PyFlb2gHXu_kpGPho3ANBzlOkfcvs,107
|
|
160
160
|
workbench/model_scripts/scikit_learn/scikit_learn.template,sha256=d4pgeZYFezUQsB-7iIsjsUgB1FM6d27651wpfDdXmI0,12640
|
|
161
|
-
workbench/model_scripts/xgb_model/generated_model_script.py,sha256=
|
|
161
|
+
workbench/model_scripts/xgb_model/generated_model_script.py,sha256=nU9BLU0wIhK066HAgChgNLcuOM94vBqweoH8xB8wBeo,21152
|
|
162
162
|
workbench/model_scripts/xgb_model/requirements.txt,sha256=jWlGc7HH7vqyukTm38LN4EyDi8jDUPEay4n45z-30uc,104
|
|
163
|
-
workbench/model_scripts/xgb_model/xgb_model.template,sha256=
|
|
163
|
+
workbench/model_scripts/xgb_model/xgb_model.template,sha256=HViJRsMWn393hP8VJRS45UQBzUVBhwR5sKc8Ern-9f4,17963
|
|
164
164
|
workbench/repl/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
165
165
|
workbench/repl/workbench_shell.py,sha256=eJ3rpYgEwZjhrVVCaJHht2N5BrimN6mbxqHXGrJmwC8,22130
|
|
166
166
|
workbench/resources/open_source_api.key,sha256=3S0OTblsmC0msUPdE_dbBmI83xJNmYscuwLJ57JmuOc,433
|
|
167
167
|
workbench/resources/signature_verify_pub.pem,sha256=V3-u-3_z2PH-805ybkKvzDOBwAbvHxcKn0jLBImEtzM,272
|
|
168
168
|
workbench/scripts/check_double_bond_stereo.py,sha256=p5hnL54Weq77ES0HCELq9JeoM-PyUGkvVSeWYF2dKyo,7776
|
|
169
169
|
workbench/scripts/glue_launcher.py,sha256=bIKQvfGxpAhzbeNvTnHfRW_5kQhY-169_868ZnCejJk,10692
|
|
170
|
-
workbench/scripts/
|
|
170
|
+
workbench/scripts/ml_pipeline_batch.py,sha256=1T5JnLlUJR7bwAGBLHmLPOuj1xFRqVIQX8PsuDhHy8o,4907
|
|
171
|
+
workbench/scripts/ml_pipeline_sqs.py,sha256=7w67UUuZNYnxXiZG48gpoEFbH-c_cUfjMg0FgWI0DbQ,5100
|
|
171
172
|
workbench/scripts/monitor_cloud_watch.py,sha256=s7MY4bsHts0nup9G0lWESCvgJZ9Mw1Eo-c8aKRgLjMw,9235
|
|
172
173
|
workbench/scripts/redis_expire.py,sha256=DxI_RKSNlrW2BsJZXcsSbaWGBgPZdPhtzHjV9SUtElE,1120
|
|
173
174
|
workbench/scripts/redis_report.py,sha256=iaJSuGPyLCs6e0TMcZDoT0YyJ43xJ1u74YD8FLnnUg4,990
|
|
@@ -219,7 +220,7 @@ workbench/utils/lambda_utils.py,sha256=7GhGRPyXn9o-toWb9HBGSnI8-DhK9YRkwhCSk_mNK
|
|
|
219
220
|
workbench/utils/license_manager.py,sha256=sDuhk1mZZqUbFmnuFXehyGnui_ALxrmYBg7gYwoo7ho,6975
|
|
220
221
|
workbench/utils/log_utils.py,sha256=7n1NJXO_jUX82e6LWAQug6oPo3wiPDBYsqk9gsYab_A,3167
|
|
221
222
|
workbench/utils/markdown_utils.py,sha256=4lEqzgG4EVmLcvvKKNUwNxVCySLQKJTJmWDiaDroI1w,8306
|
|
222
|
-
workbench/utils/model_utils.py,sha256=
|
|
223
|
+
workbench/utils/model_utils.py,sha256=JeEztmFyDJ7yqRozDX0L6apuhLgKx1sgNlO5duB73qc,11938
|
|
223
224
|
workbench/utils/monitor_utils.py,sha256=ywoEdqoHY9t5PYRstjitS_halEWO6veCL_06BekmMVo,9153
|
|
224
225
|
workbench/utils/pandas_utils.py,sha256=LQTfZ3WJkg3rIahNJhsz1YV2y_0DBG94lO-KMmEY1g0,39325
|
|
225
226
|
workbench/utils/performance_utils.py,sha256=WDNvz-bOdC99cDuXl0urAV4DJ7alk_V3yzKPwvqgST4,1329
|
|
@@ -241,8 +242,8 @@ workbench/utils/type_abbrev.py,sha256=3ai7ZbE8BgvdotOSb48w_BmgrEGVYvLoyzoNYH8ZuO
|
|
|
241
242
|
workbench/utils/workbench_cache.py,sha256=IQchxB81iR4eVggHBxUJdXxUCRkqWz1jKe5gxN3z6yc,5657
|
|
242
243
|
workbench/utils/workbench_event_bridge.py,sha256=z1GmXOB-Qs7VOgC6Hjnp2DI9nSEWepaSXejACxTIR7o,4150
|
|
243
244
|
workbench/utils/workbench_logging.py,sha256=WCuMWhQwibrvcGAyj96h2wowh6dH7zNlDJ7sWUzdCeI,10263
|
|
244
|
-
workbench/utils/workbench_sqs.py,sha256=
|
|
245
|
-
workbench/utils/xgboost_model_utils.py,sha256=
|
|
245
|
+
workbench/utils/workbench_sqs.py,sha256=RwM80z7YWwdtMaCKh7KWF8v38f7eBRU7kyC7ZhTRuI0,2072
|
|
246
|
+
workbench/utils/xgboost_model_utils.py,sha256=iiDJH0O81aO6aOTwgssqQygvTgjE7lRDRzLJ_fI3RVs,15554
|
|
246
247
|
workbench/web_interface/components/component_interface.py,sha256=QCPWqiZLkVsAEzQFEQxFelk7H0UF5uI2dVvJNf0lRV4,7980
|
|
247
248
|
workbench/web_interface/components/correlation_matrix.py,sha256=Lv4vRta5-TdxBsu0G8Ea7hyyR3XyPes-k5AfL6qZWEc,6376
|
|
248
249
|
workbench/web_interface/components/data_details_markdown.py,sha256=axDs6eXniglBmvFwIKjpJ5oyT-3D4FO9IcfA_cl-EJ8,9706
|
|
@@ -256,7 +257,7 @@ workbench/web_interface/components/experiments/dashboard_metric_plots.py,sha256=
|
|
|
256
257
|
workbench/web_interface/components/experiments/outlier_plot.py,sha256=5bWsmJEXyt50npeQxLHXCPtiq4WRVgg938Sl0DVjNWg,3647
|
|
257
258
|
workbench/web_interface/components/plugins/ag_table.py,sha256=HrPOMotlOGigk0v8Cxx_doSHXdOKTT1-bzlsqDwwzng,3979
|
|
258
259
|
workbench/web_interface/components/plugins/confusion_matrix.py,sha256=1K94JSlDwQwdf5uDYVydQzY-EQm89hYXchxbXoNvons,7176
|
|
259
|
-
workbench/web_interface/components/plugins/dashboard_status.py,sha256=
|
|
260
|
+
workbench/web_interface/components/plugins/dashboard_status.py,sha256=4plmoiXj3dDjoQerUNpep_jfk50pI9rHvcoSP20UbE8,5832
|
|
260
261
|
workbench/web_interface/components/plugins/data_details.py,sha256=pZm1AbM_0EXQwx77qUkfyrU9MedAs4Wlkp6iOtSrUtI,11104
|
|
261
262
|
workbench/web_interface/components/plugins/endpoint_details.py,sha256=0A7g_Lx5-3XnDWOGT3YEDPNpmME_-WfYc65f-rRVjJE,3769
|
|
262
263
|
workbench/web_interface/components/plugins/generated_compounds.py,sha256=hC0sh-1_rbN55Huno-E_2wF37kgIHi5Mtaer6Xk5fRM,8052
|
|
@@ -276,9 +277,9 @@ workbench/web_interface/page_views/main_page.py,sha256=X4-KyGTKLAdxR-Zk2niuLJB2Y
|
|
|
276
277
|
workbench/web_interface/page_views/models_page_view.py,sha256=M0bdC7bAzLyIaE2jviY12FF4abdMFZmg6sFuOY_LaGI,2650
|
|
277
278
|
workbench/web_interface/page_views/page_view.py,sha256=Gh6YnpOGlUejx-bHZAf5pzqoQ1H1R0OSwOpGhOBO06w,455
|
|
278
279
|
workbench/web_interface/page_views/pipelines_page_view.py,sha256=v2pxrIbsHBcYiblfius3JK766NZ7ciD2yPx0t3E5IJo,2656
|
|
279
|
-
workbench-0.8.
|
|
280
|
-
workbench-0.8.
|
|
281
|
-
workbench-0.8.
|
|
282
|
-
workbench-0.8.
|
|
283
|
-
workbench-0.8.
|
|
284
|
-
workbench-0.8.
|
|
280
|
+
workbench-0.8.172.dist-info/licenses/LICENSE,sha256=z4QMMPlLJkZjU8VOKqJkZiQZCEZ--saIU2Z8-p3aVc0,1080
|
|
281
|
+
workbench-0.8.172.dist-info/METADATA,sha256=YSJh5jhFQMb27UB6IcfAS3REU5-2g488p8U0AVRkNV8,9210
|
|
282
|
+
workbench-0.8.172.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
283
|
+
workbench-0.8.172.dist-info/entry_points.txt,sha256=zPFPruY9uayk8-wsKrhfnIyIB6jvZOW_ibyllEIsLWo,356
|
|
284
|
+
workbench-0.8.172.dist-info/top_level.txt,sha256=Dhy72zTxaA_o_yRkPZx5zw-fwumnjGaeGf0hBN3jc_w,10
|
|
285
|
+
workbench-0.8.172.dist-info/RECORD,,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
[console_scripts]
|
|
2
2
|
cloud_watch = workbench.scripts.monitor_cloud_watch:main
|
|
3
3
|
glue_launcher = workbench.scripts.glue_launcher:main
|
|
4
|
-
|
|
4
|
+
ml_pipeline_batch = workbench.scripts.ml_pipeline_batch:main
|
|
5
|
+
ml_pipeline_sqs = workbench.scripts.ml_pipeline_sqs:main
|
|
5
6
|
workbench = workbench.repl.workbench_shell:launch_shell
|
|
6
7
|
workbench_config = workbench.scripts.show_config:main
|
|
@@ -1,203 +0,0 @@
|
|
|
1
|
-
# Model: HistGradientBoosting with MAPIE Conformalized Quantile Regression
|
|
2
|
-
from mapie.regression import MapieQuantileRegressor
|
|
3
|
-
from sklearn.ensemble import HistGradientBoostingRegressor
|
|
4
|
-
from sklearn.model_selection import train_test_split
|
|
5
|
-
import numpy as np
|
|
6
|
-
|
|
7
|
-
# Template Placeholders
|
|
8
|
-
TEMPLATE_PARAMS = {
|
|
9
|
-
"features": "{{feature_list}}",
|
|
10
|
-
"target": "{{target_column}}",
|
|
11
|
-
"train_all_data": "{{train_all_data}}"
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
from io import StringIO
|
|
15
|
-
import json
|
|
16
|
-
import argparse
|
|
17
|
-
import joblib
|
|
18
|
-
import os
|
|
19
|
-
import pandas as pd
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
# Function to check if dataframe is empty
|
|
23
|
-
def check_dataframe(df: pd.DataFrame, df_name: str) -> None:
|
|
24
|
-
"""Check if the DataFrame is empty and raise an error if so."""
|
|
25
|
-
if df.empty:
|
|
26
|
-
msg = f"*** The training data {df_name} has 0 rows! ***STOPPING***"
|
|
27
|
-
print(msg)
|
|
28
|
-
raise ValueError(msg)
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
def match_features_case_insensitive(df: pd.DataFrame, model_features: list) -> pd.DataFrame:
|
|
32
|
-
"""
|
|
33
|
-
Matches and renames DataFrame columns to match model feature names (case-insensitive).
|
|
34
|
-
Prioritizes exact matches, then case-insensitive matches.
|
|
35
|
-
|
|
36
|
-
Raises ValueError if any model features cannot be matched.
|
|
37
|
-
"""
|
|
38
|
-
df_columns_lower = {col.lower(): col for col in df.columns}
|
|
39
|
-
rename_dict = {}
|
|
40
|
-
missing = []
|
|
41
|
-
for feature in model_features:
|
|
42
|
-
if feature in df.columns:
|
|
43
|
-
continue # Exact match
|
|
44
|
-
elif feature.lower() in df_columns_lower:
|
|
45
|
-
rename_dict[df_columns_lower[feature.lower()]] = feature
|
|
46
|
-
else:
|
|
47
|
-
missing.append(feature)
|
|
48
|
-
|
|
49
|
-
if missing:
|
|
50
|
-
raise ValueError(f"Features not found: {missing}")
|
|
51
|
-
|
|
52
|
-
# Rename the DataFrame columns to match the model features
|
|
53
|
-
return df.rename(columns=rename_dict)
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
# TRAINING SECTION
|
|
57
|
-
#
|
|
58
|
-
# This section (__main__) is where SageMaker will execute the training job
|
|
59
|
-
# and save the model artifacts to the model directory.
|
|
60
|
-
#
|
|
61
|
-
if __name__ == "__main__":
|
|
62
|
-
# Template Parameters
|
|
63
|
-
features = TEMPLATE_PARAMS["features"]
|
|
64
|
-
target = TEMPLATE_PARAMS["target"]
|
|
65
|
-
train_all_data = TEMPLATE_PARAMS["train_all_data"]
|
|
66
|
-
validation_split = 0.2
|
|
67
|
-
|
|
68
|
-
# Script arguments for input/output directories
|
|
69
|
-
parser = argparse.ArgumentParser()
|
|
70
|
-
parser.add_argument("--model-dir", type=str, default=os.environ.get("SM_MODEL_DIR", "/opt/ml/model"))
|
|
71
|
-
parser.add_argument("--train", type=str, default=os.environ.get("SM_CHANNEL_TRAIN", "/opt/ml/input/data/train"))
|
|
72
|
-
parser.add_argument(
|
|
73
|
-
"--output-data-dir", type=str, default=os.environ.get("SM_OUTPUT_DATA_DIR", "/opt/ml/output/data")
|
|
74
|
-
)
|
|
75
|
-
args = parser.parse_args()
|
|
76
|
-
|
|
77
|
-
# Load training data from the specified directory
|
|
78
|
-
training_files = [
|
|
79
|
-
os.path.join(args.train, file)
|
|
80
|
-
for file in os.listdir(args.train) if file.endswith(".csv")
|
|
81
|
-
]
|
|
82
|
-
df = pd.concat([pd.read_csv(file, engine="python") for file in training_files])
|
|
83
|
-
|
|
84
|
-
# Check if the DataFrame is empty
|
|
85
|
-
check_dataframe(df, "training_df")
|
|
86
|
-
|
|
87
|
-
# Training data split logic
|
|
88
|
-
if train_all_data:
|
|
89
|
-
# Use all data for both training and validation
|
|
90
|
-
print("Training on all data...")
|
|
91
|
-
df_train = df.copy()
|
|
92
|
-
df_val = df.copy()
|
|
93
|
-
elif "training" in df.columns:
|
|
94
|
-
# Split data based on a 'training' column if it exists
|
|
95
|
-
print("Splitting data based on 'training' column...")
|
|
96
|
-
df_train = df[df["training"]].copy()
|
|
97
|
-
df_val = df[~df["training"]].copy()
|
|
98
|
-
else:
|
|
99
|
-
# Perform a random split if no 'training' column is found
|
|
100
|
-
print("Splitting data randomly...")
|
|
101
|
-
df_train, df_val = train_test_split(df, test_size=validation_split, random_state=42)
|
|
102
|
-
|
|
103
|
-
# Create HistGradientBoosting base model configured for quantile regression
|
|
104
|
-
base_estimator = HistGradientBoostingRegressor(
|
|
105
|
-
loss='quantile', # Required for MAPIE CQR
|
|
106
|
-
quantile=0.5, # Will be overridden by MAPIE for different quantiles
|
|
107
|
-
max_iter=1000,
|
|
108
|
-
max_depth=6,
|
|
109
|
-
learning_rate=0.01,
|
|
110
|
-
random_state=42
|
|
111
|
-
)
|
|
112
|
-
|
|
113
|
-
# Create MAPIE CQR predictor - it will create quantile versions internally
|
|
114
|
-
model = MapieQuantileRegressor(
|
|
115
|
-
estimator=base_estimator,
|
|
116
|
-
method="quantile",
|
|
117
|
-
cv="split",
|
|
118
|
-
alpha=0.05 # For 95% coverage
|
|
119
|
-
)
|
|
120
|
-
|
|
121
|
-
# Prepare features and targets for training
|
|
122
|
-
X_train = df_train[features]
|
|
123
|
-
X_val = df_val[features]
|
|
124
|
-
y_train = df_train[target]
|
|
125
|
-
y_val = df_val[target]
|
|
126
|
-
|
|
127
|
-
# Fit the MAPIE CQR model (train/calibration is handled internally)
|
|
128
|
-
model.fit(X_train, y_train)
|
|
129
|
-
|
|
130
|
-
# Save the trained model and any necessary assets
|
|
131
|
-
joblib.dump(model, os.path.join(args.model_dir, "model.joblib"))
|
|
132
|
-
|
|
133
|
-
# Save the feature list to validate input during predictions
|
|
134
|
-
with open(os.path.join(args.model_dir, "feature_columns.json"), "w") as fp:
|
|
135
|
-
json.dump(features, fp)
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
#
|
|
139
|
-
# Inference Section
|
|
140
|
-
#
|
|
141
|
-
def model_fn(model_dir):
|
|
142
|
-
"""Load and return the model from the specified directory."""
|
|
143
|
-
return joblib.load(os.path.join(model_dir, "model.joblib"))
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
def input_fn(input_data, content_type):
|
|
147
|
-
"""Parse input data and return a DataFrame."""
|
|
148
|
-
if not input_data:
|
|
149
|
-
raise ValueError("Empty input data is not supported!")
|
|
150
|
-
|
|
151
|
-
# Decode bytes to string if necessary
|
|
152
|
-
if isinstance(input_data, bytes):
|
|
153
|
-
input_data = input_data.decode("utf-8")
|
|
154
|
-
|
|
155
|
-
if "text/csv" in content_type:
|
|
156
|
-
return pd.read_csv(StringIO(input_data))
|
|
157
|
-
elif "application/json" in content_type:
|
|
158
|
-
return pd.DataFrame(json.loads(input_data)) # Assumes JSON array of records
|
|
159
|
-
else:
|
|
160
|
-
raise ValueError(f"{content_type} not supported!")
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
def output_fn(output_df, accept_type):
|
|
164
|
-
"""Supports both CSV and JSON output formats."""
|
|
165
|
-
if "text/csv" in accept_type:
|
|
166
|
-
csv_output = output_df.fillna("N/A").to_csv(index=False) # CSV with N/A for missing values
|
|
167
|
-
return csv_output, "text/csv"
|
|
168
|
-
elif "application/json" in accept_type:
|
|
169
|
-
return output_df.to_json(orient="records"), "application/json" # JSON array of records (NaNs -> null)
|
|
170
|
-
else:
|
|
171
|
-
raise RuntimeError(f"{accept_type} accept type is not supported by this script.")
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
def predict_fn(df, model):
|
|
175
|
-
"""Make predictions using MAPIE CQR and return the DataFrame with results."""
|
|
176
|
-
model_dir = os.environ.get("SM_MODEL_DIR", "/opt/ml/model")
|
|
177
|
-
|
|
178
|
-
# Load feature columns from the saved file
|
|
179
|
-
with open(os.path.join(model_dir, "feature_columns.json")) as fp:
|
|
180
|
-
model_features = json.load(fp)
|
|
181
|
-
|
|
182
|
-
# Match features in a case-insensitive manner
|
|
183
|
-
matched_df = match_features_case_insensitive(df, model_features)
|
|
184
|
-
|
|
185
|
-
# Get CQR predictions - returns point prediction and intervals
|
|
186
|
-
X_pred = matched_df[model_features]
|
|
187
|
-
y_pred, y_pis = model.predict(X_pred)
|
|
188
|
-
|
|
189
|
-
# Add predictions to dataframe with 95% intervals
|
|
190
|
-
df["prediction"] = y_pred
|
|
191
|
-
df["q_025"] = y_pis[:, 0, 0] # Lower bound (2.5th percentile)
|
|
192
|
-
df["q_975"] = y_pis[:, 1, 0] # Upper bound (97.5th percentile)
|
|
193
|
-
|
|
194
|
-
# Calculate std estimate from 95% interval
|
|
195
|
-
interval_width_95 = df["q_975"] - df["q_025"]
|
|
196
|
-
df["prediction_std"] = interval_width_95 / 3.92 # 95% CI = ±1.96σ, so width = 3.92σ
|
|
197
|
-
|
|
198
|
-
# Calculate 50% intervals using normal approximation
|
|
199
|
-
df["q_25"] = df["prediction"] - 0.674 * df["prediction_std"]
|
|
200
|
-
df["q_75"] = df["prediction"] + 0.674 * df["prediction_std"]
|
|
201
|
-
|
|
202
|
-
# Return the modified DataFrame
|
|
203
|
-
return df
|
|
File without changes
|
|
File without changes
|
|
File without changes
|