Package com.datarobot.impl
Class PredictionClient
- java.lang.Object
-
- com.datarobot.impl.PredictionClient
-
- All Implemented Interfaces:
IPredictionClient
public class PredictionClient extends java.lang.Object implements IPredictionClient
ThePredictionClientobject provides access to the prediction endpoints of the DataRobot AI API. This object is not meant to be used directly but through theDataRobotAIClient.predict()method.
-
-
Constructor Summary
Constructors Constructor Description PredictionClient(IDataRobotAIClient client)IPredictionClientbased API operations.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PredictionListaiPredict(java.lang.String aiId, java.lang.String target, java.lang.String data)Retrieve AI predictions against data.PredictionListdeploymentPredict(Deployment deployment, java.lang.String sourceFile)Send a prediction request to the specified deploymentAction<com.google.api.client.http.HttpRequest,com.google.api.client.http.HttpResponse>getHttpMessageTransformer()internalvoidsetHttpMessageTransformer(Action<com.google.api.client.http.HttpRequest,com.google.api.client.http.HttpResponse> httpMessageTransformer)internaljava.lang.StringtoString()
-
-
-
Constructor Detail
-
PredictionClient
public PredictionClient(IDataRobotAIClient client)
IPredictionClientbased API operations. Users will not need to instantiate this object directly. It can be accessed throughDataRobotAIClient#predict.- Parameters:
client-DataRobotAIClient
-
-
Method Detail
-
getHttpMessageTransformer
public Action<com.google.api.client.http.HttpRequest,com.google.api.client.http.HttpResponse> getHttpMessageTransformer()
internal- Specified by:
getHttpMessageTransformerin interfaceIPredictionClient
-
setHttpMessageTransformer
public void setHttpMessageTransformer(Action<com.google.api.client.http.HttpRequest,com.google.api.client.http.HttpResponse> httpMessageTransformer)
internal- Specified by:
setHttpMessageTransformerin interfaceIPredictionClient
-
deploymentPredict
public PredictionList deploymentPredict(Deployment deployment, java.lang.String sourceFile) throws ClientException, java.io.FileNotFoundException
Send a prediction request to the specified deployment- Specified by:
deploymentPredictin interfaceIPredictionClient- Parameters:
deployment- Who will service the requestsourceFile- The data on which to predict via a filepath on the local system- Returns:
PredictionList- Throws:
ClientException- when 4xx or 5xx response is received from server, or errors in parsing the response.java.io.FileNotFoundException- when a file with the specified pathname does not exist, or if the file does exist but is inaccessible for some reason.
-
aiPredict
public PredictionList aiPredict(java.lang.String aiId, java.lang.String target, java.lang.String data) throws ClientException, java.io.FileNotFoundException
Retrieve AI predictions against data. Note an AI must be trained withAI.learn(java.lang.String, java.lang.String)or an existing learning session must be added to the AI withAI.addLearningSession(com.datarobot.model.LearningSession)orIAIClient.addLearningSession(java.lang.String, java.lang.String, java.lang.String)before predictions can occur.- Specified by:
aiPredictin interfaceIPredictionClient- Parameters:
aiId- The ID of the AI which to predict ontarget- The name of the selected target feature to predictdata- The data on which to predict via a filepath on the local system- Returns:
PredictionList- Throws:
ClientException- when 4xx or 5xx response is received from server, or errors in parsing the response.java.io.FileNotFoundException- when a file with the specified pathname does not exist, or if the file does exist but is inaccessible for some reason.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-