-
Notifications
You must be signed in to change notification settings - Fork 15
Support kwargs in predict() and predict_proba() #113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 6 commits
a38f8cd
5eaf768
4be5989
13f1af8
44c1588
21ef07c
7cb3cb2
5857fe2
d29582a
2afba82
ed5d97f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -558,7 +558,6 @@ def predict_real_time( | |
| test_data_image_column: Optional[str] = None, | ||
| accept: str = "application/x-parquet", | ||
| inference_kwargs: Optional[Dict[str, Any]] = None, | ||
| **kwargs, | ||
| ) -> Union[pd.DataFrame, pd.Series]: | ||
| """ | ||
| Predict with the deployed SageMaker endpoint. A deployed SageMaker endpoint is required. | ||
|
|
@@ -595,7 +594,6 @@ def predict_proba_real_time( | |
| test_data_image_column: Optional[str] = None, | ||
| accept: str = "application/x-parquet", | ||
| inference_kwargs: Optional[Dict[str, Any]] = None, | ||
| **kwargs, | ||
| ) -> Union[pd.DataFrame, pd.Series]: | ||
| """ | ||
| Predict probability with the deployed SageMaker endpoint. A deployed SageMaker endpoint is required. | ||
|
|
@@ -704,6 +702,7 @@ def predict( | |
| instance_count: int = 1, | ||
| custom_image_uri: Optional[str] = None, | ||
| wait: bool = True, | ||
| inference_kwargs: Optional[Dict[str, Any]] = None, | ||
| download: bool = True, | ||
| persist: bool = True, | ||
| save_path: Optional[str] = None, | ||
|
|
@@ -783,6 +782,7 @@ def predict( | |
| instance_count=instance_count, | ||
| custom_image_uri=custom_image_uri, | ||
| wait=wait, | ||
| inference_kwargs=inference_kwargs, | ||
| download=download, | ||
| persist=persist, | ||
| save_path=save_path, | ||
|
|
@@ -805,6 +805,7 @@ def predict_proba( | |
| instance_count: int = 1, | ||
| custom_image_uri: Optional[str] = None, | ||
| wait: bool = True, | ||
| inference_kwargs: Optional[Dict[str, Any]] = None, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. add docstring |
||
| download: bool = True, | ||
| persist: bool = True, | ||
| save_path: Optional[str] = None, | ||
|
|
@@ -889,6 +890,7 @@ def predict_proba( | |
| instance_count=instance_count, | ||
| custom_image_uri=custom_image_uri, | ||
| wait=wait, | ||
| inference_kwargs=inference_kwargs, | ||
| download=download, | ||
| persist=persist, | ||
| save_path=save_path, | ||
|
|
@@ -1133,6 +1135,7 @@ def _predict( | |
| instance_count=1, | ||
| custom_image_uri=None, | ||
| wait=True, | ||
| inference_kwargs=None, | ||
| download=True, | ||
| persist=True, | ||
| save_path=None, | ||
|
|
@@ -1256,6 +1259,7 @@ def _predict( | |
| transformer_kwargs=transformer_kwargs, | ||
| model_kwargs=model_kwargs, | ||
| repack_model=repack_model, | ||
| inference_kwargs=inference_kwargs, | ||
| **transform_kwargs, | ||
| ) | ||
| self._batch_transform_jobs[job_name] = batch_transform_job | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -541,7 +541,7 @@ def predict_proba_real_time( | |
| """ | ||
| self._validate_inference_kwargs(inference_kwargs=kwargs) | ||
| return self.backend.predict_proba_real_time( | ||
| test_data=test_data, test_data_image_column=test_data_image_column, accept=accept | ||
| test_data=test_data, test_data_image_column=test_data_image_column, accept=accept, inference_kwargs=kwargs | ||
| ) | ||
|
|
||
| def predict( | ||
|
|
@@ -556,6 +556,7 @@ def predict( | |
| custom_image_uri: Optional[str] = None, | ||
| wait: bool = True, | ||
| backend_kwargs: Optional[Dict] = None, | ||
| **kwargs, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. add docstring
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add example code should be added to tutorials that showcase specifying kwargs. Otherwise it will be hard for users to realize how to do this.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good idea. I will add some tutorials with this PR. |
||
| ) -> Optional[pd.Series]: | ||
| """ | ||
| Batch inference. | ||
|
|
@@ -632,6 +633,7 @@ def predict( | |
| instance_count=instance_count, | ||
| custom_image_uri=custom_image_uri, | ||
| wait=wait, | ||
| inference_kwargs=kwargs, | ||
| **backend_kwargs, | ||
| ) | ||
|
|
||
|
|
@@ -648,6 +650,7 @@ def predict_proba( | |
| custom_image_uri: Optional[str] = None, | ||
| wait: bool = True, | ||
| backend_kwargs: Optional[Dict] = None, | ||
| **kwargs, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. add docstring |
||
| ) -> Optional[Union[Tuple[pd.Series, Union[pd.DataFrame, pd.Series]], Union[pd.DataFrame, pd.Series]]]: | ||
| """ | ||
| Batch inference | ||
|
|
@@ -730,6 +733,7 @@ def predict_proba( | |
| instance_count=instance_count, | ||
| custom_image_uri=custom_image_uri, | ||
| wait=wait, | ||
| inference_kwargs=kwargs, | ||
| **backend_kwargs, | ||
| ) | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.