Package com.datarobot.model
Class AI
- java.lang.Object
-
- com.datarobot.model.AI
-
- All Implemented Interfaces:
INeedClient,java.io.Serializable
public class AI extends java.lang.Object implements java.io.Serializable, INeedClient
A container for multiple learning sessions, dataset, and other entities in DataRobot AI. An AI groups together different entities necessary to solve a business problem, rather than being strictly focused on delivering a single model without any additional context.Note that this object is also a reference to a
AIon the DataRobot server. Client code that uses the DataRobot AI API package generally should not construct these objects directly, they should be instantiated by AI API Client methods. This object may be out of sync with the DataRobot sever, for example, if multiple processes or users have permission to modify or delete it on the server.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description AI()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddDataset(Dataset dataset)voidaddLearningSession(LearningSession learningSession)Add aLearningSessionto thisLearningSessionvoidaddOutput(java.lang.String learningSessionId, java.lang.String outputName)Add aOutputto thisLearningSessionorg.joda.time.DateTimegetCreatedDate()Get the date thisAIwas createdintgetDatasetCount()DatasetListgetDatasets()java.lang.StringgetDatasetUrl()java.lang.StringgetId()Get the unique identifier for thisAIintgetLearningSessionCount()Get the number ofLearningSessionobjects associated with thisAILearningSessionListgetLearningSessions()Retrieve a list ofLearningSessionobjects associated with thisAIjava.lang.StringgetLearningSessionUrlList()Get a URL for the list ofLearningSessionobjects associated with thisAIjava.lang.StringgetName()Get the name of thisAIOutputgetOutput(java.lang.String outputTarget)intgetOutputCount()java.lang.StringgetOutputListUrl()OutputListgetOutputs()DatasetimportFile(java.lang.String filepath)Import a file to an AI.DatasetimportUrl(java.lang.String url)Import a file to an AI via a public URL.PredictionListinfer(java.lang.String target, java.lang.String sourceFile)Retrieve ai predictionsAIlearn(java.lang.String target, java.lang.String sourcefile)Create aLearningSessiondirectly associated to thisAIPredictionListpredict(java.lang.String target, java.lang.String sourceFile)Retrieve AI predictionsvoidsetClient(IDataRobotAIClient client)internalvoidsetDatasetCount(int datasetCount)internalvoidsetDatasetListUrl(java.lang.String datasetListUrl)internalvoidsetId(java.lang.String id)internalvoidsetLearningSessionCount(int learningSessionCount)internalvoidsetLearningSessionListUrl(java.lang.String learningSessionListUrl)internalvoidsetName(java.lang.String name)internalvoidsetOutputCount(int outputCount)internalvoidsetOutputListUrl(java.lang.String outputListUrl)internalvoidsync()java.lang.StringtoString()
-
-
-
Method Detail
-
getOutputListUrl
public java.lang.String getOutputListUrl()
- Returns:
- URL location of the output list associated with this AI
-
getDatasetUrl
public java.lang.String getDatasetUrl()
- Returns:
- URL location of the dataset list associated with this AI
-
getLearningSessionUrlList
public java.lang.String getLearningSessionUrlList()
Get a URL for the list ofLearningSessionobjects associated with thisAI- Returns:
- URL location of the learning session list associated with this AI
-
getName
public java.lang.String getName()
Get the name of thisAI- Returns:
- The name of this AI
-
getOutputCount
public int getOutputCount()
- Returns:
- The number of AI outputs
-
getDatasetCount
public int getDatasetCount()
- Returns:
- The number of AI datasets
-
getLearningSessionCount
public int getLearningSessionCount()
Get the number ofLearningSessionobjects associated with thisAI- Returns:
- The number of AI learning sessions
-
getId
public java.lang.String getId()
Get the unique identifier for thisAI- Returns:
- The ID of this AI
-
getCreatedDate
public org.joda.time.DateTime getCreatedDate()
Get the date thisAIwas created- Returns:
- The creation date of this AI
-
setOutputListUrl
public void setOutputListUrl(java.lang.String outputListUrl)
internal
-
setDatasetListUrl
public void setDatasetListUrl(java.lang.String datasetListUrl)
internal
-
setLearningSessionListUrl
public void setLearningSessionListUrl(java.lang.String learningSessionListUrl)
internal
-
setName
public void setName(java.lang.String name)
internal
-
setOutputCount
public void setOutputCount(int outputCount)
internal
-
setDatasetCount
public void setDatasetCount(int datasetCount)
internal
-
setLearningSessionCount
public void setLearningSessionCount(int learningSessionCount)
internal
-
setId
public void setId(java.lang.String id)
internal
-
setClient
public void setClient(IDataRobotAIClient client)
internal- Specified by:
setClientin interfaceINeedClient
-
importFile
public Dataset importFile(java.lang.String filepath) throws java.io.FileNotFoundException, ClientException, java.lang.InterruptedException
Import a file to an AI. See the Dataset page in the documentation for size limitations.- Parameters:
filepath- The path of a local file to upload- Returns:
Dataset- 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.java.lang.InterruptedException- when a thread is waiting, sleeping, or otherwise occupied, and the thread is interrupted, either before or during the activity.
-
importUrl
public Dataset importUrl(java.lang.String url) throws ClientException, java.lang.InterruptedException
Import a file to an AI via a public URL. See the Dataset page in the documentation for size limitations.- Parameters:
url- The url to a publically available file- Returns:
Dataset- 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.
-
addDataset
public void addDataset(Dataset dataset) throws ClientException
- Parameters:
dataset- The dataset which to add- Throws:
ClientException- when 4xx or 5xx response is received from server, or errors in parsing the response.
-
addLearningSession
public void addLearningSession(LearningSession learningSession) throws ClientException
Add aLearningSessionto thisLearningSession- Parameters:
learningSession- The learning session which to add- Throws:
ClientException- when 4xx or 5xx response is received from server, or errors in parsing the response.
-
learn
public AI learn(java.lang.String target, java.lang.String sourcefile) throws ClientException, java.lang.InterruptedException, java.io.FileNotFoundException
Create aLearningSessiondirectly associated to thisAI- Parameters:
target- The name of the selected target feature to learnsourcefile- The data on which to learn via a path to a local file- Returns:
- The
AIthis learning session was created with - 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.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.
-
predict
public PredictionList predict(java.lang.String target, java.lang.String sourceFile) throws java.io.FileNotFoundException, ClientException
Retrieve AI predictions- Parameters:
target- The name of the selected target feature to predictsourceFile- The data on which to make predictions via a path to a local file- Returns:
PredictionList- Throws:
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.ClientException- when 4xx or 5xx response is received from server, or errors in parsing the response.
-
infer
public PredictionList infer(java.lang.String target, java.lang.String sourceFile) throws java.io.FileNotFoundException, ClientException
Retrieve ai predictions- Parameters:
target- The name of the selected target feature to predictsourceFile- The data on which to make predictions via a path to a local file- Returns:
PredictionList- Throws:
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.ClientException- when 4xx or 5xx response is received from server, or errors in parsing the response.
-
getOutput
public Output getOutput(java.lang.String outputTarget) throws ClientException
- Parameters:
outputTarget- The target of the output- Returns:
Output- Throws:
ClientException- when 4xx or 5xx response is received from server, or errors in parsing the response.
-
getOutputs
public OutputList getOutputs() throws ClientException
- 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 learningSessionId, java.lang.String outputName) throws ClientExceptionAdd aOutputto thisLearningSession- Parameters:
learningSessionId- The ID of the learning session this output is connected tooutputName- The name of the output to add- Throws:
ClientException- when 4xx or 5xx response is received from server, or errors in parsing the response.
-
getLearningSessions
public LearningSessionList getLearningSessions() throws ClientException
Retrieve a list ofLearningSessionobjects associated with thisAI- Returns:
LearningSessionList- Throws:
ClientException- when 4xx or 5xx response is received from server, or errors in parsing the response.
-
getDatasets
public DatasetList getDatasets() throws ClientException
- Returns:
DatasetList- Throws:
ClientException- when 4xx or 5xx response is received from server, or errors in parsing the response.
-
sync
public void sync() throws ClientException- Throws:
ClientException
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-