Package com.datarobot.impl
Class LearningSessionClient
- java.lang.Object
-
- com.datarobot.impl.LearningSessionClient
-
- All Implemented Interfaces:
ILearningSessionClient,IDoGetCallback<LearningSession>
public class LearningSessionClient extends java.lang.Object implements ILearningSessionClient, IDoGetCallback<LearningSession>
TheLearningSessionClientobject provides access to the learning endpoints of the DataRobot AI API. This object is not meant to be used directly but through theIDataRobotAIClient#learning()method.
-
-
Constructor Summary
Constructors Constructor Description LearningSessionClient(IDataRobotAIClient client)ILearningSessionClientbased API operations.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddelete(java.lang.String id)Delete a learning sessionLearningSessionget(java.lang.String id)Retrieve aLearningSessionby idDeploymentgetDeployment(java.lang.String learningSessionId)Get the deployment associated with this learning session.EvaluationgetEvaluation(java.lang.String learningSessionId)Get performance information for the given learning session.LearningSessionFeaturesgetFeatures(java.lang.String learningSessionId)Retrieve features association with aLearningSession.Action<com.google.api.client.http.HttpRequest,com.google.api.client.http.HttpResponse>getHttpMessageTransformer()internalStatusTask<LearningSession>learn(java.lang.String datasetId, java.lang.String target)Create a learning session and wait for it to be able to predictLearningSessionListlist()Retrieve a list of learning sessions associated with this accountLearningSessionListlist(PagingParams params)Retrieve a list of learning sessions associated with this accountvoidsetHttpMessageTransformer(Action<com.google.api.client.http.HttpRequest,com.google.api.client.http.HttpResponse> httpMessageTransformer)internaljava.util.concurrent.Future<LearningSession>startLearn(java.lang.String datasetId, java.lang.String target)Set up a learning session without waiting for it to be ready.java.lang.StringtoString()
-
-
-
Constructor Detail
-
LearningSessionClient
public LearningSessionClient(IDataRobotAIClient client)
ILearningSessionClientbased API operations. Users will not need to instantiate this object directly. It can be accessed throughDataRobotAIClient.learning().- 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 interfaceILearningSessionClient
-
setHttpMessageTransformer
public void setHttpMessageTransformer(Action<com.google.api.client.http.HttpRequest,com.google.api.client.http.HttpResponse> httpMessageTransformer)
internal- Specified by:
setHttpMessageTransformerin interfaceILearningSessionClient
-
get
public LearningSession get(java.lang.String id) throws ClientException
Retrieve aLearningSessionby id- Specified by:
getin interfaceIDoGetCallback<LearningSession>- Specified by:
getin interfaceILearningSessionClient- Parameters:
id- The ID of the learning session to retrieve- Returns:
- The queried
LearningSession - Throws:
ClientException- when 4xx or 5xx response is received from server, or errors in parsing the response.
-
list
public LearningSessionList list() throws ClientException
Retrieve a list of learning sessions associated with this account- Specified by:
listin interfaceILearningSessionClient- Returns:
LearningSessionList- Throws:
ClientException- when 4xx or 5xx response is received from server, or errors in parsing the response.
-
list
public LearningSessionList list(PagingParams params) throws ClientException
Retrieve a list of learning sessions associated with this account- Specified by:
listin interfaceILearningSessionClient- Parameters:
params- ThePagingParamsobject for this list- Returns:
LearningSessionList- Throws:
ClientException- when 4xx or 5xx response is received from server, or errors in parsing the response.
-
delete
public void delete(java.lang.String id) throws ClientExceptionDelete a learning session- Specified by:
deletein interfaceILearningSessionClient- Parameters:
id- The ID of the learning session to delete- Throws:
ClientException- when 4xx or 5xx response is received from server, or errors in parsing the response.
-
learn
public StatusTask<LearningSession> learn(java.lang.String datasetId, java.lang.String target) throws ClientException
Create a learning session and wait for it to be able to predict- Specified by:
learnin interfaceILearningSessionClient- Parameters:
datasetId- The ID of the dataset to learn ontarget- The name of the feature from the dataset to learn how to predict- Returns:
- The new
LearningSession - Throws:
ClientException- when 4xx or 5xx response is received from server, or errors in parsing the response.
-
startLearn
public java.util.concurrent.Future<LearningSession> startLearn(java.lang.String datasetId, java.lang.String target) throws ClientException
Set up a learning session without waiting for it to be ready. To block until this process finishes, useILearningSessionClient.learn(java.lang.String, java.lang.String)instead or call.get()on the returnFuture<LearningSession>.- Specified by:
startLearnin interfaceILearningSessionClient- Parameters:
datasetId- The ID of the dataset to learn ontarget- The name of the feature from the dataset to learn how to predict- Returns:
- The new
FutureLearningSession - Throws:
ClientException- when 4xx or 5xx response is received from server, or errors in parsing the response.
-
getFeatures
public LearningSessionFeatures getFeatures(java.lang.String learningSessionId) throws ClientException
Retrieve features association with aLearningSession. Values for these features must be provided when making a prediction.- Specified by:
getFeaturesin interfaceILearningSessionClient- Parameters:
learningSessionId- The ID of the learning session- Returns:
LearningSessionFeatures- Throws:
ClientException- when 4xx or 5xx response is received from server, or errors in parsing the response.
-
getDeployment
public Deployment getDeployment(java.lang.String learningSessionId) throws ClientException
Get the deployment associated with this learning session. The resulting deployment can be used to predict viaIPredictionClient.deploymentPredict(com.datarobot.model.Deployment, java.lang.String)althoughLearningSession.predict(java.lang.String)can also be called directly on theLearningSessionobject.- Specified by:
getDeploymentin interfaceILearningSessionClient- Parameters:
learningSessionId- The ID of the learning session- Returns:
Deployment- Throws:
ClientException- when 4xx or 5xx response is received from server, or errors in parsing the response.
-
getEvaluation
public Evaluation getEvaluation(java.lang.String learningSessionId) throws ClientException
Get performance information for the given learning session. For details on how to interpret this information see the learning session documentation.- Specified by:
getEvaluationin interfaceILearningSessionClient- Parameters:
learningSessionId- The ID of the learning session- Returns:
Evaluation- Throws:
ClientException- when 4xx or 5xx response is received from server, or errors in parsing the response.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-