big_ml 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (61) hide show
  1. data/.gitignore +19 -0
  2. data/.rspec +2 -0
  3. data/.rvmrc +1 -0
  4. data/.rvmrc.example +1 -0
  5. data/.travis.yml +4 -0
  6. data/CHANGELOG.md +8 -0
  7. data/Gemfile +4 -0
  8. data/LICENSE +22 -0
  9. data/README.md +49 -0
  10. data/Rakefile +6 -0
  11. data/TODO.md +6 -0
  12. data/big_ml.gemspec +23 -0
  13. data/lib/big_ml/authenticable.rb +10 -0
  14. data/lib/big_ml/base.rb +51 -0
  15. data/lib/big_ml/client.rb +29 -0
  16. data/lib/big_ml/config.rb +30 -0
  17. data/lib/big_ml/dataset.rb +19 -0
  18. data/lib/big_ml/model.rb +21 -0
  19. data/lib/big_ml/prediction.rb +19 -0
  20. data/lib/big_ml/request.rb +29 -0
  21. data/lib/big_ml/source.rb +18 -0
  22. data/lib/big_ml/version.rb +3 -0
  23. data/lib/big_ml.rb +13 -0
  24. data/spec/fixtures/iris.csv +151 -0
  25. data/spec/integration/dataset_spec.rb +51 -0
  26. data/spec/integration/model_spec.rb +53 -0
  27. data/spec/integration/prediction_spec.rb +55 -0
  28. data/spec/integration/source_spec.rb +55 -0
  29. data/spec/spec_helper.rb +22 -0
  30. data/spec/units/client_spec.rb +50 -0
  31. data/spec/units/source_spec.rb +20 -0
  32. data/spec/vcr_cassettes/BigML_Dataset/no_dataset/_all/must_be_empty.yml +136 -0
  33. data/spec/vcr_cassettes/BigML_Dataset/one_dataset/must_be_able_to_be_find_using_the_reference.yml +293 -0
  34. data/spec/vcr_cassettes/BigML_Dataset/one_dataset/must_be_able_to_remove_the_dataset.yml +318 -0
  35. data/spec/vcr_cassettes/BigML_Dataset/one_dataset/must_be_able_to_update_the_name.yml +360 -0
  36. data/spec/vcr_cassettes/BigML_Dataset/one_dataset/must_have_only_one_item.yml +265 -0
  37. data/spec/vcr_cassettes/BigML_Dataset/one_dataset/must_have_the_same_file_name.yml +265 -0
  38. data/spec/vcr_cassettes/BigML_Dataset/one_dataset/was_created_successfully.yml +149 -0
  39. data/spec/vcr_cassettes/BigML_Model/no_model/_all/must_be_empty.yml +166 -0
  40. data/spec/vcr_cassettes/BigML_Model/one_model/must_be_able_to_be_find_using_the_reference.yml +446 -0
  41. data/spec/vcr_cassettes/BigML_Model/one_model/must_be_able_to_remove_the_model.yml +426 -0
  42. data/spec/vcr_cassettes/BigML_Model/one_model/must_be_able_to_update_the_name.yml +558 -0
  43. data/spec/vcr_cassettes/BigML_Model/one_model/must_have_only_one_item.yml +258 -0
  44. data/spec/vcr_cassettes/BigML_Model/one_model/must_have_the_same_file_name.yml +375 -0
  45. data/spec/vcr_cassettes/BigML_Model/one_model/must_have_the_same_size.yml +375 -0
  46. data/spec/vcr_cassettes/BigML_Model/one_model/was_created_successfully.yml +298 -0
  47. data/spec/vcr_cassettes/BigML_Prediction/no_prediction/_all/must_be_empty.yml +305 -0
  48. data/spec/vcr_cassettes/BigML_Prediction/one_prediction/must_be_able_to_be_find_using_the_reference.yml +502 -0
  49. data/spec/vcr_cassettes/BigML_Prediction/one_prediction/must_be_able_to_remove_the_prediction.yml +547 -0
  50. data/spec/vcr_cassettes/BigML_Prediction/one_prediction/must_be_able_to_update_the_name.yml +546 -0
  51. data/spec/vcr_cassettes/BigML_Prediction/one_prediction/must_have_only_one_item.yml +503 -0
  52. data/spec/vcr_cassettes/BigML_Prediction/one_prediction/must_have_the_same_name.yml +420 -0
  53. data/spec/vcr_cassettes/BigML_Prediction/one_prediction/was_created_successfully.yml +297 -0
  54. data/spec/vcr_cassettes/BigML_Source/no_source/_all/must_be_empty.yml +136 -0
  55. data/spec/vcr_cassettes/BigML_Source/one_source/must_be_able_to_be_find_using_the_reference.yml +191 -0
  56. data/spec/vcr_cassettes/BigML_Source/one_source/must_be_able_to_remove_the_source.yml +195 -0
  57. data/spec/vcr_cassettes/BigML_Source/one_source/must_be_able_to_update_the_name.yml +279 -0
  58. data/spec/vcr_cassettes/BigML_Source/one_source/must_have_only_one_item.yml +192 -0
  59. data/spec/vcr_cassettes/BigML_Source/one_source/must_have_the_same_file_name.yml +192 -0
  60. data/spec/vcr_cassettes/BigML_Source/one_source/was_created_successfully.yml +105 -0
  61. metadata +224 -0
@@ -0,0 +1,305 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://bigml.io/andromeda/source?username=<USERNAME>&api_key=<API_KEY>
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ connection:
11
+ - close
12
+ response:
13
+ status:
14
+ code: 200
15
+ message: OK
16
+ headers:
17
+ content-type:
18
+ - application/json; charset=utf-8
19
+ date:
20
+ - Wed, 20 Jun 2012 04:08:07 GMT
21
+ server:
22
+ - nginx/1.0.12
23
+ content-length:
24
+ - '101'
25
+ connection:
26
+ - Close
27
+ body:
28
+ encoding: US-ASCII
29
+ string: ! '{"meta": {"limit": 20, "next": null, "offset": 0, "previous": null,
30
+ "total_count": 0}, "objects": []}'
31
+ http_version: '1.1'
32
+ recorded_at: Wed, 20 Jun 2012 04:09:38 GMT
33
+ - request:
34
+ method: get
35
+ uri: https://bigml.io/andromeda/dataset?username=<USERNAME>&api_key=<API_KEY>
36
+ body:
37
+ encoding: US-ASCII
38
+ string: ''
39
+ headers:
40
+ connection:
41
+ - close
42
+ response:
43
+ status:
44
+ code: 200
45
+ message: OK
46
+ headers:
47
+ content-type:
48
+ - application/json; charset=utf-8
49
+ date:
50
+ - Wed, 20 Jun 2012 04:05:48 GMT
51
+ server:
52
+ - nginx/1.0.12
53
+ content-length:
54
+ - '101'
55
+ connection:
56
+ - Close
57
+ body:
58
+ encoding: US-ASCII
59
+ string: ! '{"meta": {"limit": 20, "next": null, "offset": 0, "previous": null,
60
+ "total_count": 0}, "objects": []}'
61
+ http_version: '1.1'
62
+ recorded_at: Wed, 20 Jun 2012 04:09:39 GMT
63
+ - request:
64
+ method: get
65
+ uri: https://bigml.io/andromeda/model?username=<USERNAME>&api_key=<API_KEY>
66
+ body:
67
+ encoding: US-ASCII
68
+ string: ''
69
+ headers:
70
+ connection:
71
+ - close
72
+ response:
73
+ status:
74
+ code: 200
75
+ message: OK
76
+ headers:
77
+ content-type:
78
+ - application/json; charset=utf-8
79
+ date:
80
+ - Wed, 20 Jun 2012 04:08:09 GMT
81
+ server:
82
+ - nginx/1.0.12
83
+ content-length:
84
+ - '3075'
85
+ connection:
86
+ - Close
87
+ body:
88
+ encoding: US-ASCII
89
+ string: ! '{"meta": {"limit": 20, "next": null, "offset": 0, "previous": null,
90
+ "total_count": 4}, "objects": [{"category": 0, "code": 200, "columns": 5,
91
+ "created": "2012-06-20T04:09:34.532000", "credits": 0.03515625, "dataset":
92
+ "dataset/4fe14ce0035d074a1b000120", "dataset_status": false, "description":
93
+ "", "holdout": 0.0, "input_fields": ["000000", "000001", "000002", "000003"],
94
+ "locale": "en_US", "max_columns": 5, "max_rows": 150, "name": "iris'' dataset
95
+ model", "number_of_predictions": 0, "objective_fields": ["000004"], "private":
96
+ true, "range": [1, 150], "resource": "model/4fe14cfe1552687d48000109", "rows":
97
+ 150, "size": 4608, "source": "source/4fe14cdf035d074a1c000103", "source_status":
98
+ false, "status": {"code": 5, "elapsed": 152, "message": "The model has been
99
+ created", "progress": 1}, "tags": [], "updated": "2012-06-20T04:09:39.427000"},
100
+ {"category": 0, "code": 200, "columns": 5, "created": "2012-06-20T04:09:23.771000",
101
+ "credits": 0.03515625, "dataset": "dataset/4fe14cd6035d074a1e000107", "dataset_status":
102
+ false, "description": "", "holdout": 0.0, "input_fields": ["000000", "000001",
103
+ "000002", "000003"], "locale": "en_US", "max_columns": 5, "max_rows": 150,
104
+ "name": "iris'' dataset model", "number_of_predictions": 0, "objective_fields":
105
+ ["000004"], "private": true, "range": [1, 150], "resource": "model/4fe14cf31552687d42000151",
106
+ "rows": 150, "size": 4608, "source": "source/4fe14cd4035d074a2100014d", "source_status":
107
+ false, "status": {"code": 5, "elapsed": 151, "message": "The model has been
108
+ created", "progress": 1}, "tags": [], "updated": "2012-06-20T04:09:28.556000"},
109
+ {"category": 0, "code": 200, "columns": 5, "created": "2012-06-20T04:09:12.196000",
110
+ "credits": 0.03515625, "dataset": "dataset/4fe14cca035d074a1e000103", "dataset_status":
111
+ false, "description": "", "holdout": 0.0, "input_fields": ["000000", "000001",
112
+ "000002", "000003"], "locale": "en_US", "max_columns": 5, "max_rows": 150,
113
+ "name": "iris'' dataset model", "number_of_predictions": 0, "objective_fields":
114
+ ["000004"], "private": true, "range": [1, 150], "resource": "model/4fe14ce81552687d45000152",
115
+ "rows": 150, "size": 4608, "source": "source/4fe14cc8035d074a1b00011b", "source_status":
116
+ false, "status": {"code": 5, "elapsed": 206, "message": "The model has been
117
+ created", "progress": 1}, "tags": [], "updated": "2012-06-20T04:09:17.882000"},
118
+ {"category": 0, "code": 200, "columns": 5, "created": "2012-06-20T03:58:55.770000",
119
+ "credits": 0.03515625, "dataset": "dataset/4fe14a9a1552687d4200014e", "dataset_status":
120
+ false, "description": "", "holdout": 0.0, "input_fields": ["000000", "000001",
121
+ "000002", "000003"], "locale": "en_US", "max_columns": 5, "max_rows": 150,
122
+ "name": "iris'' dataset model", "number_of_predictions": 0, "objective_fields":
123
+ ["000004"], "private": true, "range": [1, 150], "resource": "model/4fe14a7f035d074a2100014a",
124
+ "rows": 150, "size": 4608, "source": "source/4fe14a991552687d48000103", "source_status":
125
+ false, "status": {"code": 5, "elapsed": 148, "message": "The model has been
126
+ created", "progress": 1}, "tags": [], "updated": "2012-06-20T04:08:56.725000"}]}'
127
+ http_version: '1.1'
128
+ recorded_at: Wed, 20 Jun 2012 04:09:40 GMT
129
+ - request:
130
+ method: delete
131
+ uri: https://bigml.io/andromeda/model/4fe14cfe1552687d48000109?username=<USERNAME>&api_key=<API_KEY>
132
+ body:
133
+ encoding: US-ASCII
134
+ string: ''
135
+ headers:
136
+ connection:
137
+ - close
138
+ response:
139
+ status:
140
+ code: 204
141
+ message: NO CONTENT
142
+ headers:
143
+ content-length:
144
+ - '0'
145
+ content-type:
146
+ - text/html; charset=utf-8
147
+ date:
148
+ - Wed, 20 Jun 2012 04:05:51 GMT
149
+ server:
150
+ - nginx/1.0.12
151
+ connection:
152
+ - Close
153
+ body:
154
+ encoding: US-ASCII
155
+ string: ''
156
+ http_version: '1.1'
157
+ recorded_at: Wed, 20 Jun 2012 04:09:41 GMT
158
+ - request:
159
+ method: delete
160
+ uri: https://bigml.io/andromeda/model/4fe14cf31552687d42000151?username=<USERNAME>&api_key=<API_KEY>
161
+ body:
162
+ encoding: US-ASCII
163
+ string: ''
164
+ headers:
165
+ connection:
166
+ - close
167
+ response:
168
+ status:
169
+ code: 204
170
+ message: NO CONTENT
171
+ headers:
172
+ content-length:
173
+ - '0'
174
+ content-type:
175
+ - text/html; charset=utf-8
176
+ date:
177
+ - Wed, 20 Jun 2012 04:08:12 GMT
178
+ server:
179
+ - nginx/1.0.12
180
+ connection:
181
+ - Close
182
+ body:
183
+ encoding: US-ASCII
184
+ string: ''
185
+ http_version: '1.1'
186
+ recorded_at: Wed, 20 Jun 2012 04:09:42 GMT
187
+ - request:
188
+ method: delete
189
+ uri: https://bigml.io/andromeda/model/4fe14ce81552687d45000152?username=<USERNAME>&api_key=<API_KEY>
190
+ body:
191
+ encoding: US-ASCII
192
+ string: ''
193
+ headers:
194
+ connection:
195
+ - close
196
+ response:
197
+ status:
198
+ code: 204
199
+ message: NO CONTENT
200
+ headers:
201
+ content-length:
202
+ - '0'
203
+ content-type:
204
+ - text/html; charset=utf-8
205
+ date:
206
+ - Wed, 20 Jun 2012 04:05:53 GMT
207
+ server:
208
+ - nginx/1.0.12
209
+ connection:
210
+ - Close
211
+ body:
212
+ encoding: US-ASCII
213
+ string: ''
214
+ http_version: '1.1'
215
+ recorded_at: Wed, 20 Jun 2012 04:09:44 GMT
216
+ - request:
217
+ method: delete
218
+ uri: https://bigml.io/andromeda/model/4fe14a7f035d074a2100014a?username=<USERNAME>&api_key=<API_KEY>
219
+ body:
220
+ encoding: US-ASCII
221
+ string: ''
222
+ headers:
223
+ connection:
224
+ - close
225
+ response:
226
+ status:
227
+ code: 204
228
+ message: NO CONTENT
229
+ headers:
230
+ content-length:
231
+ - '0'
232
+ content-type:
233
+ - text/html; charset=utf-8
234
+ date:
235
+ - Wed, 20 Jun 2012 04:08:14 GMT
236
+ server:
237
+ - nginx/1.0.12
238
+ connection:
239
+ - Close
240
+ body:
241
+ encoding: US-ASCII
242
+ string: ''
243
+ http_version: '1.1'
244
+ recorded_at: Wed, 20 Jun 2012 04:09:45 GMT
245
+ - request:
246
+ method: get
247
+ uri: https://bigml.io/andromeda/prediction?username=<USERNAME>&api_key=<API_KEY>
248
+ body:
249
+ encoding: US-ASCII
250
+ string: ''
251
+ headers:
252
+ connection:
253
+ - close
254
+ response:
255
+ status:
256
+ code: 200
257
+ message: OK
258
+ headers:
259
+ content-type:
260
+ - application/json; charset=utf-8
261
+ date:
262
+ - Wed, 20 Jun 2012 04:05:56 GMT
263
+ server:
264
+ - nginx/1.0.12
265
+ content-length:
266
+ - '101'
267
+ connection:
268
+ - Close
269
+ body:
270
+ encoding: US-ASCII
271
+ string: ! '{"meta": {"limit": 20, "next": null, "offset": 0, "previous": null,
272
+ "total_count": 0}, "objects": []}'
273
+ http_version: '1.1'
274
+ recorded_at: Wed, 20 Jun 2012 04:09:46 GMT
275
+ - request:
276
+ method: get
277
+ uri: https://bigml.io/andromeda/prediction?username=<USERNAME>&api_key=<API_KEY>
278
+ body:
279
+ encoding: US-ASCII
280
+ string: ''
281
+ headers:
282
+ connection:
283
+ - close
284
+ response:
285
+ status:
286
+ code: 200
287
+ message: OK
288
+ headers:
289
+ content-type:
290
+ - application/json; charset=utf-8
291
+ date:
292
+ - Wed, 20 Jun 2012 04:08:17 GMT
293
+ server:
294
+ - nginx/1.0.12
295
+ content-length:
296
+ - '101'
297
+ connection:
298
+ - Close
299
+ body:
300
+ encoding: US-ASCII
301
+ string: ! '{"meta": {"limit": 20, "next": null, "offset": 0, "previous": null,
302
+ "total_count": 0}, "objects": []}'
303
+ http_version: '1.1'
304
+ recorded_at: Wed, 20 Jun 2012 04:09:48 GMT
305
+ recorded_with: VCR 2.2.2