Local Models
No AWS Required
Local artifacts need no AWS account, no config, and no credentials. Paired with PublicData, you can go from install to a trained model without touching AWS at all.
The Local classes mirror the Workbench artifact API against your filesystem. The
chain is the same — DataSource → FeatureSet → Model → Endpoint — and training
runs the same generated model script that SageMaker runs, as a subprocess. So a
script written locally publishes to AWS and produces the same model.
Storage lives under WORKBENCH_LOCAL_PATH (default ~/.workbench/local).
Local is where you iterate: try a feature list, a framework, a set of hyperparameters. There's no build cost and deleting is instant. AWS is where a model lands once it's worth keeping — that's where monitoring, deployed endpoints, and everything else the team consumes live.
Try it
PublicData reads public S3 anonymously, so this runs with no AWS setup:
from workbench.local import LocalDataSource, PublicData, ModelType, ModelFramework
df = PublicData().get("comp_chem/aqsol/aqsol_public_data")
ds = LocalDataSource(df, name="aqsol_local")
fs = ds.to_features("aqsol_local_features", id_column="ID")
model = fs.to_model(
"aqsol-local-reg",
model_type=ModelType.REGRESSOR,
model_framework=ModelFramework.XGBOOST,
target_column="solubility",
feature_list=["molwt", "mollogp", "tpsa", "numrotatablebonds"],
)
print(model.get_inference_metrics())
predictions = model.to_endpoint().inference(fs.pull_dataframe().head(10))
to_features() lowercases column names, same as the AWS path, so target_column
and feature_list refer to the FeatureSet's names rather than the source frame's.
Use fs.columns to see them.
A LocalEndpoint isn't deployed anywhere. inference() loads the model in-process
through the same model_fn/predict_fn a real endpoint container uses, so the
predictions match what a deployed endpoint returns.
validation_ids, sample_weights, and exclude_ids work as they do in AWS, and
they're recorded so publishing can replay them.
The Workbench REPL exposes all of these, so none of the imports are needed there.
Scoring
Inference runs work the same as they do on an AWS Model, so a script that walks them runs against either. Metrics are computed from the run's predictions.
model.list_inference_runs() # ["full_cross_fold", ...]
model.get_inference_metrics() # defaults to full_cross_fold
model.get_inference_predictions("full_cross_fold")
model.oof_predictions() # the cross-fold predictions directly
model.validation_predictions() # held-out rows, when validation_ids were used
# Naming a capture adds it to the run list
model.to_endpoint().inference(eval_df, capture_name="holdout")
model.get_inference_metrics("holdout")
The model_training run an AWS Model carries has no local equivalent — those
metrics come from SageMaker scraping the training job's output.
Publishing
model.publish_plan() # what it would create, creates nothing
aws_model = model.publish() # ds -> fs -> model -> endpoint
Publishing walks up the lineage and creates whatever AWS doesn't already have,
then deploys an endpoint (pass endpoint=False to stop at the model). It
retrains in AWS from the published FeatureSet rather than uploading local
artifacts, so the model lands in the registry like any other — with the row roles
replayed, so it trains on the same rows.
That launches a real SageMaker training job, which is why publish_plan() is a
separate call: look before you leap.
If a published model disagrees with the local one, model.version_drift() reports
package versions that differ between this machine and the training image.
Listing and deleting
from workbench.local import LocalMeta
LocalMeta().models() # also data_sources(), feature_sets(), endpoints()
The Workbench REPL prints a local summary at startup and on local_summary().
Always delete through the API. LocalModel.delete() takes its endpoints with it;
removing directories by hand leaves endpoints pointing at a model that no longer
exists. That's the only cascade — deleting a LocalFeatureSet leaves its models
alone.
What's not here
Local covers training and scoring. Plots, the inference store, monitoring, contests, and promotion are all properties of published artifacts — when you want those, publish.
LocalDataSource: A DataFrame on local disk, queryable with DuckDB.
LocalDataSource
Bases: LocalArtifact
LocalDataSource: Workbench Local DataSource Class
Common Usage
Source code in src/workbench/local/local_data_source.py
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 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 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 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 | |
column_types
property
Return the column types for this DataSource
columns
property
Return the column names for this DataSource
__init__(source=None, name=None, **kwargs)
Initialize a LocalDataSource
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
source
|
Union[str, DataFrame]
|
A DataFrame, a CSV/parquet file path, or an
existing LocalDataSource name. If None, |
None
|
name
|
str
|
The name of the data source (must be lowercase). Required for DataFrames. |
None
|
Source code in src/workbench/local/local_data_source.py
aws_exists()
Does an AWS DataSource by this name already exist?
Returns:
| Name | Type | Description |
|---|---|---|
bool |
bool
|
True if AWS already has this DataSource |
Source code in src/workbench/local/local_data_source.py
details(**kwargs)
LocalDataSource Details
Returns:
| Name | Type | Description |
|---|---|---|
dict |
dict
|
A dictionary of details about the LocalDataSource |
Source code in src/workbench/local/local_data_source.py
num_columns()
num_rows()
pull_dataframe(limit=None)
Return a DataFrame of ALL the data from this DataSource
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
limit
|
int
|
Limit the number of rows returned (default: None = all rows) |
None
|
Returns:
| Type | Description |
|---|---|
DataFrame
|
pd.DataFrame: A DataFrame of the data from this DataSource |
Source code in src/workbench/local/local_data_source.py
query(query)
Query this DataSource with DuckDB
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
query
|
str
|
SQL to run; reference this artifact by its name |
required |
Returns:
| Type | Description |
|---|---|
DataFrame
|
pd.DataFrame: The results of the query |
Source code in src/workbench/local/local_data_source.py
to_features(name, id_column, tags=None, event_time_column=None, one_hot_columns=None)
Convert this LocalDataSource to a LocalFeatureSet
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Set the name for the feature set (must be lowercase). |
required |
id_column
|
str
|
The ID column (must be specified, use "auto" for auto-generated IDs). |
required |
tags
|
list
|
Set the tags for the feature set (unused, kept for API parity). |
None
|
event_time_column
|
str
|
The event time column (default: None). |
None
|
one_hot_columns
|
list
|
Columns to one-hot encode (default: None). |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
LocalFeatureSet |
Union[LocalFeatureSet, None]
|
The FeatureSet created from this DataSource (or None on invalid name) |
Source code in src/workbench/local/local_data_source.py
LocalFeatureSet: Engineered features on local disk, queryable with DuckDB.
LocalFeatureSet
Bases: LocalArtifact
LocalFeatureSet: Workbench Local FeatureSet Class
Common Usage
Source code in src/workbench/local/local_feature_set.py
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 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 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 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 | |
column_types
property
Return the column types for this FeatureSet
columns
property
Return the column names for this FeatureSet
id_column
property
The ID column for this FeatureSet
__init__(name, **kwargs)
Initialize a LocalFeatureSet
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
The name of an existing local feature set |
required |
Source code in src/workbench/local/local_feature_set.py
aws_exists()
Does an AWS FeatureSet by this name already exist?
Returns:
| Name | Type | Description |
|---|---|---|
bool |
bool
|
True if AWS already has this FeatureSet |
Source code in src/workbench/local/local_feature_set.py
details(**kwargs)
LocalFeatureSet Details
Returns:
| Name | Type | Description |
|---|---|---|
dict |
dict
|
A dictionary of details about the LocalFeatureSet |
Source code in src/workbench/local/local_feature_set.py
from_dataframe(df, name, id_column, event_time_column=None, one_hot_columns=None, input_name='dataframe')
classmethod
Create a LocalFeatureSet from a DataFrame, running the shared column prep.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
df
|
DataFrame
|
The DataFrame of features |
required |
name
|
str
|
The name for the feature set (must be lowercase) |
required |
id_column
|
str
|
The ID column (use "auto" for auto-generated IDs) |
required |
event_time_column
|
str
|
Event time column (default: None) |
None
|
one_hot_columns
|
list
|
Columns to one-hot encode (default: None) |
None
|
input_name
|
str
|
Name of this feature set's input (default: "dataframe") |
'dataframe'
|
Returns:
| Name | Type | Description |
|---|---|---|
LocalFeatureSet |
LocalFeatureSet
|
The created feature set |
Source code in src/workbench/local/local_feature_set.py
num_columns()
num_rows()
parent()
The LocalDataSource this FeatureSet came from, if it still exists locally
Source code in src/workbench/local/local_feature_set.py
pull_dataframe(limit=None)
Return a DataFrame of ALL the data from this FeatureSet
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
limit
|
int
|
Limit the number of rows returned (default: None = all rows) |
None
|
Returns:
| Type | Description |
|---|---|
DataFrame
|
pd.DataFrame: A DataFrame of the data from this FeatureSet |
Source code in src/workbench/local/local_feature_set.py
query(query)
Query this FeatureSet with DuckDB
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
query
|
str
|
SQL to run; reference this artifact by its name |
required |
Returns:
| Type | Description |
|---|---|
DataFrame
|
pd.DataFrame: The results of the query |
Source code in src/workbench/local/local_feature_set.py
to_model(name, model_type, model_framework, **kwargs)
Train a LocalModel from this FeatureSet.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
The name of the Model to create |
required |
model_type
|
ModelType
|
The type of model to create |
required |
model_framework
|
ModelFramework
|
The framework to use |
required |
**kwargs
|
Any
|
Passed to LocalModel.from_feature_set (target_column, feature_list, hyperparameters, sample_weights, validation_ids, exclude_ids, wait) |
{}
|
Returns:
| Name | Type | Description |
|---|---|---|
LocalModel |
LocalModel
|
The Model created from this FeatureSet |
Source code in src/workbench/local/local_feature_set.py
training_view(sample_weights=None, validation_ids=None, exclude_ids=None)
Build the training frame: features plus the three role columns.
Mirrors the AWS model training view: sample_weight (default 1.0),
validation (default False), and exclude (default False). Excluded rows
are dropped entirely, and exclude wins over validation.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sample_weights
|
Union[dict, DataFrame]
|
id -> weight, forwarded as-is |
None
|
validation_ids
|
list
|
ids held out of training and scored as a holdout |
None
|
exclude_ids
|
list
|
ids dropped from the training frame entirely |
None
|
Returns:
| Type | Description |
|---|---|
DataFrame
|
pd.DataFrame: The feature columns plus sample_weight/validation/exclude |
Source code in src/workbench/local/local_feature_set.py
LocalModel: A model trained on this machine by the generated model script.
LocalModel
Bases: LocalArtifact
LocalModel: Workbench Local Model Class
Training runs the same generated model script that SageMaker runs, with the same arguments, as a subprocess against local directories.
Source code in src/workbench/local/local_model.py
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 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 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 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 | |
__init__(name, **kwargs)
Initialize a LocalModel
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
The name of the model |
required |
Source code in src/workbench/local/local_model.py
aws_exists()
Does an AWS Model by this name already exist?
Returns:
| Name | Type | Description |
|---|---|---|
bool |
bool
|
True if AWS already has this Model |
default_inference_run()
Resolve the default inference run for this model.
Returns:
| Type | Description |
|---|---|
Union[str, None]
|
Union[str, None]: full_cross_fold -> test_inference -> first run, None if there are none |
Source code in src/workbench/local/local_model.py
delete()
Delete this model and the endpoints serving it.
An endpoint is not an independent artifact -- it loads from the model's directory and is meaningless once that is gone, so it comes down too. This is the only cascade: deleting a FeatureSet leaves its models alone.
Source code in src/workbench/local/local_model.py
details(**kwargs)
LocalModel Details
Returns:
| Name | Type | Description |
|---|---|---|
dict |
dict
|
A dictionary of details about the LocalModel |
from_feature_set(feature_set, name, model_type, model_framework, target_column=None, feature_list=None, model_class=None, model_import_str=None, custom_script=None, hyperparameters=None, sample_weights=None, validation_ids=None, exclude_ids=None, wait=True)
classmethod
Train a LocalModel from a LocalFeatureSet.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
feature_set
|
LocalFeatureSet
|
The feature set to train on |
required |
name
|
str
|
The name of the model to create |
required |
model_type
|
ModelType
|
The type of model to create |
required |
model_framework
|
ModelFramework
|
The framework to use |
required |
target_column
|
str or list[str]
|
Target column(s), None for unsupervised |
None
|
feature_list
|
list
|
Feature columns; derived from the FeatureSet if omitted |
None
|
model_class
|
str
|
Model class for scikit-learn models (e.g. "KMeans") |
None
|
model_import_str
|
str
|
Import line for the model class |
None
|
custom_script
|
str
|
Path to a custom model script or template |
None
|
hyperparameters
|
dict
|
Hyperparameters for the model |
None
|
sample_weights
|
Union[dict, DataFrame]
|
id -> framework weight |
None
|
validation_ids
|
list
|
ids held out and scored as a validation set |
None
|
exclude_ids
|
list
|
ids dropped from training entirely |
None
|
wait
|
bool
|
Block until training finishes (default: True) |
True
|
Returns:
| Name | Type | Description |
|---|---|---|
LocalModel |
LocalModel
|
The model (trained if wait=True, still training otherwise) |
Source code in src/workbench/local/local_model.py
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 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 | |
get_inference_metrics(capture_name='default')
Retrieve the inference performance metrics for this model.
Computed from the run's predictions rather than stored, so there is nothing to keep in sync with them.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
capture_name
|
str
|
A run from list_inference_runs(), or "default" to resolve via default_inference_run() |
'default'
|
Returns:
| Type | Description |
|---|---|
Union[DataFrame, None]
|
Union[pd.DataFrame, None]: The metrics, or None if they can't be computed |
Source code in src/workbench/local/local_model.py
get_inference_predictions(capture_name='default')
Retrieve the captured predictions for this model.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
capture_name
|
str
|
A run from list_inference_runs(), or "default" to resolve via default_inference_run() |
'default'
|
Returns:
| Type | Description |
|---|---|
Union[DataFrame, None]
|
Union[pd.DataFrame, None]: The predictions, or None if that run doesn't exist |
Source code in src/workbench/local/local_model.py
list_inference_runs()
List the inference runs for this model.
Returns:
| Type | Description |
|---|---|
list[str]
|
list[str]: The cross-fold run from training, then any endpoint captures |
Source code in src/workbench/local/local_model.py
oof_predictions()
Out-of-fold predictions written by the training run.
Returns:
| Type | Description |
|---|---|
DataFrame
|
pd.DataFrame: The OOF predictions (empty if the model hasn't trained) |
Source code in src/workbench/local/local_model.py
parent()
The LocalFeatureSet this model trained on, if it still exists locally
Source code in src/workbench/local/local_model.py
publish(endpoint=True, **kwargs)
Publish this model and its lineage to AWS, then deploy an endpoint.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
endpoint
|
bool
|
Also deploy a serverless endpoint (default True) |
True
|
**kwargs
|
Any
|
Passed to the AWS training job |
{}
|
Returns:
| Name | Type | Description |
|---|---|---|
Model |
Model
|
The published AWS Model |
Source code in src/workbench/local/local_model.py
to_endpoint(name=None)
Create a LocalEndpoint that serves this model.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Endpoint name (defaults to the model name) |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
LocalEndpoint |
LocalEndpoint
|
The endpoint serving this model |
Source code in src/workbench/local/local_model.py
training_log(lines=None)
The training log for this model.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
lines
|
int
|
Return only the last N lines (default: the whole log) |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The log contents ("" if the model hasn't trained) |
Source code in src/workbench/local/local_model.py
training_state()
The training status for this model, as recorded on disk.
A run whose watcher never got to record an outcome -- the session exited, or the process died -- is reported as "interrupted" rather than left claiming to be training forever. Whether the child finished its work is unknown at that point.
Returns:
| Name | Type | Description |
|---|---|---|
dict |
dict
|
{state, pid, started, updated, returncode, finished}, empty before any run |
Source code in src/workbench/local/local_model.py
validation_predictions()
Held-out validation predictions written by the training run.
Returns:
| Type | Description |
|---|---|
DataFrame
|
pd.DataFrame: The validation predictions (empty if there was no validation set) |
Source code in src/workbench/local/local_model.py
version_drift()
Package versions that differ between this machine and the training image.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
A drift report, or "" when everything that matters matches |
Source code in src/workbench/local/local_model.py
LocalEndpoint: In-process inference against a locally trained model.
LocalEndpoint
Bases: LocalArtifact
LocalEndpoint: Workbench Local Endpoint Class
Loads the model bundle once with model_fn and calls predict_fn per
inference, which are the same functions the serving container calls.
Source code in src/workbench/local/local_endpoint.py
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 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 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 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 | |
model_dir
property
The model artifacts directory this endpoint loads from.
Resolved from the model name on every access rather than stored, so the endpoint keeps working when the storage root moves or the config changes.
model_name
property
The model this endpoint serves
__init__(name, **kwargs)
Initialize a LocalEndpoint
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
The name of the endpoint |
required |
Source code in src/workbench/local/local_endpoint.py
aws_exists()
Does an AWS Endpoint by this name already exist?
Returns:
| Name | Type | Description |
|---|---|---|
bool |
bool
|
True if AWS already has this Endpoint |
details(**kwargs)
LocalEndpoint Details
Returns:
| Name | Type | Description |
|---|---|---|
dict |
dict
|
A dictionary of details about the LocalEndpoint |
Source code in src/workbench/local/local_endpoint.py
from_model(model, name=None)
classmethod
Create a LocalEndpoint that serves a LocalModel.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
model
|
LocalModel
|
The trained model to serve |
required |
name
|
str
|
Endpoint name (defaults to the model name) |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
LocalEndpoint |
LocalEndpoint
|
The created endpoint |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the model hasn't trained successfully |
Source code in src/workbench/local/local_endpoint.py
get_inference_predictions(capture_name='auto_inference')
Retrieve a captured inference run.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
capture_name
|
str
|
The capture to retrieve (default: "auto_inference") |
'auto_inference'
|
Returns:
| Type | Description |
|---|---|
Union[DataFrame, None]
|
Union[pd.DataFrame, None]: The predictions, or None if that capture doesn't exist |
Source code in src/workbench/local/local_endpoint.py
inference(eval_df, capture_name=None)
Run inference on a DataFrame.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
eval_df
|
DataFrame
|
The data to run inference on |
required |
capture_name
|
str
|
Store the predictions under this name, which makes them available from the model as an inference run |
None
|
Returns:
| Type | Description |
|---|---|
DataFrame
|
pd.DataFrame: The predictions |
Source code in src/workbench/local/local_endpoint.py
list_captures()
The inference captures stored on this endpoint.
Returns:
| Type | Description |
|---|---|
list[str]
|
list[str]: Sorted capture names |
Source code in src/workbench/local/local_endpoint.py
parent()
LocalMeta: Listings for the artifacts in local storage.
A directory glob plus a meta.json read per artifact. No caching tier and no
artifact objects constructed, so listing stays cheap.
LocalMeta
LocalMeta: Workbench Local Metadata Class
Common Usage
Source code in src/workbench/local/local_meta.py
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 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 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 159 | |
__init__()
data_sources()
Get a summary of the local Data Sources
Returns:
| Type | Description |
|---|---|
DataFrame
|
pd.DataFrame: A summary of the local Data Sources |
Source code in src/workbench/local/local_meta.py
endpoints()
Get a summary of the local Endpoints
Returns:
| Type | Description |
|---|---|
DataFrame
|
pd.DataFrame: A summary of the local Endpoints |
feature_sets()
Get a summary of the local Feature Sets
Returns:
| Type | Description |
|---|---|
DataFrame
|
pd.DataFrame: A summary of the local Feature Sets |
Source code in src/workbench/local/local_meta.py
models()
Get a summary of the local Models
Returns:
| Type | Description |
|---|---|
DataFrame
|
pd.DataFrame: A summary of the local Models |