Using Python SDK

Introduction

Installing Python SDK in the way of installing a command-line tool. Refer to the Install Command Tool .

Using the SDK

Use the following method to load the packaged Xiaomi Cloud-ML client class.

from cloud_ml_sdk.client import CloudMlClient

Then use the user's AKSK for initialization.

client = CloudMlClient("access_key", "secret_key")

You can refer to the cloudml command-line tools source code and Api documentation for more ways of usage.

Usage example

from cloud_ml_sdk.client import CloudMlClient
from cloud_ml_sdk.models.train_job import TrainJob

client = CloudMlClient("access_key", "secret_key")

train_job = TrainJob(
    "linear",
    "trainer.task",
    "fds://cloud-ml/trainer-1.0.tar.gz")

client.submit_train_job(train_job.get_json_data())