Skip to content

Commit

Permalink
Make function signature consistent with docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcoGorelli committed Sep 21, 2019
1 parent c30e5ac commit 2b54e03
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions doc/source/python/python_component.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ To wrap your machine learning model create a Class that has a predict method wit
def predict(self, X: np.ndarray, names: Iterable[str], meta: Dict = None) -> Union[np.ndarray, List, str, bytes]:
```

Your predict method will receive a numpy array `X` with iterable set f column names (if they exist in the input features) and optioal Dictionary of meta data. It should return the result of the prediction as either:
Your predict method will receive a numpy array `X` with iterable set of column names (if they exist in the input features) and optional Dictionary of meta data. It should return the result of the prediction as either:

* Numpy array
* List of values
Expand All @@ -30,7 +30,7 @@ class MyModel(object):
"""
print("Initializing")

def predict(self,X,features_names):
def predict(self, X, features_names=None):
"""
Return a prediction.
Expand All @@ -54,7 +54,7 @@ You can also provide a method to return the column names for your prediction wit

### Examples

You can follow [various notebook examples](../examples/notebooks.html)
You can follow [various notebook examples](../examples/notebooks.html).

## Transformers

Expand All @@ -68,7 +68,7 @@ Seldon Core allows you to create components to transform features either in the

## Combiners

Seldon Core allows yout to create components that combine responses from multiple models into a single response. To create a class for this add a method with signature below:
Seldon Core allows you to create components that combine responses from multiple models into a single response. To create a class for this add a method with signature below:

```python
def aggregate(self, features_list: List[Union[np.ndarray, str, bytes]], feature_names_list: List) -> Union[np.ndarray, List, str, bytes]:
Expand Down Expand Up @@ -169,7 +169,7 @@ If you want to handle custom exceptions define a field `model_error_handler` as
```python
model_error_handler = flask.Blueprint('error_handlers', __name__)
```
An example is as follow:
An example is as follows:

```python
"""
Expand Down
4 changes: 2 additions & 2 deletions doc/source/python/seldon_client.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Seldon Python Client

We provide an example python client for calling the API using REST or gRPC for internal mciroservice testing or for calling the public external API.
We provide an example python client for calling the API using REST or gRPC for internal microservice testing or for calling the public external API.

Examples of its use can be found in various notebooks:

Expand All @@ -14,7 +14,7 @@ from seldon_core.seldon_client import SeldonClient
sc = SeldonClient(deployment_name="mymodel",namespace="seldon",gateway_endpoint="localhost:8003",gateway="ambassador")
```

In the above we set our deployment_name to "mymodel" and the namespace to "seldon". For the full set of parameters see [here](api/seldon_core.html#seldon_core.seldon_client.SeldonClient)
In the above we set our deployment_name to "mymodel" and the namespace to "seldon". For the full set of parameters see [here](api/seldon_core.html#seldon_core.seldon_client.SeldonClient).

To make a REST call with a random payload:

Expand Down

0 comments on commit 2b54e03

Please sign in to comment.