workbench 0.8.201__py3-none-any.whl → 0.8.204__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.
- workbench/api/df_store.py +17 -108
- workbench/api/feature_set.py +41 -7
- workbench/api/parameter_store.py +3 -52
- workbench/core/artifacts/artifact.py +5 -5
- workbench/core/artifacts/df_store_core.py +114 -0
- workbench/core/artifacts/endpoint_core.py +184 -75
- workbench/core/artifacts/model_core.py +11 -7
- workbench/core/artifacts/parameter_store_core.py +98 -0
- workbench/core/transforms/features_to_model/features_to_model.py +27 -13
- workbench/core/transforms/model_to_endpoint/model_to_endpoint.py +11 -0
- workbench/core/transforms/pandas_transforms/pandas_to_features.py +11 -2
- workbench/model_scripts/chemprop/chemprop.template +312 -293
- workbench/model_scripts/chemprop/generated_model_script.py +316 -297
- workbench/model_scripts/custom_models/uq_models/ensemble_xgb.template +11 -5
- workbench/model_scripts/custom_models/uq_models/meta_uq.template +11 -5
- workbench/model_scripts/custom_models/uq_models/ngboost.template +11 -5
- workbench/model_scripts/ensemble_xgb/ensemble_xgb.template +11 -5
- workbench/model_scripts/pytorch_model/generated_model_script.py +278 -128
- workbench/model_scripts/pytorch_model/pytorch.template +273 -123
- workbench/model_scripts/uq_models/generated_model_script.py +20 -11
- workbench/model_scripts/uq_models/mapie.template +17 -8
- workbench/model_scripts/xgb_model/generated_model_script.py +38 -9
- workbench/model_scripts/xgb_model/xgb_model.template +34 -5
- workbench/resources/open_source_api.key +1 -1
- workbench/utils/chemprop_utils.py +38 -1
- workbench/utils/pytorch_utils.py +38 -8
- workbench/web_interface/components/model_plot.py +7 -1
- {workbench-0.8.201.dist-info → workbench-0.8.204.dist-info}/METADATA +2 -2
- {workbench-0.8.201.dist-info → workbench-0.8.204.dist-info}/RECORD +33 -33
- workbench/core/cloud_platform/aws/aws_df_store.py +0 -404
- workbench/core/cloud_platform/aws/aws_parameter_store.py +0 -296
- {workbench-0.8.201.dist-info → workbench-0.8.204.dist-info}/WHEEL +0 -0
- {workbench-0.8.201.dist-info → workbench-0.8.204.dist-info}/entry_points.txt +0 -0
- {workbench-0.8.201.dist-info → workbench-0.8.204.dist-info}/licenses/LICENSE +0 -0
- {workbench-0.8.201.dist-info → workbench-0.8.204.dist-info}/top_level.txt +0 -0
|
@@ -4,9 +4,10 @@ import awswrangler as wr
|
|
|
4
4
|
import numpy as np
|
|
5
5
|
|
|
6
6
|
# Model Performance Scores
|
|
7
|
-
from sklearn.metrics import mean_absolute_error, r2_score, root_mean_squared_error
|
|
7
|
+
from sklearn.metrics import mean_absolute_error, median_absolute_error, r2_score, root_mean_squared_error
|
|
8
8
|
from sklearn.model_selection import KFold
|
|
9
9
|
from scipy.optimize import minimize
|
|
10
|
+
from scipy.stats import spearmanr
|
|
10
11
|
|
|
11
12
|
from io import StringIO
|
|
12
13
|
import json
|
|
@@ -217,11 +218,16 @@ if __name__ == "__main__":
|
|
|
217
218
|
# Report Performance Metrics
|
|
218
219
|
rmse = root_mean_squared_error(result_df[target], result_df["prediction"])
|
|
219
220
|
mae = mean_absolute_error(result_df[target], result_df["prediction"])
|
|
221
|
+
medae = median_absolute_error(result_df[target], result_df["prediction"])
|
|
220
222
|
r2 = r2_score(result_df[target], result_df["prediction"])
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
print(f"
|
|
224
|
-
print(f"
|
|
223
|
+
spearman_corr = spearmanr(result_df[target], result_df["prediction"]).correlation
|
|
224
|
+
support = len(result_df)
|
|
225
|
+
print(f"rmse: {rmse:.3f}")
|
|
226
|
+
print(f"mae: {mae:.3f}")
|
|
227
|
+
print(f"medae: {medae:.3f}")
|
|
228
|
+
print(f"r2: {r2:.3f}")
|
|
229
|
+
print(f"spearmanr: {spearman_corr:.3f}")
|
|
230
|
+
print(f"support: {support}")
|
|
225
231
|
|
|
226
232
|
# Now save the models
|
|
227
233
|
for name, model in models.items():
|
|
@@ -5,7 +5,8 @@ from xgboost import XGBRegressor # Point Estimator
|
|
|
5
5
|
from sklearn.model_selection import train_test_split
|
|
6
6
|
|
|
7
7
|
# Model Performance Scores
|
|
8
|
-
from sklearn.metrics import mean_absolute_error, r2_score, root_mean_squared_error
|
|
8
|
+
from sklearn.metrics import mean_absolute_error, median_absolute_error, r2_score, root_mean_squared_error
|
|
9
|
+
from scipy.stats import spearmanr
|
|
9
10
|
|
|
10
11
|
from io import StringIO
|
|
11
12
|
import json
|
|
@@ -238,11 +239,16 @@ if __name__ == "__main__":
|
|
|
238
239
|
# Calculate various model performance metrics (regression)
|
|
239
240
|
rmse = root_mean_squared_error(y_validate, preds)
|
|
240
241
|
mae = mean_absolute_error(y_validate, preds)
|
|
242
|
+
medae = median_absolute_error(y_validate, preds)
|
|
241
243
|
r2 = r2_score(y_validate, preds)
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
print(f"
|
|
245
|
-
print(f"
|
|
244
|
+
spearman_corr = spearmanr(y_validate, preds).correlation
|
|
245
|
+
support = len(df_val)
|
|
246
|
+
print(f"rmse: {rmse:.3f}")
|
|
247
|
+
print(f"mae: {mae:.3f}")
|
|
248
|
+
print(f"medae: {medae:.3f}")
|
|
249
|
+
print(f"r2: {r2:.3f}")
|
|
250
|
+
print(f"spearmanr: {spearman_corr:.3f}")
|
|
251
|
+
print(f"support: {support}")
|
|
246
252
|
|
|
247
253
|
# Save the trained XGBoost model
|
|
248
254
|
xgb_model.save_model(os.path.join(args.model_dir, "xgb_model.json"))
|
|
@@ -3,7 +3,8 @@ from ngboost import NGBRegressor
|
|
|
3
3
|
from sklearn.model_selection import train_test_split
|
|
4
4
|
|
|
5
5
|
# Model Performance Scores
|
|
6
|
-
from sklearn.metrics import mean_absolute_error, r2_score, root_mean_squared_error
|
|
6
|
+
from sklearn.metrics import mean_absolute_error, median_absolute_error, r2_score, root_mean_squared_error
|
|
7
|
+
from scipy.stats import spearmanr
|
|
7
8
|
|
|
8
9
|
from io import StringIO
|
|
9
10
|
import json
|
|
@@ -129,11 +130,16 @@ if __name__ == "__main__":
|
|
|
129
130
|
# Calculate various model performance metrics (regression)
|
|
130
131
|
rmse = root_mean_squared_error(y_validate, preds)
|
|
131
132
|
mae = mean_absolute_error(y_validate, preds)
|
|
133
|
+
medae = median_absolute_error(y_validate, preds)
|
|
132
134
|
r2 = r2_score(y_validate, preds)
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
print(f"
|
|
136
|
-
print(f"
|
|
135
|
+
spearman_corr = spearmanr(y_validate, preds).correlation
|
|
136
|
+
support = len(df_val)
|
|
137
|
+
print(f"rmse: {rmse:.3f}")
|
|
138
|
+
print(f"mae: {mae:.3f}")
|
|
139
|
+
print(f"medae: {medae:.3f}")
|
|
140
|
+
print(f"r2: {r2:.3f}")
|
|
141
|
+
print(f"spearmanr: {spearman_corr:.3f}")
|
|
142
|
+
print(f"support: {support}")
|
|
137
143
|
|
|
138
144
|
# Save the trained NGBoost model
|
|
139
145
|
joblib.dump(ngb_model, os.path.join(args.model_dir, "ngb_model.joblib"))
|
|
@@ -12,7 +12,8 @@ import awswrangler as wr
|
|
|
12
12
|
import numpy as np
|
|
13
13
|
|
|
14
14
|
# Model Performance Scores
|
|
15
|
-
from sklearn.metrics import mean_absolute_error, r2_score, root_mean_squared_error
|
|
15
|
+
from sklearn.metrics import mean_absolute_error, median_absolute_error, r2_score, root_mean_squared_error
|
|
16
|
+
from scipy.stats import spearmanr
|
|
16
17
|
|
|
17
18
|
from io import StringIO
|
|
18
19
|
import json
|
|
@@ -153,11 +154,16 @@ if __name__ == "__main__":
|
|
|
153
154
|
# Report Performance Metrics
|
|
154
155
|
rmse = root_mean_squared_error(result_df[target], result_df["prediction"])
|
|
155
156
|
mae = mean_absolute_error(result_df[target], result_df["prediction"])
|
|
157
|
+
medae = median_absolute_error(result_df[target], result_df["prediction"])
|
|
156
158
|
r2 = r2_score(result_df[target], result_df["prediction"])
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
print(f"
|
|
160
|
-
print(f"
|
|
159
|
+
spearman_corr = spearmanr(result_df[target], result_df["prediction"]).correlation
|
|
160
|
+
support = len(result_df)
|
|
161
|
+
print(f"rmse: {rmse:.3f}")
|
|
162
|
+
print(f"mae: {mae:.3f}")
|
|
163
|
+
print(f"medae: {medae:.3f}")
|
|
164
|
+
print(f"r2: {r2:.3f}")
|
|
165
|
+
print(f"spearmanr: {spearman_corr:.3f}")
|
|
166
|
+
print(f"support: {support}")
|
|
161
167
|
|
|
162
168
|
# Now save the models
|
|
163
169
|
for name, model in models.items():
|