summaryrefslogtreecommitdiff
path: root/EXAMPLES
blob: 30538cfb85fb452df14ffe921b6add21151b58f4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
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 <validation_service>

result example (accept-header: application/rdf-xml)			
<<< not yet supported

result example (accept-header: text/uri-list)
<<< <validation_service>/<validation_id>
<<< <validation_service>/validation_id_i
<<< <validation_service>/validation_id_j


search available validations with url-encoded parameters
-------------------------------------------------------------------

>>> curl <validation_service>?training_dataset_uri=<training_dataset_uri>&algorithm_uri=<algorithm_uri>

Hint: you can perform a pattern search (instead of an exact match search) by adding a _like to the parameter, i.e. training_dataset_uri_like 

result example (accept-header: application/rdf-xml)			
<<< not yet supported

result example (accept-header: text/uri-list)
<<< <validation_service>/<validation_id>
<<< <validation_service>/validation_id_i
<<< <validation_service>/validation_id_j


get validation
-------------------------------------------------------------------

>>> curl <validation_service>/<validation_id>

supported accept-headers: "text/x-yaml" and "application/rdf-xml"			
	
	
validate model on test-dateset
-------------------------------------------------------------------	

>>> curl -X POST -d model_uri="<model_uri>" \
 -d test_dataset_uri="<test_dataset_uri>" \
 -d test_target_dataset_uri="<dataset_uri>" \
 <validation_service>
 
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)
<<< <validation_service>/id_i


validate an algorithm on a training- and test-dataset
-------------------------------------------------------------------

>>> curl -X POST -d algorithm_uri="<algorithm_uri>" \
 -d training_dataset_uri="<training_dataset_uri>" \
 -d test_dataset_uri="<test_dataset_uri>" \
 -d test_target_dataset_uri="<dataset_uri>" \
 -d prediction_feature="<prediction_feature>" \
 -d algorithm_params="<algorithm_params>" \
 <validation_service>

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)
<<< <validation_service>/id_i


create a validation by comparing feature values
-----------------------------------------------------

>>> curl -X POST -d test_dataset_uri="<test_dataset_uri>" \
 -d test_target_dataset_uri="<dataset_uri>" \
 -d prediction_dataset_uri="<prediction_dataset_uri>" \
 -d prediction_feature="<prediction_feature>" \
 -d predicted_feature="<predicted_feature>" \
 -d classification="true" \
 <validation_service>/validate_datasets

optional params:
test_target_dataset_uri, default is test_dataset_uri
regression or classification has to be specified
 
result example (accept-header: text/uri-list)
<<< <validation_service>/id_i
 

validate an algorithm on a dataset via training-test-split
-------------------------------------------------------------------

>>> curl -X POST -d algorithm_uri="<algorithm_uri>" \
 -d dataset_uri="<dataset_uri>" \
 -d prediction_feature="<prediction_feature>" \
 -d algorithm_params="<algorithm_params>" \
 -d split_ratio=0.9 \
 -d random_seed=2 \
 <validation_service>/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)
<<< <validation_service>/id_i


get list of available crossvalidations
-------------------------------------------------------------------

>>> curl <validation_service>/crossvalidation

result example (accept-header: application/rdf-xml)			
<<< not yet supported

result example (accept-header: text/uri-list)
<<< <validation_service>/crossvalidation/<crossvalidation_id>
<<< <validation_service>/crossvalidation/crossvalidation_id_i
<<< <validation_service>/crossvalidation/crossvalidation_id_j


get crossvalidation
-------------------------------------------------------------------

>>> curl <validation_service>/crossvalidation/<crossvalidation_id>

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="<algorithm_uri>" \
 -d dataset_uri="<dataset_uri>" \
 -d prediction_feature="<prediction_feature>" \
 -d algorithm_params="<algorithm_params>" \
 -d num_folds=5 \
 -d random_seed=2 \
 -d stratified=false \
 <validation_service>/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)
<<< <validation_service>/crossvalidation/id_i



API-Examples Reports
===================================================================


get list of available report types
-------------------------------------------------------------------

>>> curl <validation_service>/report

result example (accept-header: application/rdf-xml)			
<<< not yet supported

result example (accept-header: text/uri-list)
<<< <validation_service>/report/validation
<<< <validation_service>/report/crossvalidation
<<< <validation_service>/report/algorithm_comparison


get list of available reports of type validation
-------------------------------------------------------------------

>>> curl <validation_service>/report/validation

result example (accept-header: application/rdf-xml)			
<<< not yet supported

result example (accept-header: text/uri-list)
<<< <validation_service>/report/validation/<validation_report_id>
<<< <validation_service>/report/validation/id_i
<<< <validation_service>/report/validation/id_j


get validation report
-------------------------------------------------------------------

>>> curl <validation_service>/report/validation/<validation_report_id>

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 <validation_service>/report/validation/<validation_report_id> with a browser to see the report in html format


create validation report from validation
-------------------------------------------------------------------

>>> curl -X POST -d validation_uris="<validation_service>/<validation_id>" \
 <validation_service>/report/validation

result example (accept-header: application/rdf-xml)			
<<< not yet supported

result example (accept-header: text/uri-list)
<<< <validation_service>/report/validation/id_i


get list of available reports of type crossvalidation
-------------------------------------------------------------------

>>> curl <validation_service>/report/crossvalidation

result example (accept-header: application/rdf-xml)			
<<< not yet supported

result example (accept-header: text/uri-list)
<<< <validation_service>/report/crossvalidation/<crossvalidation_report_id>
<<< <validation_service>/report/crossvalidation/id_i
<<< <validation_service>/report/crossvalidation/id_j


get crossvalidation report
-------------------------------------------------------------------

>>> curl <validation_service>/report/crossvalidation/<crossvalidation_report_id>

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 <validation_service>/report/crossvalidation/<crossvalidation_report_id> with a browser to see the report in html format


create crossvalidation report from crossvalidation
-------------------------------------------------------------------

>>> curl -X POST -d validation_uris="<validation_service>/crossvalidation/<crossvalidation_id>" \
 <validation_service>/report/crossvalidation

result example (accept-header: application/rdf-xml)			
<<< not yet supported

result example (accept-header: text/uri-list)
<<< <validation_service>/report/crossvalidation/id_i


manually format html report
-------------------------------------------------------------------

>>> curl -X POST -d css_style_sheet=<css_file> \
  <validation_service>/report/crossvalidation/<crossvalidation_report_id>/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)
<<< <validation_service>/report/crossvalidation/id_i