API-Definition =================================================================== see http://opentox.org/dev/apis/api-1.1/Validation API-Examples Validation =================================================================== how to ------------------------------------------------------------------- the examples listed below can be performed with the command line tool curl get list of available validations ------------------------------------------------------------------- >>> curl result example (accept-header: application/rdf+xml) <<< not yet supported result example (accept-header: text/uri-list) <<< / <<< /validation_id_i <<< /validation_id_j get validation ------------------------------------------------------------------- >>> curl / supported accept-headers: "text/x-yaml" and "application/rdf+xml" validate model on test-dateset ------------------------------------------------------------------- >>> curl -X POST -d model_uri="" \ -d test_dataset_uri="" \ -d test_target_dataset_uri="" \ /test_set_validation optional params: test_target_dataset_uri, default is test_dataset_uri result example (accept-header: application/rdf+xml) <<< not yet supported result example (accept-header: text/uri-list) <<< /id_i validate an algorithm on a training- and test-dataset ------------------------------------------------------------------- >>> curl -X POST -d algorithm_uri="" \ -d training_dataset_uri="" \ -d test_dataset_uri="" \ -d test_target_dataset_uri="" \ -d prediction_feature="" \ -d algorithm_params="" \ /training_test_validation optional params: algorithm_params, default is empty test_target_dataset_uri, default is test_dataset_uri result example (accept-header: application/rdf+xml) <<< not yet supported result example (accept-header: text/uri-list) <<< /id_i validate an algorithm on a dataset via training-test-split ------------------------------------------------------------------- >>> curl -X POST -d algorithm_uri="" \ -d dataset_uri="" \ -d prediction_feature="" \ -d algorithm_params="" \ -d split_ratio=0.9 \ -d random_seed=2 \ /training_test_split optional params: algorithm_params, default is empty split_ratio, default is 0.67 random_seed, default is 1 result example (accept-header: application/rdf+xml) <<< not yet supported result example (accept-header: text/uri-list) <<< /id_i validate an algorithm on a dataset via bootstrapping ------------------------------------------------------------------- >>> curl -X POST -d algorithm_uri="" \ -d dataset_uri="" \ -d prediction_feature="" \ -d algorithm_params="" \ -d random_seed=2 \ /bootstrapping optional params: algorithm_params, default is empty random_seed, default is 1 result example (accept-header: application/rdf+xml) <<< not yet supported result example (accept-header: text/uri-list) <<< /id_i get list of available crossvalidations ------------------------------------------------------------------- >>> curl /crossvalidation result example (accept-header: application/rdf+xml) <<< not yet supported result example (accept-header: text/uri-list) <<< /crossvalidation/ <<< /crossvalidation/crossvalidation_id_i <<< /crossvalidation/crossvalidation_id_j get crossvalidation ------------------------------------------------------------------- >>> curl /crossvalidation/ supported accept-headers: "text/x-yaml" and "application/rdf+xml" validate an algorithm on a dataset via crossvalidation (may take a couple of minutes) ------------------------------------------------------------------- >>> curl -X POST -d algorithm_uri="" \ -d dataset_uri="" \ -d prediction_feature="" \ -d algorithm_params="" \ -d num_folds=5 \ -d random_seed=2 \ -d stratified=false \ /crossvalidation optional params: algorithm_params, default is empty num_folds, default is 10 random_seed, default is 1 stratified, default is false result example (accept-header: application/rdf+xml) <<< not yet supported result example (accept-header: text/uri-list) <<< /crossvalidation/id_i API-Examples Reports =================================================================== get list of available report types ------------------------------------------------------------------- >>> curl /report result example (accept-header: application/rdf+xml) <<< not yet supported result example (accept-header: text/uri-list) <<< /report/validation <<< /report/crossvalidation <<< /report/algorithm_comparison get list of available reports of type validation ------------------------------------------------------------------- >>> curl /report/validation result example (accept-header: application/rdf+xml) <<< not yet supported result example (accept-header: text/uri-list) <<< /report/validation/ <<< /report/validation/id_i <<< /report/validation/id_j get validation report ------------------------------------------------------------------- >>> curl /report/validation/ Supported formats (accept-headers): * "text/xml" content of report in docbook-article format * "text/html" report formated with default docbook-article-xsl * "text/x-yaml" returns report object with meta-info (without the actual report content) * "application/rdf+xml" returns report object with meta-info (without the actual report content) Hint: Visit /report/validation/ with a browser to see the report in html format create validation report from validation ------------------------------------------------------------------- >>> curl -X POST -d validation_uris="/" \ /report/validation result example (accept-header: application/rdf+xml) <<< not yet supported result example (accept-header: text/uri-list) <<< /report/validation/id_i get list of available reports of type crossvalidation ------------------------------------------------------------------- >>> curl /report/crossvalidation result example (accept-header: application/rdf+xml) <<< not yet supported result example (accept-header: text/uri-list) <<< /report/crossvalidation/ <<< /report/crossvalidation/id_i <<< /report/crossvalidation/id_j get crossvalidation report ------------------------------------------------------------------- >>> curl /report/crossvalidation/ Supported formats (accept-headers): * "text/xml" content of report in docbook-article format * "text/html" report formated with default docbook-article-xsl * "text/x-yaml" returns report object with meta-info (without the actual report content) * "application/rdf+xml" returns report object with meta-info (without the actual report content) Hint: Visit /report/crossvalidation/ with a browser to see the report in html format create crossvalidation report from crossvalidation ------------------------------------------------------------------- >>> curl -X POST -d validation_uris="/crossvalidation/" \ /report/crossvalidation result example (accept-header: application/rdf+xml) <<< not yet supported result example (accept-header: text/uri-list) <<< /report/crossvalidation/id_i manually format html report ------------------------------------------------------------------- >>> curl -X POST -d css_style_sheet= \ /report/crossvalidation//format_html This explicity invokes the report convertion to html, with css-style-sheet as parameter. result example (accept-header: application/rdf+xml) <<< not yet supported result example (accept-header: text/uri-list) <<< /report/crossvalidation/id_i Filter resources =================================================================== It is possible to filter the list of available resources (i.e. validations, crossvalidation, reports) according to property-values. filter available validations for a particular training dataset and model ------------------------------------------------------------------- >>> curl ?trainingDataset=\&model= alternatively, use property names in (internal) yaml format: >>> curl ?training_dataset_uri=\&model_uri= search available validation report for a particular algorithm ------------------------------------------------------------------- >>> curl /report/validation?algorithm=lazar alternatively, use property names in (internal) yaml format: >>> curl /report/validation?algorithm_uris=lazar Reach reporting =================================================================== get list of available qmrf report ------------------------------------------------------------------- >>> curl /reach_report/qmrf result example (accept-header: application/rdf+xml) <<< not yet supported result example (accept-header: text/uri-list) <<< /reach_report/qmrf/ <<< /reach_report/qmrf/report_id_i <<< /reach_report/qmrf/report_id_j create a QMRF from a model ------------------------------------------------------------------- >>> curl -X POST -d model_uri="" \ /reach_report/qmrf result example (accept-header: application/rdf+xml) <<< not yet supported result example (accept-header: text/uri-list) <<< /reach_report/qmrf/id