This is an automated email from the ASF dual-hosted git repository.

byronhsu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/submarine.git


The following commit(s) were added to refs/heads/master by this push:
     new 2030302  SUBMARINE-924. [User] Python SDK Model Client
2030302 is described below

commit 2030302c1055499fca21655dcd997e0aa52eed70
Author: featherchen <[email protected]>
AuthorDate: Tue Jul 13 23:01:14 2021 +0800

    SUBMARINE-924. [User] Python SDK Model Client
    
    ### What is this PR for?
    <!-- A few sentences describing the overall goals of the pull request's 
commits.
    First time? Check out the contributing guide - 
https://submarine.apache.org/contribution/contributions.html
    -->
    Documentation of Python SDK Model Client for users.
    ### What type of PR is it?
    Documentation
    
    ### Todos
    * [ ] - Test load_model , update_model, delete_model
    
    ### What is the Jira issue?
    <!-- * Open an issue on Jira 
https://issues.apache.org/jira/browse/SUBMARINE/
    * Put link here, and add [SUBMARINE-*Jira number*] in PR title, eg. 
`SUBMARINE-23. PR title`
    -->
    https://issues.apache.org/jira/browse/SUBMARINE-924
    
    ### How should this be tested?
    <!--
    * First time? Setup Travis CI as described on 
https://submarine.apache.org/contribution/contributions.html#continuous-integration
    * Strongly recommended: add automated unit tests for any new or changed 
behavior
    * Outline any manual steps to test the PR here.
    -->
    ### Screenshots (if appropriate)
    
    ### Questions:
    * Do the license files need updating? No
    * Are there breaking changes for older versions? No
    * Does this need new documentation? No
    
    Author: featherchen <[email protected]>
    
    Signed-off-by: byronhsu <[email protected]>
    
    Closes #674 from featherchen/SUBMARINE-924 and squashes the following 
commits:
    
    f9be5c26 [featherchen] first version
---
 .../docs/userDocs/submarine-sdk/model-client.md    | 120 +++++++++++++++++++++
 1 file changed, 120 insertions(+)

diff --git a/website/docs/userDocs/submarine-sdk/model-client.md 
b/website/docs/userDocs/submarine-sdk/model-client.md
index 73d69cc..150d3a1 100644
--- a/website/docs/userDocs/submarine-sdk/model-client.md
+++ b/website/docs/userDocs/submarine-sdk/model-client.md
@@ -20,3 +20,123 @@ KIND, either express or implied.  See the License for the
 specific language governing permissions and limitations
 under the License.
 -->
+
+The submarine ModelsClient provides a high-level API for managing and serving 
your models.
+
+## ModelsClient.start()->[Active 
Run](https://mlflow.org/docs/latest/_modules/mlflow/tracking/fluent.html#ActiveRun)
+
+1. Start a new Mlflow run
+2. Direct the logging of the artifacts and metadata to the Run named 
"worker_i" under Experiment "job_id"
+3. If in distributed training, worker and job id would be parsed from 
environment variable
+4. If in local traning, worker and job id will be generated.
+   :return: Active Run
+
+## ModelsClient.log_param(key, value)->None
+
+Log parameter under the current run.
+
+- ### Parameters
+  - **key** – Parameter name (string)
+  - **value** – Parameter value (string, but will be string-ified if not)
+- ### example
+
+```
+from submarine import ModelsClient
+
+periscope = ModelsClient()
+with periscope.start() as run:
+  periscope.log_param("learning_rate", 0.01)
+```
+
+## ModelsClient.log_params(params)->None
+
+Log a batch of params for the current run.
+
+- ### Parameters
+
+  - **params** – Dictionary of param_name: String -> value: (String, but will 
be string-ified if not)
+
+- ### example
+
+```
+from submarine import ModelsClient
+
+params = {"learning_rate": 0.01, "n_estimators": 10}
+
+periscope = ModelsClient()
+with periscope.start() as run:
+  periscope.log_params(params)
+```
+
+## ModelsClient.log_metric(self, key, value, step=None)->None
+
+Log a metric under the current run.
+
+- ### Parameters
+
+  - **key** – Metric name (string).
+  - **value** – Metric value (float). Note that some special values such as 
+/- Infinity may be replaced by other values depending on the store. For 
example, the SQLAlchemy store replaces +/- Infinity with max / min float values.
+  - **step** – Metric step (int). Defaults to zero if unspecified.
+
+- ### example
+
+```
+from submarine import ModelsClient
+
+periscope = ModelsClient()
+with periscope.start() as run:
+  periscope.log_metric("mse", 2500.00)
+```
+
+## ModelsClient.log_metrics(self, metrics, step=None)->None
+
+Log multiple metrics for the current run.
+
+- ### Parameters
+
+  - **metrics** – Dictionary of metric_name: String -> value: Float. Note that 
some special values such as +/- Infinity may be replaced by other values 
depending on the store. For example, sql based store may replace +/- Infinity 
with max / min float values.
+  - **step** – A single integer step at which to log the specified Metrics. If 
unspecified, each metric is logged at step zero.
+
+- ### example
+
+```
+from submarine import ModelsClient
+
+metrics = {"mse": 2500.00, "rmse": 50.00}
+
+periscope = ModelsClient()
+with periscope.start() as run:
+  periscope.log_metrics(metrics)
+```
+
+## ModelsClient.load_model(self, name, version)->[ 
mlflow.pyfunc.PyFuncModel](https://mlflow.org/docs/latest/_modules/mlflow/pyfunc.html#PyFuncModel)
+
+Load a model stored in models Python function format with specific name and 
version.
+
+- ### Parameters
+  - **name** – Name of the containing registered model.(string).
+  - **version** – Version number of the model version.(string).
+
+## ModelsClient.update_model(self, name, new_name)->None
+
+Update registered model name.
+
+- ### Parameters
+  - **name** – Name of the registered model to update(string).
+  - **new name** – New proposed name for the registered model(string).
+
+## ModelsClient.delete_model(self, name, version)->None
+
+Delete model version in backend.
+
+- ### Parameters
+  - **name** – Name of the containing registered model.(string).
+  - **version** – Version number of the model version.(string).
+
+## ModelsClient.save_model(self, model_type, model, artifact_path, 
registered_model_name=None)
+
+Beta: Save model to server for managment and servering.
+
+- ### Parameters
+  - **name** – Name of the containing registered model.(string).
+  - **version** – Version number of the model version.(string).

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to