Class AIClient

  • All Implemented Interfaces:
    IAIClient, IDoGetCallback<AI>

    public class AIClient
    extends java.lang.Object
    implements IAIClient, IDoGetCallback<AI>
    The AIClient object provides access to the AI endpoints of the DataRobot AI API. This object is not meant to be used directly but through the DataRobotAIClient.ais() method.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addDataset​(java.lang.String aiId, java.lang.String datasetId)
      Add a Dataset to the AI
      void addLearningSession​(java.lang.String aiId, java.lang.String learningSessionId, java.lang.String outputName)
      Add a LearningSession to the AI
      void addOutput​(java.lang.String aiId, java.lang.String learningSessionId, java.lang.String outputName)
      Add an Output to the AI
      AI createAI​(java.lang.String name)
      Create an AI with the given name
      void delete​(java.lang.String aiId)
      Delete an AI
      AI get​(java.lang.String id)
      Retrieve an AI
      Action<com.google.api.client.http.HttpRequest,​com.google.api.client.http.HttpResponse> getHttpMessageTransformer()
      internal
      LearningSessionList getLearningSessions​(java.lang.String aiId)
      Retrieve a list of all learning sessions associated with an AI
      LearningSessionList getLearningSessions​(java.lang.String aiId, PagingParams params)
      Retrieve a list of all learning sessions associated with an AI
      Output getOutput​(java.lang.String aiId, java.lang.String outputTarget)
      Retrieve the Output associated with an AI and target
      OutputFeatures getOutputFeatures​(java.lang.String aiId, java.lang.String outputName)
      Retrieve features of an output associated with an AI and a target
      OutputList getOutputs​(java.lang.String aiId)
      Retrieve a list of all outputs associated with an AI.
      OutputList getOutputs​(java.lang.String aiId, PagingParams params)
      Retrieve a list of all outputs associated with an AI.
      PredictionList infer​(java.lang.String aiId, java.lang.String target, java.lang.String filePath)
      Make predictions on an AI, target and dataset.
      AIList list()
      Retrieve a list of all AIs associated with this account
      AIList list​(PagingParams params)
      Retrieve a list of all AIs associated with this account
      PredictionList predict​(java.lang.String aiId, java.lang.String target, java.lang.String filePath)
      Make predictions on an AI, target and dataset.
      void setHttpMessageTransformer​(Action<com.google.api.client.http.HttpRequest,​com.google.api.client.http.HttpResponse> httpMessageTransformer)
      internal
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • AIClient

        public AIClient​(IDataRobotAIClient client)
        IAIClient based API operations. Users will not need to instantiate this object directly. It can be accessed through DataRobotAIClient.ais().
        Parameters:
        client - DataRobotAIClient
    • Method Detail

      • getHttpMessageTransformer

        public Action<com.google.api.client.http.HttpRequest,​com.google.api.client.http.HttpResponse> getHttpMessageTransformer()
        internal
        Specified by:
        getHttpMessageTransformer in interface IAIClient
      • setHttpMessageTransformer

        public void setHttpMessageTransformer​(Action<com.google.api.client.http.HttpRequest,​com.google.api.client.http.HttpResponse> httpMessageTransformer)
        internal
        Specified by:
        setHttpMessageTransformer in interface IAIClient
      • get

        public AI get​(java.lang.String id)
               throws ClientException
        Retrieve an AI
        Specified by:
        get in interface IAIClient
        Specified by:
        get in interface IDoGetCallback<AI>
        Parameters:
        id - The ID of the AI to retrieve
        Returns:
        The queried AI
        Throws:
        ClientException - when 4xx or 5xx response is received from server, or errors in parsing the response.
      • list

        public AIList list()
                    throws ClientException
        Retrieve a list of all AIs associated with this account
        Specified by:
        list in interface IAIClient
        Returns:
        AIList
        Throws:
        ClientException - when 4xx or 5xx response is received from server, or errors in parsing the response.
      • createAI

        public AI createAI​(java.lang.String name)
                    throws ClientException,
                           java.lang.InterruptedException
        Create an AI with the given name
        Specified by:
        createAI in interface IAIClient
        Parameters:
        name - The name of the AI
        Returns:
        The new AI
        Throws:
        ClientException - when 4xx or 5xx response is received from server, or errors in parsing the response.
        java.lang.InterruptedException - when a thread is waiting, sleeping, or otherwise occupied, and the thread is interrupted, either before or during the activity.
      • delete

        public void delete​(java.lang.String aiId)
                    throws ClientException
        Delete an AI
        Specified by:
        delete in interface IAIClient
        Parameters:
        aiId - The ID of the AI to delete
        Throws:
        ClientException - when 4xx or 5xx response is received from server, or errors in parsing the response.
      • addLearningSession

        public void addLearningSession​(java.lang.String aiId,
                                       java.lang.String learningSessionId,
                                       java.lang.String outputName)
                                throws ClientException
        Add a LearningSession to the AI
        Specified by:
        addLearningSession in interface IAIClient
        Parameters:
        aiId - The ID of the AI to which you want to add the learning session
        learningSessionId - The ID of the learning session to add
        outputName - Name of the output this AI will learn
        Throws:
        ClientException - when 4xx or 5xx response is received from server, or errors in parsing the response.
      • addDataset

        public void addDataset​(java.lang.String aiId,
                               java.lang.String datasetId)
                        throws ClientException
        Add a Dataset to the AI
        Specified by:
        addDataset in interface IAIClient
        Parameters:
        aiId - The ID of the AI to which you want to add the dataset
        datasetId - The ID of the dataset to add
        Throws:
        ClientException - when 4xx or 5xx response is received from server, or errors in parsing the response.
      • getOutput

        public Output getOutput​(java.lang.String aiId,
                                java.lang.String outputTarget)
                         throws ClientException
        Retrieve the Output associated with an AI and target
        Specified by:
        getOutput in interface IAIClient
        Parameters:
        aiId - The ID of the AI to retrieve an output for
        outputTarget - The target of this output
        Returns:
        Output
        Throws:
        ClientException - when 4xx or 5xx response is received from server, or errors in parsing the response.
      • getOutputs

        public OutputList getOutputs​(java.lang.String aiId)
                              throws ClientException
        Retrieve a list of all outputs associated with an AI.
        Specified by:
        getOutputs in interface IAIClient
        Parameters:
        aiId - The ID of the AI to retrieve outputs for
        Returns:
        OutputList
        Throws:
        ClientException - when 4xx or 5xx response is received from server, or errors in parsing the response.
      • addOutput

        public void addOutput​(java.lang.String aiId,
                              java.lang.String learningSessionId,
                              java.lang.String outputName)
                       throws ClientException
        Add an Output to the AI
        Specified by:
        addOutput in interface IAIClient
        Parameters:
        aiId - The ID of the AI to which you want to add the dataset
        learningSessionId - The ID of the learning session
        outputName - The name of the output
        Throws:
        ClientException - when 4xx or 5xx response is received from server, or errors in parsing the response.
      • getOutputFeatures

        public OutputFeatures getOutputFeatures​(java.lang.String aiId,
                                                java.lang.String outputName)
                                         throws ClientException
        Retrieve features of an output associated with an AI and a target
        Specified by:
        getOutputFeatures in interface IAIClient
        Parameters:
        aiId - The ID of the AI to retrieve output features for
        outputName - The name of the output
        Returns:
        OutputFeatures
        Throws:
        ClientException - when 4xx or 5xx response is received from server, or errors in parsing the response.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object