public class OpenmlBasicConnector extends Object implements Serializable
Modifier and Type | Field and Description |
---|---|
protected String |
api_key |
protected String |
API_PART |
protected String |
OPENML_URL |
protected int |
verboseLevel
When set to true, API will output information.
|
Constructor and Description |
---|
OpenmlBasicConnector() |
Modifier and Type | Method and Description |
---|---|
DataDelete |
dataDelete(int did)
Deletes a dataset from the server
|
DataFeature |
dataFeatures(int did)
Retrieves the features of a specified data set.
|
protected DataFeatureUpload |
dataFeaturesUpload(File description) |
DataSetDescription |
dataGet(int did)
Retrieves the description of a specified data set.
|
Data |
dataList(Map<String,String> filters)
Returns a list of dataset that corresponds to a set of filters
|
DataQuality |
dataQualities(int did,
Integer evalEngine)
Retrieves the qualities (meta-features) of a specified data set.
|
DataQualityList |
dataQualitiesList()
Returns a list with all available data qualities.
|
DataUnprocessed |
dataqualitiesUnprocessed(int evaluationEngineId,
String mode,
boolean featureQualities,
List<String> qualitiesToCalculate,
String priorityTag)
Returns a list of datasets that don't have all qualities calculated yet, given an
evaluation engine and set of qualities
|
protected DataQualityUpload |
dataQualitiesUpload(File description) |
DataReset |
dataReset(int did)
Resets a dataset (removes features, qualities, etc)
|
File |
datasetGet(DataSetDescription dsd)
Retrieves a dataset in ARFF format.
|
File |
datasetGetCsv(DataSetDescription dsd)
Retrieves a dataset in CSV format.
|
DataStatusUpdate |
dataStatusUpdate(int did,
String status)
Updates the status of a dataset (requires admin rights)
|
DataTag |
dataTag(int id,
String tag)
Tags a dataset
|
DataUnprocessed |
dataUnprocessed(int evaluationEngineId,
String mode)
Returns a list of unprocessed datasets, given an evaluation engine (no
features calculated, no errors registered)
|
DataUntag |
dataUntag(int id,
String tag)
Untags a dataset
|
protected UploadDataSet |
dataUpload(File description,
File dataset) |
EstimationProcedure |
estimationProcedureGet(int id)
Downloads an estimation procedure from OpenML
|
EstimationProcedures |
estimationProcedureList()
The list of all estimation procedures
|
EvaluationList |
evaluationList(List<Integer> task_id,
List<Integer> setup_id,
String function,
Integer limit)
Returns a list with evaluation results.
|
EvaluationRequest |
evaluationRequest(int evaluationEngineId,
String mode,
int numRequests,
Map<String,String> additionalFilters) |
FileUpload |
fileUpload(File file) |
FlowDelete |
flowDelete(int id)
Deletes a flow
|
FlowExists |
flowExists(String name,
String external_version)
Checks whether a flow exists, by name/external_version combination
|
FlowDelete |
flowForceDelete(int id) |
Flow |
flowGet(int flow_id)
Flow description
|
FlowTag |
flowTag(int id,
String tag)
Tags a flow.
|
FlowUntag |
flowUntag(int id,
String tag)
removes a tag from a flow
|
protected UploadFlow |
flowUpload(File description,
File binary,
File source) |
String |
getApiKey() |
String |
getApiUrl()
Returns the total API URL.
|
URL |
getOpenmlFileUrl(Integer file_id,
String filename) |
URL |
getOpenmlFileUrl(Integer file_id,
String filename,
String phpFunction) |
int |
getVerboselevel()
Returns the verbose level.
|
File |
getXSD(String name)
Returns an XSD file
|
RunDelete |
runDelete(int id)
Deletes a run and all it's important components
|
protected RunEvaluate |
runEvaluate(File description) |
Run |
runGet(int runId)
Downloads run information
|
RunList |
runList(Map<String,List<Integer>> filters,
Integer limit,
Integer offset)
Returns a list with run results.
|
RunReset |
runReset(int run_id)
Resets the evaluation of a run (admin right required)
|
RunTag |
runTag(int id,
String tag)
Tags a run
|
RunTrace |
runTrace(int trace_id)
Retrieves a run trace (Hyperparameter settings for HPO procedure)
|
protected RunTraceUpload |
runTraceUpload(File trace)
Uploads trace results in the database, typically used when an internal parameter optimization loop was executed.
|
RunUntag |
runUntag(int id,
String tag)
Removes a tag from a run
|
protected UploadRun |
runUpload(File description,
Map<String,File> output_files)
Uploads a run
|
void |
setApiKey(String api_key)
Updates the api key
|
SetupDelete |
setupDelete(int id)
Deletes a setup.
|
SetupDifferences |
setupDifferences(Integer setupA,
Integer setupB,
Integer task_id)
Returns a list of predictions on which two setups disagree
|
SetupDifferences |
setupDifferences(int setupA,
int setupB,
int task_id,
int task_size,
int differences)
Returns a list of predictions on which two setups disagree
|
SetupExists |
setupExists(File description)
A list with the parameter settings of a setup
|
SetupParameters |
setupParameters(int setup_id)
A list with the parameter settings of a setup
|
SetupTag |
setupTag(int id,
String tag)
Tags a setup
|
SetupUntag |
setupUntag(int id,
String tag)
Removes a tag from a setup
|
void |
setVerboseLevel(int level)
Sets the verbose level.
|
StudyAttach |
studyAttach(int id,
List<Integer> entity_ids) |
StudyDetach |
studyDetach(int id,
List<Integer> entity_ids) |
Study |
studyGet(int studyId) |
Study |
studyGet(int studyId,
String dataType) |
Study |
studyGet(String studyAlias,
String dataType) |
StudyList |
studyList(Map<String,String> filters) |
protected StudyUpload |
studyUpload(File description) |
TaskDelete |
taskDelete(int task_id)
Deletes a task
|
Task |
taskGet(int task_id)
Downloads the task description
|
TaskInputs |
taskInputs(int task_id)
Downloads a task according to new task format
|
Tasks |
taskList(Map<String,String> filters)
Returns a list of all of the tasks given a set of filters
|
File |
taskSplitsGet(Task task)
Downloads the data splits
|
TaskTag |
taskTag(int id,
String tag)
Tags a task
|
TaskUntag |
taskUntag(int id,
String tag)
Untags a task
|
protected UploadTask |
taskUpload(File description) |
protected int verboseLevel
protected String api_key
protected String OPENML_URL
protected String API_PART
public String getApiKey()
public void setApiKey(String api_key)
api_key
- - the api keypublic void setVerboseLevel(int level)
level
- - higher means more output.
0 = none, 1 = communication with server, 2 = also filespublic int getVerboselevel()
public String getApiUrl()
public File getXSD(String name) throws IOException
name
- - the file name of the xsd (e.g., openml.data.upload)IOException
- - problem downloading or storing the filepublic DataSetDescription dataGet(int did) throws Exception
did
- - The data_id of the data description to download.Exception
- - Can be: IOException (problem with connection, server),
ApiException (contains error code, see OpenML
documentation)public File datasetGet(DataSetDescription dsd) throws Exception
dsd
- - Description of the DatasetException
- - Can be: IOException (problem with connection, server),
ApiException (contains error code, see OpenML
documentation)public File datasetGetCsv(DataSetDescription dsd) throws Exception
dsd
- - Description of the DatasetException
- - Can be: IOException (problem with connection, server),
ApiException (contains error code, see OpenML
documentation)protected UploadDataSet dataUpload(File description, File dataset) throws Exception
Exception
public DataDelete dataDelete(int did) throws Exception
did
- - The data id to be deletedException
- - Can be: IOException (problem with connection, server),
ApiException (contains error code, see OpenML
documentation)public DataReset dataReset(int did) throws Exception
did
- - The data id to resetException
- - Can be: IOException (problem with connection, server),
ApiException (contains error code, see OpenML
documentation)public DataStatusUpdate dataStatusUpdate(int did, String status) throws Exception
did
- - The data id to resetstatus
- - The new status (active, deactivated)Exception
- - Can be: IOException (problem with connection, server),
ApiException (contains error code, see OpenML
documentation)public DataTag dataTag(int id, String tag) throws Exception
id
- - the dataset to be taggedtag
- - textual string to be added as tagException
- - Can be: IOException (problem with connection, server),
ApiException (contains error code, see OpenML
documentation)public DataUntag dataUntag(int id, String tag) throws Exception
id
- - the dataset to be taggedtag
- - textual string to be removed as tagException
- - Can be: IOException (problem with connection, server),
ApiException (contains error code, see OpenML
documentation)public DataFeature dataFeatures(int did) throws Exception
did
- - The id of the data features to download.Exception
- - Can be: IOException (problem with connection, server),
ApiException (contains error code, see OpenML
documentation)public Data dataList(Map<String,String> filters) throws Exception
filters
- - map of filters, see OpenML docs for an exhaustive listException
- - Can be: IOException (problem with connection, server),
ApiException (contains error code, see OpenML
documentation)public DataQuality dataQualities(int did, Integer evalEngine) throws Exception
did
- - The id of the data qualities to download.evalEngine
- - id of the evaluation engine responsible for qualitiesException
- - Can be: IOException (problem with connection, server),
ApiException (contains error code, see OpenML
documentation)protected DataFeatureUpload dataFeaturesUpload(File description) throws Exception
Exception
protected DataQualityUpload dataQualitiesUpload(File description) throws Exception
Exception
public DataQualityList dataQualitiesList() throws Exception
Exception
- - Can be: IOException (problem with connection, server),
ApiException (contains error code, see OpenML
documentation)public DataUnprocessed dataUnprocessed(int evaluationEngineId, String mode) throws Exception
evaluationEngineId
- - the evaluation engine idmode
- - either normal, reversed or randomException
- - Can be: IOException (problem with connection, server),
ApiException (contains error code, see OpenML
documentation)public DataUnprocessed dataqualitiesUnprocessed(int evaluationEngineId, String mode, boolean featureQualities, List<String> qualitiesToCalculate, String priorityTag) throws Exception
evaluationEngineId
- - the evaluation engine idmode
- - either normal, reversed or randomfeatureQualities
- - false for dataset qualities, true for feature qualitiesqualitiesToCalculate
- - list of qualities under considerationpriorityTag
- - datasets with this tag get prioritizedException
- - Can be: IOException (problem with connection, server),
ApiException (contains error code, see OpenML
documentation)public EstimationProcedure estimationProcedureGet(int id) throws Exception
id
- - the estimation procedure idException
- - Can be: IOException (problem with connection, server),
ApiException (contains error code, see OpenML
documentation)public EstimationProcedures estimationProcedureList() throws Exception
Exception
public Task taskGet(int task_id) throws Exception
task_id
- - The numeric id of the task to be obtained.Exception
- - Can be: IOException (problem with connection, server),
ApiException (contains error code, see OpenML
documentation)public File taskSplitsGet(Task task) throws Exception
task
- - the task objectException
- - Can be: IOException (problem with connection, server),
ApiException (contains error code, see OpenML
documentation)public TaskInputs taskInputs(int task_id) throws Exception
task_id
- - the task idException
- - Can be: IOException (problem with connection, server),
ApiException (contains error code, see OpenML
documentation)public Tasks taskList(Map<String,String> filters) throws Exception
filters
- - optional, a map of filtersException
- - Can be: IOException (problem with connection, server),
ApiException (contains error code, see OpenML
documentation)public TaskDelete taskDelete(int task_id) throws Exception
task_id
- - the task to be deletedException
- - Can be: IOException (problem with connection, server),
ApiException (contains error code, see OpenML
documentation)protected UploadTask taskUpload(File description) throws Exception
Exception
public TaskTag taskTag(int id, String tag) throws Exception
id
- - the task idtag
- - the tagException
- - Can be: IOException (problem with connection, server),
ApiException (contains error code, see OpenML
documentation)public TaskUntag taskUntag(int id, String tag) throws Exception
id
- - the task idtag
- - the tag to be removedException
- - Can be: IOException (problem with connection, server),
ApiException (contains error code, see OpenML
documentation)public Flow flowGet(int flow_id) throws Exception
flow_id
- - the id of the flow.Exception
- - Can be: IOException (problem with connection, server),
ApiException (contains error code, see OpenML
documentation)public FlowTag flowTag(int id, String tag) throws Exception
id
- - the flow idtag
- - the tag to be added to the flowException
- - Can be: IOException (problem with connection, server),
ApiException (contains error code, see OpenML
documentation)public FlowUntag flowUntag(int id, String tag) throws Exception
id
- - the flow idtag
- - the tag to be removedException
- - Can be: IOException (problem with connection, server),
ApiException (contains error code, see OpenML
documentation)public FlowDelete flowDelete(int id) throws Exception
id
- - The numeric id of the implementation to be deleted.Exception
- - Can be: IOException (problem with connection, server),
ApiException (contains error code, see OpenML
documentation)public FlowDelete flowForceDelete(int id) throws Exception
Exception
public FlowExists flowExists(String name, String external_version) throws Exception
name
- - The name of the implementation to be checkedexternal_version
- - The external version (workbench version). If not a proper
revision number is available, it is recommended to use a MD5
hash of the source code.Exception
- - Can be: IOException (problem with connection, server),
ApiException (contains error code, see OpenML
documentation)protected UploadFlow flowUpload(File description, File binary, File source) throws Exception
Exception
protected UploadRun runUpload(File description, Map<String,File> output_files) throws Exception
description
- - An XML file describing the run. See documentation at
openml.org.output_files
- - A Map>String,File< containing all relevant output files. Key
"predictions" usually contains the predictions that were
generated by this run.Exception
- - Can be: IOException (problem with connection, server),
ApiException (contains error code, see OpenML
documentation)public RunList runList(Map<String,List<Integer>> filters, Integer limit, Integer offset) throws Exception
filters
- - filters to limit the number of resultslimit
- - maximal number of results allowedoffset
- - number of results to ignore (from the beginning)Exception
- - Can be: IOException (problem with connection, server),
ApiException (contains error code, see OpenML
documentation)public EvaluationList evaluationList(List<Integer> task_id, List<Integer> setup_id, String function, Integer limit) throws Exception
task_id
- - a list with task ids to include (null to not restrict on tasks)setup_id
- - a list with setup ids to include (null to not restrict on setups)function
- - the evaluation measure interested inlimit
- - the maximal result sizeException
- - Can be: IOException (problem with connection, server),
ApiException (contains error code, see OpenML
documentation)public EvaluationRequest evaluationRequest(int evaluationEngineId, String mode, int numRequests, Map<String,String> additionalFilters) throws Exception
Exception
public RunTag runTag(int id, String tag) throws Exception
id
- - The run idtag
- - The tagException
- - Can be: IOException (problem with connection, server),
ApiException (contains error code, see OpenML
documentation)public RunUntag runUntag(int id, String tag) throws Exception
id
- - the run idtag
- - the tag to be removedException
- - Can be: IOException (problem with connection, server),
ApiException (contains error code, see OpenML
documentation)protected RunEvaluate runEvaluate(File description) throws Exception
Exception
protected RunTraceUpload runTraceUpload(File trace) throws Exception
trace
- - the trace description xmlException
- - Can be: IOException (problem with connection, server),
ApiException (contains error code, see OpenML
documentation)public RunTrace runTrace(int trace_id) throws Exception
trace_id
- - the trace description xmlException
- - Can be: IOException (problem with connection, server),
ApiException (contains error code, see OpenML
documentation)public Run runGet(int runId) throws Exception
runId
- - the run idException
- - Can be: IOException (problem with connection, server),
ApiException (contains error code, see OpenML
documentation)public RunDelete runDelete(int id) throws Exception
id
- - The numeric id of the run to be deleted.Exception
- - Can be: IOException (problem with connection, server),
ApiException (contains error code, see OpenML
documentation)public RunReset runReset(int run_id) throws Exception
run_id
- - the id of the run to resetException
- - Can be: IOException (problem with connection, server),
ApiException (contains error code, see OpenML
documentation)public SetupExists setupExists(File description) throws Exception
description
- - a file equivalent to run description, but only featuring the parts important to parametersException
- - Can be: IOException (problem with connection, server),
ApiException (contains error code, see OpenML
documentation)public SetupParameters setupParameters(int setup_id) throws Exception
setup_id
- - the id of the setupException
- - Can be: IOException (problem with connection, server),
ApiException (contains error code, see OpenML
documentation)public SetupTag setupTag(int id, String tag) throws Exception
id
- - the setup idtag
- - the tagException
- - Can be: IOException (problem with connection, server),
ApiException (contains error code, see OpenML
documentation)public SetupUntag setupUntag(int id, String tag) throws Exception
id
- - the setup idtag
- - the tag to be removedException
- - Can be: IOException (problem with connection, server),
ApiException (contains error code, see OpenML
documentation)public SetupDelete setupDelete(int id) throws Exception
id
- - the id of the setup to be deleted
- The numeric id of the setup to be deleted.Exception
- - Can be: IOException (problem with connection, server),
ApiException (contains error code, see OpenML
documentation)public SetupDifferences setupDifferences(Integer setupA, Integer setupB, Integer task_id) throws Exception
setupA
- - a setup idsetupB
- - a setup idtask_id
- - the task idException
- - Can be: IOException (problem with connection, server),
ApiException (contains error code, see OpenML
documentation)public SetupDifferences setupDifferences(int setupA, int setupB, int task_id, int task_size, int differences) throws Exception
setupA
- - a setup idsetupB
- - a setup idtask_id
- - the task idtask_size
- - // TODOdifferences
- // TODOException
- - Can be: IOException (problem with connection, server),
ApiException (contains error code, see OpenML
documentation)public FileUpload fileUpload(File file) throws Exception
Exception
public Study studyGet(String studyAlias, String dataType) throws Exception
Exception
protected StudyUpload studyUpload(File description) throws Exception
Exception
public StudyAttach studyAttach(int id, List<Integer> entity_ids) throws Exception
Exception
public StudyDetach studyDetach(int id, List<Integer> entity_ids) throws Exception
Exception
public URL getOpenmlFileUrl(Integer file_id, String filename) throws Exception
Exception
Copyright © 2019 Leiden University, NL. All rights reserved.