workbench 0.8.177__py3-none-any.whl → 0.8.227__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/__init__.py +1 -0
- workbench/algorithms/dataframe/__init__.py +1 -2
- workbench/algorithms/dataframe/compound_dataset_overlap.py +321 -0
- workbench/algorithms/dataframe/feature_space_proximity.py +168 -75
- workbench/algorithms/dataframe/fingerprint_proximity.py +422 -86
- workbench/algorithms/dataframe/projection_2d.py +44 -21
- workbench/algorithms/dataframe/proximity.py +259 -305
- workbench/algorithms/graph/light/proximity_graph.py +12 -11
- workbench/algorithms/models/cleanlab_model.py +382 -0
- workbench/algorithms/models/noise_model.py +388 -0
- workbench/algorithms/sql/column_stats.py +0 -1
- workbench/algorithms/sql/correlations.py +0 -1
- workbench/algorithms/sql/descriptive_stats.py +0 -1
- workbench/algorithms/sql/outliers.py +3 -3
- workbench/api/__init__.py +5 -1
- workbench/api/df_store.py +17 -108
- workbench/api/endpoint.py +14 -12
- workbench/api/feature_set.py +117 -11
- workbench/api/meta.py +0 -1
- workbench/api/meta_model.py +289 -0
- workbench/api/model.py +52 -21
- workbench/api/parameter_store.py +3 -52
- workbench/cached/cached_meta.py +0 -1
- workbench/cached/cached_model.py +49 -11
- workbench/core/artifacts/__init__.py +11 -2
- workbench/core/artifacts/artifact.py +5 -5
- workbench/core/artifacts/df_store_core.py +114 -0
- workbench/core/artifacts/endpoint_core.py +319 -204
- workbench/core/artifacts/feature_set_core.py +249 -45
- workbench/core/artifacts/model_core.py +135 -82
- workbench/core/artifacts/parameter_store_core.py +98 -0
- workbench/core/cloud_platform/cloud_meta.py +0 -1
- workbench/core/pipelines/pipeline_executor.py +1 -1
- workbench/core/transforms/features_to_model/features_to_model.py +60 -44
- workbench/core/transforms/model_to_endpoint/model_to_endpoint.py +43 -10
- workbench/core/transforms/pandas_transforms/pandas_to_features.py +38 -2
- workbench/core/views/training_view.py +113 -42
- workbench/core/views/view.py +53 -3
- workbench/core/views/view_utils.py +4 -4
- workbench/model_script_utils/model_script_utils.py +339 -0
- workbench/model_script_utils/pytorch_utils.py +405 -0
- workbench/model_script_utils/uq_harness.py +277 -0
- workbench/model_scripts/chemprop/chemprop.template +774 -0
- workbench/model_scripts/chemprop/generated_model_script.py +774 -0
- workbench/model_scripts/chemprop/model_script_utils.py +339 -0
- workbench/model_scripts/chemprop/requirements.txt +3 -0
- workbench/model_scripts/custom_models/chem_info/fingerprints.py +175 -0
- workbench/model_scripts/custom_models/chem_info/mol_descriptors.py +0 -1
- workbench/model_scripts/custom_models/chem_info/molecular_descriptors.py +0 -1
- workbench/model_scripts/custom_models/chem_info/morgan_fingerprints.py +1 -2
- workbench/model_scripts/custom_models/proximity/feature_space_proximity.py +194 -0
- workbench/model_scripts/custom_models/proximity/feature_space_proximity.template +8 -10
- workbench/model_scripts/custom_models/uq_models/bayesian_ridge.template +7 -8
- workbench/model_scripts/custom_models/uq_models/ensemble_xgb.template +20 -21
- workbench/model_scripts/custom_models/uq_models/feature_space_proximity.py +194 -0
- workbench/model_scripts/custom_models/uq_models/gaussian_process.template +5 -11
- workbench/model_scripts/custom_models/uq_models/ngboost.template +15 -16
- workbench/model_scripts/ensemble_xgb/ensemble_xgb.template +15 -17
- workbench/model_scripts/meta_model/generated_model_script.py +209 -0
- workbench/model_scripts/meta_model/meta_model.template +209 -0
- workbench/model_scripts/pytorch_model/generated_model_script.py +443 -499
- workbench/model_scripts/pytorch_model/model_script_utils.py +339 -0
- workbench/model_scripts/pytorch_model/pytorch.template +440 -496
- workbench/model_scripts/pytorch_model/pytorch_utils.py +405 -0
- workbench/model_scripts/pytorch_model/requirements.txt +1 -1
- workbench/model_scripts/pytorch_model/uq_harness.py +277 -0
- workbench/model_scripts/scikit_learn/generated_model_script.py +7 -12
- workbench/model_scripts/scikit_learn/scikit_learn.template +4 -9
- workbench/model_scripts/script_generation.py +15 -12
- workbench/model_scripts/uq_models/generated_model_script.py +248 -0
- workbench/model_scripts/xgb_model/generated_model_script.py +371 -403
- workbench/model_scripts/xgb_model/model_script_utils.py +339 -0
- workbench/model_scripts/xgb_model/uq_harness.py +277 -0
- workbench/model_scripts/xgb_model/xgb_model.template +367 -399
- workbench/repl/workbench_shell.py +18 -14
- workbench/resources/open_source_api.key +1 -1
- workbench/scripts/endpoint_test.py +162 -0
- workbench/scripts/lambda_test.py +73 -0
- workbench/scripts/meta_model_sim.py +35 -0
- workbench/scripts/ml_pipeline_sqs.py +122 -6
- workbench/scripts/training_test.py +85 -0
- workbench/themes/dark/custom.css +59 -0
- workbench/themes/dark/plotly.json +5 -5
- workbench/themes/light/custom.css +153 -40
- workbench/themes/light/plotly.json +9 -9
- workbench/themes/midnight_blue/custom.css +59 -0
- workbench/utils/aws_utils.py +0 -1
- workbench/utils/chem_utils/fingerprints.py +87 -46
- workbench/utils/chem_utils/mol_descriptors.py +0 -1
- workbench/utils/chem_utils/projections.py +16 -6
- workbench/utils/chem_utils/vis.py +25 -27
- workbench/utils/chemprop_utils.py +141 -0
- workbench/utils/config_manager.py +2 -6
- workbench/utils/endpoint_utils.py +5 -7
- workbench/utils/license_manager.py +2 -6
- workbench/utils/markdown_utils.py +57 -0
- workbench/utils/meta_model_simulator.py +499 -0
- workbench/utils/metrics_utils.py +256 -0
- workbench/utils/model_utils.py +260 -76
- workbench/utils/pipeline_utils.py +0 -1
- workbench/utils/plot_utils.py +159 -34
- workbench/utils/pytorch_utils.py +87 -0
- workbench/utils/shap_utils.py +11 -57
- workbench/utils/theme_manager.py +95 -30
- workbench/utils/xgboost_local_crossfold.py +267 -0
- workbench/utils/xgboost_model_utils.py +127 -220
- workbench/web_interface/components/experiments/outlier_plot.py +0 -1
- workbench/web_interface/components/model_plot.py +16 -2
- workbench/web_interface/components/plugin_unit_test.py +5 -3
- workbench/web_interface/components/plugins/ag_table.py +2 -4
- workbench/web_interface/components/plugins/confusion_matrix.py +3 -6
- workbench/web_interface/components/plugins/model_details.py +48 -80
- workbench/web_interface/components/plugins/scatter_plot.py +192 -92
- workbench/web_interface/components/settings_menu.py +184 -0
- workbench/web_interface/page_views/main_page.py +0 -1
- {workbench-0.8.177.dist-info → workbench-0.8.227.dist-info}/METADATA +31 -17
- {workbench-0.8.177.dist-info → workbench-0.8.227.dist-info}/RECORD +121 -106
- {workbench-0.8.177.dist-info → workbench-0.8.227.dist-info}/entry_points.txt +4 -0
- {workbench-0.8.177.dist-info → workbench-0.8.227.dist-info}/licenses/LICENSE +1 -1
- workbench/core/cloud_platform/aws/aws_df_store.py +0 -404
- workbench/core/cloud_platform/aws/aws_parameter_store.py +0 -280
- workbench/model_scripts/custom_models/meta_endpoints/example.py +0 -53
- workbench/model_scripts/custom_models/proximity/generated_model_script.py +0 -138
- workbench/model_scripts/custom_models/proximity/proximity.py +0 -384
- workbench/model_scripts/custom_models/uq_models/generated_model_script.py +0 -494
- workbench/model_scripts/custom_models/uq_models/mapie.template +0 -494
- workbench/model_scripts/custom_models/uq_models/meta_uq.template +0 -386
- workbench/model_scripts/custom_models/uq_models/proximity.py +0 -384
- workbench/model_scripts/ensemble_xgb/generated_model_script.py +0 -279
- workbench/model_scripts/quant_regression/quant_regression.template +0 -279
- workbench/model_scripts/quant_regression/requirements.txt +0 -1
- workbench/themes/quartz/base_css.url +0 -1
- workbench/themes/quartz/custom.css +0 -117
- workbench/themes/quartz/plotly.json +0 -642
- workbench/themes/quartz_dark/base_css.url +0 -1
- workbench/themes/quartz_dark/custom.css +0 -131
- workbench/themes/quartz_dark/plotly.json +0 -642
- workbench/utils/resource_utils.py +0 -39
- {workbench-0.8.177.dist-info → workbench-0.8.227.dist-info}/WHEEL +0 -0
- {workbench-0.8.177.dist-info → workbench-0.8.227.dist-info}/top_level.txt +0 -0
|
@@ -8,9 +8,14 @@ from dash import html, callback, dcc, Input, Output, State
|
|
|
8
8
|
# Workbench Imports
|
|
9
9
|
from workbench.api import ModelType, ParameterStore
|
|
10
10
|
from workbench.cached.cached_model import CachedModel
|
|
11
|
-
from workbench.utils.markdown_utils import
|
|
11
|
+
from workbench.utils.markdown_utils import (
|
|
12
|
+
health_tag_markdown,
|
|
13
|
+
tags_to_markdown,
|
|
14
|
+
dict_to_markdown,
|
|
15
|
+
dict_to_collapsible_html,
|
|
16
|
+
df_to_html_table,
|
|
17
|
+
)
|
|
12
18
|
from workbench.web_interface.components.plugin_interface import PluginInterface, PluginPage, PluginInputType
|
|
13
|
-
from workbench.utils.markdown_utils import tags_to_markdown, dict_to_markdown, dict_to_collapsible_html
|
|
14
19
|
|
|
15
20
|
|
|
16
21
|
class ModelDetails(PluginInterface):
|
|
@@ -41,12 +46,10 @@ class ModelDetails(PluginInterface):
|
|
|
41
46
|
id=self.component_id,
|
|
42
47
|
children=[
|
|
43
48
|
html.H4(id=f"{self.component_id}-header", children="Model: Loading..."),
|
|
44
|
-
dcc.Markdown(id=f"{self.component_id}-summary"),
|
|
49
|
+
dcc.Markdown(id=f"{self.component_id}-summary", dangerously_allow_html=True),
|
|
45
50
|
html.H5(children="Inference Metrics", style={"marginTop": "20px"}),
|
|
46
51
|
dcc.Dropdown(id=f"{self.component_id}-dropdown", className="dropdown"),
|
|
47
|
-
dcc.Markdown(id=f"{self.component_id}-metrics"),
|
|
48
|
-
html.H5(children="Cross Fold Metrics", style={"marginTop": "20px"}),
|
|
49
|
-
dcc.Markdown(id=f"{self.component_id}-cross-metrics", dangerously_allow_html=True),
|
|
52
|
+
dcc.Markdown(id=f"{self.component_id}-metrics", dangerously_allow_html=True),
|
|
50
53
|
],
|
|
51
54
|
)
|
|
52
55
|
|
|
@@ -57,7 +60,6 @@ class ModelDetails(PluginInterface):
|
|
|
57
60
|
(f"{self.component_id}-dropdown", "options"),
|
|
58
61
|
(f"{self.component_id}-dropdown", "value"),
|
|
59
62
|
(f"{self.component_id}-metrics", "children"),
|
|
60
|
-
(f"{self.component_id}-cross-metrics", "children"),
|
|
61
63
|
]
|
|
62
64
|
self.signals = [(f"{self.component_id}-dropdown", "value")]
|
|
63
65
|
|
|
@@ -84,10 +86,9 @@ class ModelDetails(PluginInterface):
|
|
|
84
86
|
# Populate the inference runs dropdown
|
|
85
87
|
inference_runs, default_run = self.get_inference_runs()
|
|
86
88
|
metrics = self.inference_metrics(default_run)
|
|
87
|
-
cross_metrics = self.cross_metrics()
|
|
88
89
|
|
|
89
90
|
# Return the updated property values for the plugin
|
|
90
|
-
return [header, details, inference_runs, default_run, metrics
|
|
91
|
+
return [header, details, inference_runs, default_run, metrics]
|
|
91
92
|
|
|
92
93
|
def register_internal_callbacks(self):
|
|
93
94
|
@callback(
|
|
@@ -110,63 +111,37 @@ class ModelDetails(PluginInterface):
|
|
|
110
111
|
Returns:
|
|
111
112
|
str: A markdown string
|
|
112
113
|
"""
|
|
113
|
-
|
|
114
|
-
# Get these fields from the model
|
|
115
|
-
show_fields = [
|
|
116
|
-
"health_tags",
|
|
117
|
-
"input",
|
|
118
|
-
"workbench_registered_endpoints",
|
|
119
|
-
"workbench_model_type",
|
|
120
|
-
"workbench_model_target",
|
|
121
|
-
"workbench_model_features",
|
|
122
|
-
"param_meta",
|
|
123
|
-
"workbench_tags",
|
|
124
|
-
]
|
|
125
|
-
|
|
126
|
-
# Construct the markdown string
|
|
127
114
|
summary = self.current_model.summary()
|
|
128
115
|
markdown = ""
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
# Get the value
|
|
159
|
-
value = summary.get(key, "-")
|
|
160
|
-
|
|
161
|
-
# If the value is a list, convert it to a comma-separated string
|
|
162
|
-
if isinstance(value, list):
|
|
163
|
-
value = ", ".join(value)
|
|
164
|
-
|
|
165
|
-
# Chop off the "workbench_" prefix
|
|
166
|
-
key = key.replace("workbench_", "")
|
|
167
|
-
|
|
168
|
-
# Add to markdown string
|
|
169
|
-
markdown += f"**{key}:** {value} \n"
|
|
116
|
+
|
|
117
|
+
# Health tags
|
|
118
|
+
markdown += health_tag_markdown(summary.get("health_tags", []))
|
|
119
|
+
|
|
120
|
+
# Simple fields
|
|
121
|
+
markdown += f"**input:** {summary.get('input', '-')} \n"
|
|
122
|
+
endpoints = ", ".join(summary.get("workbench_registered_endpoints", []))
|
|
123
|
+
markdown += f"**registered_endpoints:** {endpoints or '-'} \n"
|
|
124
|
+
markdown += f"**model_type:** {summary.get('workbench_model_type', '-')} \n"
|
|
125
|
+
markdown += f"**model_target:** {summary.get('workbench_model_target', '-')} \n"
|
|
126
|
+
|
|
127
|
+
# Features (truncated)
|
|
128
|
+
features = summary.get("workbench_model_features", [])
|
|
129
|
+
features_str = f"({len(features)}) {', '.join(features)[:100]}..."
|
|
130
|
+
markdown += f"**features:** {features_str} \n"
|
|
131
|
+
|
|
132
|
+
# Parameter Store metadata
|
|
133
|
+
model_name = summary["name"]
|
|
134
|
+
meta_data = self.params.get(f"/workbench/models/{model_name}/meta", warn=False)
|
|
135
|
+
if meta_data:
|
|
136
|
+
markdown += dict_to_markdown(meta_data, title="Additional Metadata")
|
|
137
|
+
|
|
138
|
+
# Tags
|
|
139
|
+
markdown += tags_to_markdown(summary.get("workbench_tags", "")) + " \n"
|
|
140
|
+
|
|
141
|
+
# Hyperparameters
|
|
142
|
+
hyperparams = summary.get("hyperparameters")
|
|
143
|
+
if hyperparams and isinstance(hyperparams, dict):
|
|
144
|
+
markdown += dict_to_collapsible_html(hyperparams, title="Hyperparameters", collapse_all=True)
|
|
170
145
|
|
|
171
146
|
return markdown
|
|
172
147
|
|
|
@@ -205,15 +180,14 @@ class ModelDetails(PluginInterface):
|
|
|
205
180
|
markdown += " \nNo Data \n"
|
|
206
181
|
else:
|
|
207
182
|
markdown += " \n"
|
|
208
|
-
metrics = metrics.round(3)
|
|
209
183
|
|
|
210
184
|
# If the model is a classification model, have the index sorting match the class labels
|
|
211
185
|
if self.current_model.model_type == ModelType.CLASSIFIER:
|
|
212
|
-
# Sort the metrics by the class labels (if they match)
|
|
213
186
|
class_labels = self.current_model.class_labels()
|
|
214
187
|
if set(metrics.index) == set(class_labels):
|
|
215
188
|
metrics = metrics.reindex(class_labels)
|
|
216
|
-
|
|
189
|
+
|
|
190
|
+
markdown += df_to_html_table(metrics)
|
|
217
191
|
|
|
218
192
|
# Get additional inference metrics if they exist
|
|
219
193
|
model_name = self.current_model.name
|
|
@@ -223,17 +197,6 @@ class ModelDetails(PluginInterface):
|
|
|
223
197
|
markdown += dict_to_markdown(inference_data, title="Additional Inference Metrics")
|
|
224
198
|
return markdown
|
|
225
199
|
|
|
226
|
-
def cross_metrics(self) -> str:
|
|
227
|
-
# Get cross fold metrics if they exist
|
|
228
|
-
model_name = self.current_model.name
|
|
229
|
-
cross_fold_data = self.params.get(f"/workbench/models/{model_name}/inference/cross_fold", warn=False)
|
|
230
|
-
if not cross_fold_data:
|
|
231
|
-
return "**No Cross Fold Data**"
|
|
232
|
-
|
|
233
|
-
# Convert the cross fold data to a markdown string
|
|
234
|
-
html = dict_to_collapsible_html(cross_fold_data)
|
|
235
|
-
return html
|
|
236
|
-
|
|
237
200
|
def get_inference_runs(self):
|
|
238
201
|
"""Get the inference runs for the model
|
|
239
202
|
|
|
@@ -249,8 +212,13 @@ class ModelDetails(PluginInterface):
|
|
|
249
212
|
if not inference_runs:
|
|
250
213
|
return [], None
|
|
251
214
|
|
|
252
|
-
#
|
|
253
|
-
|
|
215
|
+
# Default inference run (full_cross_fold if it exists, then auto_inference, then first)
|
|
216
|
+
if "full_cross_fold" in inference_runs:
|
|
217
|
+
default_inference_run = "full_cross_fold"
|
|
218
|
+
elif "auto_inference" in inference_runs:
|
|
219
|
+
default_inference_run = "auto_inference"
|
|
220
|
+
else:
|
|
221
|
+
default_inference_run = inference_runs[0]
|
|
254
222
|
|
|
255
223
|
# Return the options for the dropdown and the selected value
|
|
256
224
|
return inference_runs, default_inference_run
|