Skip to content

ds2ai.Model

class Model(object)

This namespace represents a model in a project. Multiple Model objects can belong to a single project.

init()

__init__(info, user)
  • Parmeters:
    • info (str): Information about the current AI model in a project corresponding to the object
    • user (str): User for creating, modifying, deleting the model.
  • Fields:
    • id: Model id.
    • url: DS2 API url information.
    • user: User information.
    • user_token: User token information.
    • app_url: Service app url.

repr()

Returns the Model ID in a Click AI's project as a printable format.

__repr__()
  • Return type:
    • str

get_project()

Getter for current project's Project object.

get_project(project_id)
  • Parmeters:
    • project_id : project id as an int
  • Return type:
    • Project object

get_dataconnector()

Getter for the current project's data connector.

get_dataconnector(dataconnector_id)
  • Parmeters:
    • dataconnector_id : data connector's id as an int
  • Return type:
    • Dataconnector object

predict()

Predict the result using the input data and the model by calling self.utilClass.

predict(data, return_type="info")
  • Parmeters:
    • data : data needed for prediction
  • Return type:
    • requests

delete()

Delete the current model.

delete()
  • Return type:
    • None
  • Reference:
    • You can find the corresponding model deleted.

get_app_url()

Returns the app_url to predict and analyze outside of DS2.AI.

   get_app_url()
  • Return type:
    • Link
    • URL
  • Reference:
    • Link helps you predict and analyze data with the model.

deploy()

Deploy the model according to the cloud type, region, server type and project name if needed.

    deploy(cloud_type="AWS", region="us-west-1", server_type="g4dn.xlarge", project_name=None)
  • Parmeters:
    • cloud_type (str): DS2.ai supports AWS, Google Cloud, MS Azure and the default is set as "AWS"
    • region (str): region of the desired server and "us-west-1" is default
    • server_type (str): type of the server and "g4dn.xlarge" is default
    • project_name (str): name of the project in deploying process using SKYHUB AI and can be left None
  • Return type:
    • class Opsproject
    • Ops project id
  • Reference:
    • You can find the deployed model in SKYHUB AI.