Skip to content

Commit 736d72d

Browse files
author
Larry O'Brien
committed
Discussion of how to access current experiment from within a PythonScriptStep
1 parent f48baa1 commit 736d72d

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

articles/machine-learning/how-to-create-your-first-pipeline.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,14 @@ iris_dataset = run_context.input_datasets['iris_data']
347347
dataframe = iris_dataset.to_pandas_dataframe()
348348
```
349349

350+
The line `Run.get_context()` is worth highlighting. This function retrieves a `Run` representing the current experimental run. In the above sample, we use it to retrieve a registered dataset. Another common use of the `Run` object is to retrieve both the experiment itself and the workspace in which the experiment resides:
351+
352+
```python
353+
# Within a PythonScriptStep
354+
355+
ws = Run.get_context().experiment.workspace
356+
```
357+
350358
For more detail, including alternate ways to pass and access data, see [Moving data into and between ML pipeline steps (Python)](how-to-move-data-in-and-out-of-pipelines.md).
351359

352360
## Submit the pipeline

0 commit comments

Comments
 (0)