Skip to content

Commit

Permalink
fixing doc examples
Browse files Browse the repository at this point in the history
  • Loading branch information
brifordwylie committed Apr 16, 2024
1 parent ab25739 commit 3347f44
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 22 deletions.
54 changes: 35 additions & 19 deletions docs/api_classes/pipelines.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
!!! tip inline end "Pipeline Examples"
Examples of using the Pipeline classes are listed at the bottom of this page [Examples](#examples).

Pipelines are a sequence of SageWorks transforms. So if you have a nightly ML workflow you can capture that as a Pipeline. Here's an example pipeline:
Pipelines store sequences of SageWorks transforms. So if you have a nightly ML workflow you can capture that as a Pipeline. Here's an example pipeline:

```py title=nightly_sol_pipeline_v1.json
```py title="nightly_sol_pipeline_v1.json"
{
"data_source": {
"name": "nightly_data",
Expand Down Expand Up @@ -74,31 +74,47 @@ from sageworks.api.pipeline import Pipeline

# Retrieve an existing Pipeline
my_pipeline = Pipeline("abalone_pipeline_v1")
pprint(my_pipeline.details(recompute=True))
pprint(my_pipeline.details())
```

**Output**

```py
{'name': 'abalone_pipeline_v1',
'pipeline': {'data_source': {'input': '/Users/briford/work/sageworks/data/abalone.csv',
'name': 'abalone_data',
'tags': ['abalone_data']},
'endpoint': {'input': 'abalone-regression',
'name': 'abalone-regression-end',
'tags': ['abalone', 'regression']},
'feature_set': {'input': 'abalone_data',
'name': 'abalone_features',
'tags': ['abalone_features']},
'model': {'input': 'abalone_features',
'name': 'abalone-regression',
'tags': ['abalone', 'regression']}},
's3_path': 's3://sandbox-sageworks-artifacts/pipelines/abalone_pipeline_v1.json'}
```json
{
"name": "abalone_pipeline_v1",
"s3_path": "s3://sandbox/pipelines/abalone_pipeline_v1.json",
"pipeline": {
"data_source": {
"name": "abalone_data",
"tags": [
"abalone_data"
],
"input": "/Users/briford/work/sageworks/data/abalone.csv"
},
"feature_set": {
"name": "abalone_features",
"tags": [
"abalone_features"
],
"input": "abalone_data"
},
"model": {
"name": "abalone-regression",
"tags": [
"abalone",
"regression"
],
"input": "abalone_features"
},
...
}
}
```

**Pipeline Execution**

!!!tip inline end "Executing the Pipeline is obviously the most important reason for creating one. If gives you a reproducible way to capture, inspect, and run the same ML pipeline on different data (nightly).
!!!tip inline end "Pipeline Execution"
Executing the Pipeline is obviously the most important reason for creating one. If gives you a reproducible way to capture, inspect, and run the same ML pipeline on different data (nightly).

```py title="pipeline_execution.py"
from sageworks.api.pipeline import Pipeline
Expand Down
4 changes: 2 additions & 2 deletions examples/pipelines/pipeline_details.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from pprint import pprint
import json
from sageworks.api.pipeline import Pipeline

# Retrieve an existing Pipeline
my_pipeline = Pipeline("abalone_pipeline_v1")
pprint(my_pipeline.details(recompute=True))
print(json.dumps(my_pipeline.details(), indent=4))
2 changes: 1 addition & 1 deletion src/sageworks/api/pipeline_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class PipelineManager:
Common Usage:
```
my_manager = PipelineManager()
my_manager.list_pipelines()
abalone_pipeline = my_manager.create_from_endpoint("abalone-regression-end")
my_manager.save_pipeline("abalone_pipeline_v1", abalone_pipeline)
```
Expand Down

0 comments on commit 3347f44

Please sign in to comment.