Skip to content

Commit 885ebbc

Browse files
authored
Merge pull request #180577 from Blackmist/outbound-example
note about multiple column return
2 parents fdfbbd3 + 6b0f768 commit 885ebbc

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

articles/machine-learning/how-to-deploy-advanced-entry-script.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,16 @@ def run(Inputs, GlobalParameters):
105105
return error
106106
```
107107

108+
> [!TIP]
109+
> The return value from the script can be any Python object that is serializable to JSON. For example, if your model returns a Pandas dataframe that contains multiple columns, you might use an output decorator similar to the following code:
110+
>
111+
> ```python
112+
> output_sample = pd.DataFrame(data=[{"a1": 5, "a2": 6}])
113+
> @output_schema(PandasParameterType(output_sample))
114+
> ...
115+
> result = model.predict(data)
116+
> return result
117+
> ```
108118
109119
## <a id="binary-data"></a> Binary (i.e. image) data
110120

0 commit comments

Comments
 (0)