big_ml 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. data/README.md +2 -1
  2. data/big_ml.gemspec +1 -1
  3. data/lib/big_ml/util/client.rb +7 -2
  4. data/lib/big_ml/util/config.rb +7 -2
  5. data/lib/big_ml/version.rb +1 -1
  6. data/spec/spec_helper.rb +2 -2
  7. data/spec/units/client_spec.rb +37 -6
  8. data/spec/vcr_cassettes/BigML_Dataset/no_dataset/_all/must_be_empty.yml +16 -95
  9. data/spec/vcr_cassettes/BigML_Dataset/one_dataset/can_be_converted_in_a_model.yml +69 -67
  10. data/spec/vcr_cassettes/BigML_Dataset/one_dataset/must_be_able_to_be_deleted_using_the_destroy_method.yml +72 -71
  11. data/spec/vcr_cassettes/BigML_Dataset/one_dataset/must_be_able_to_be_find_using_the_reference.yml +104 -103
  12. data/spec/vcr_cassettes/BigML_Dataset/one_dataset/must_be_able_to_remove_the_dataset.yml +66 -65
  13. data/spec/vcr_cassettes/BigML_Dataset/one_dataset/must_be_able_to_update_the_name.yml +148 -147
  14. data/spec/vcr_cassettes/BigML_Dataset/one_dataset/must_be_able_to_update_the_name_from_the_instance.yml +147 -146
  15. data/spec/vcr_cassettes/BigML_Dataset/one_dataset/must_have_only_one_item.yml +83 -80
  16. data/spec/vcr_cassettes/BigML_Dataset/one_dataset/must_have_the_same_file_name.yml +119 -74
  17. data/spec/vcr_cassettes/BigML_Dataset/one_dataset/was_created_successfully.yml +36 -36
  18. data/spec/vcr_cassettes/BigML_Model/no_model/_all/must_be_empty.yml +89 -87
  19. data/spec/vcr_cassettes/BigML_Model/one_model/can_be_converted_in_a_prediction.yml +101 -99
  20. data/spec/vcr_cassettes/BigML_Model/one_model/must_be_able_to_be_deleted_using_the_destroy_method.yml +91 -89
  21. data/spec/vcr_cassettes/BigML_Model/one_model/must_be_able_to_be_find_using_the_reference.yml +191 -200
  22. data/spec/vcr_cassettes/BigML_Model/one_model/must_be_able_to_remove_the_model.yml +109 -231
  23. data/spec/vcr_cassettes/BigML_Model/one_model/must_be_able_to_update_the_name.yml +272 -252
  24. data/spec/vcr_cassettes/BigML_Model/one_model/must_be_able_to_update_the_name_from_the_instance.yml +126 -252
  25. data/spec/vcr_cassettes/BigML_Model/one_model/must_have_only_one_item.yml +117 -113
  26. data/spec/vcr_cassettes/BigML_Model/one_model/must_have_the_same_size.yml +158 -120
  27. data/spec/vcr_cassettes/BigML_Model/one_model/was_created_successfully.yml +101 -56
  28. data/spec/vcr_cassettes/BigML_Prediction/no_prediction/_all/must_be_empty.yml +96 -94
  29. data/spec/vcr_cassettes/BigML_Prediction/one_prediction/must_be_able_to_be_deleted_using_the_destroy_method.yml +126 -124
  30. data/spec/vcr_cassettes/BigML_Prediction/one_prediction/must_be_able_to_be_find_using_the_reference.yml +147 -145
  31. data/spec/vcr_cassettes/BigML_Prediction/one_prediction/must_be_able_to_remove_the_prediction.yml +141 -139
  32. data/spec/vcr_cassettes/BigML_Prediction/one_prediction/must_be_able_to_update_the_name.yml +159 -157
  33. data/spec/vcr_cassettes/BigML_Prediction/one_prediction/must_be_able_to_update_the_name_from_the_instance.yml +161 -159
  34. data/spec/vcr_cassettes/BigML_Prediction/one_prediction/must_have_only_one_item.yml +145 -143
  35. data/spec/vcr_cassettes/BigML_Prediction/one_prediction/must_have_the_same_name.yml +148 -146
  36. data/spec/vcr_cassettes/BigML_Prediction/one_prediction/was_created_successfully.yml +75 -74
  37. data/spec/vcr_cassettes/BigML_Source/no_source/_all/must_be_empty.yml +25 -24
  38. data/spec/vcr_cassettes/BigML_Source/one_source/can_be_converted_in_a_dataset.yml +32 -32
  39. data/spec/vcr_cassettes/BigML_Source/one_source/must_be_able_to_be_deleted_using_the_destroy_method.yml +21 -21
  40. data/spec/vcr_cassettes/BigML_Source/one_source/must_be_able_to_be_find_using_the_reference.yml +48 -47
  41. data/spec/vcr_cassettes/BigML_Source/one_source/must_be_able_to_remove_the_source.yml +43 -42
  42. data/spec/vcr_cassettes/BigML_Source/one_source/must_be_able_to_update_the_name.yml +77 -76
  43. data/spec/vcr_cassettes/BigML_Source/one_source/must_be_able_to_update_the_name_from_the_instance.yml +78 -77
  44. data/spec/vcr_cassettes/BigML_Source/one_source/must_have_only_one_item.yml +53 -51
  45. data/spec/vcr_cassettes/BigML_Source/one_source/must_have_the_same_file_name.yml +52 -50
  46. data/spec/vcr_cassettes/BigML_Source/one_source/was_created_successfully.yml +14 -14
  47. metadata +5 -5
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: get
5
- uri: https://bigml.io/andromeda/source?username=<USERNAME>&api_key=<API_KEY>
5
+ uri: https://bigml.io/dev/andromeda/source?username=<USERNAME>&api_key=<API_KEY>
6
6
  body:
7
7
  encoding: US-ASCII
8
8
  string: ''
@@ -17,36 +17,37 @@ http_interactions:
17
17
  content-type:
18
18
  - application/json; charset=utf-8
19
19
  date:
20
- - Thu, 28 Jun 2012 22:21:30 GMT
20
+ - Sat, 14 Jul 2012 15:23:53 GMT
21
21
  server:
22
22
  - nginx/1.0.12
23
23
  content-length:
24
- - '1280'
24
+ - '1293'
25
25
  connection:
26
26
  - Close
27
27
  body:
28
28
  encoding: US-ASCII
29
29
  string: ! '{"meta": {"limit": 20, "next": null, "offset": 0, "previous": null,
30
30
  "total_count": 1}, "objects": [{"category": 0, "code": 200, "content_type":
31
- "application/octet-stream", "created": "2012-06-28T22:26:27.886000", "credits":
32
- 0.0, "description": "", "fields": {"000000": {"column_number": 0, "name":
33
- "sepal length", "optype": "numeric"}, "000001": {"column_number": 1, "name":
34
- "sepal width", "optype": "numeric"}, "000002": {"column_number": 2, "name":
35
- "petal length", "optype": "numeric"}, "000003": {"column_number": 3, "name":
36
- "petal width", "optype": "numeric"}, "000004": {"column_number": 4, "name":
37
- "species", "optype": "categorical"}}, "file_name": "iris.csv", "md5": "d1175c032e1042bec7f974c91e4a65ae",
38
- "name": "iris.csv", "number_of_datasets": 1, "number_of_models": 1, "number_of_predictions":
39
- 0, "private": true, "resource": "source/4fecda1315526875f8003320", "size":
40
- 4608, "source_parser": {"header": true, "locale": "en_US", "missing_tokens":
41
- ["", "N/A", "n/a", "NULL", "null", "-", "#DIV/0", "#REF!", "#NAME?", "NIL",
42
- "nil", "NA", "na", "#VALUE!", "#NULL!", "NaN", "#N/A", "#NUM!", "?"], "quote":
43
- "\"", "separator": ","}, "status": {"code": 5, "elapsed": 68, "message": "The
44
- source has been created"}, "tags": [], "type": 0, "updated": "2012-06-28T22:25:42.538000"}]}'
31
+ "application/octet-stream", "created": "2012-07-14T15:27:41.327000", "credits":
32
+ 0.0, "description": "", "dev": true, "fields": {"000000": {"column_number":
33
+ 0, "name": "sepal length", "optype": "numeric"}, "000001": {"column_number":
34
+ 1, "name": "sepal width", "optype": "numeric"}, "000002": {"column_number":
35
+ 2, "name": "petal length", "optype": "numeric"}, "000003": {"column_number":
36
+ 3, "name": "petal width", "optype": "numeric"}, "000004": {"column_number":
37
+ 4, "name": "species", "optype": "categorical"}}, "file_name": "iris.csv",
38
+ "md5": "d1175c032e1042bec7f974c91e4a65ae", "name": "iris.csv", "number_of_datasets":
39
+ 1, "number_of_models": 0, "number_of_predictions": 0, "private": true, "resource":
40
+ "source/50018fed035d07569b00000b", "size": 4608, "source_parser": {"header":
41
+ true, "locale": "en_US", "missing_tokens": ["", "N/A", "n/a", "NULL", "null",
42
+ "-", "#DIV/0", "#REF!", "#NAME?", "NIL", "nil", "NA", "na", "#VALUE!", "#NULL!",
43
+ "NaN", "#N/A", "#NUM!", "?"], "quote": "\"", "separator": ","}, "status":
44
+ {"code": 5, "elapsed": 75, "message": "The source has been created"}, "tags":
45
+ [], "type": 0, "updated": "2012-07-14T15:27:43.169000"}]}'
45
46
  http_version: '1.1'
46
- recorded_at: Thu, 28 Jun 2012 22:26:16 GMT
47
+ recorded_at: Sat, 14 Jul 2012 15:29:56 GMT
47
48
  - request:
48
49
  method: delete
49
- uri: https://bigml.io/andromeda/source/4fecda1315526875f8003320?username=<USERNAME>&api_key=<API_KEY>
50
+ uri: https://bigml.io/dev/andromeda/source/50018fed035d07569b00000b?username=<USERNAME>&api_key=<API_KEY>
50
51
  body:
51
52
  encoding: US-ASCII
52
53
  string: ''
@@ -55,27 +56,29 @@ http_interactions:
55
56
  - close
56
57
  response:
57
58
  status:
58
- code: 204
59
- message: NO CONTENT
59
+ code: 404
60
+ message: NOT FOUND
60
61
  headers:
61
- content-length:
62
- - '0'
63
62
  content-type:
64
- - text/html; charset=utf-8
63
+ - application/json; charset=utf-8
65
64
  date:
66
- - Thu, 28 Jun 2012 22:24:05 GMT
65
+ - Sat, 14 Jul 2012 15:28:54 GMT
67
66
  server:
68
67
  - nginx/1.0.12
68
+ content-length:
69
+ - '170'
69
70
  connection:
70
71
  - Close
71
72
  body:
72
73
  encoding: US-ASCII
73
- string: ''
74
+ string: ! '{"code": 404, "status": {"code": -1201, "extra": ["Couldn''t find
75
+ an instance of ''Dataset'' which matched ''id=50018fef035d074059000049''."],
76
+ "message": "Id does not exist"}}'
74
77
  http_version: '1.1'
75
- recorded_at: Thu, 28 Jun 2012 22:26:18 GMT
78
+ recorded_at: Sat, 14 Jul 2012 15:29:57 GMT
76
79
  - request:
77
80
  method: get
78
- uri: https://bigml.io/andromeda/dataset?username=<USERNAME>&api_key=<API_KEY>
81
+ uri: https://bigml.io/dev/andromeda/dataset?username=<USERNAME>&api_key=<API_KEY>
79
82
  body:
80
83
  encoding: US-ASCII
81
84
  string: ''
@@ -90,29 +93,37 @@ http_interactions:
90
93
  content-type:
91
94
  - application/json; charset=utf-8
92
95
  date:
93
- - Thu, 28 Jun 2012 22:21:33 GMT
96
+ - Sat, 14 Jul 2012 15:23:55 GMT
94
97
  server:
95
98
  - nginx/1.0.12
96
- transfer-encoding:
97
- - chunked
99
+ content-length:
100
+ - '1334'
98
101
  connection:
99
102
  - Close
100
103
  body:
101
104
  encoding: US-ASCII
102
105
  string: ! '{"meta": {"limit": 20, "next": null, "offset": 0, "previous": null,
103
- "total_count": 1}, "objects": [{"category": 0, "code": 200, "columns": 5,
104
- "created": "2012-06-28T22:25:40.755000", "credits": 0.00439453125, "description":
105
- "", "locale": "en_US", "name": "iris'' dataset", "number_of_models": 1, "number_of_predictions":
106
- 0, "private": true, "resource": "dataset/4fecd9e4035d0741f000335b", "rows":
107
- 150, "size": 4608, "source": "source/4fecda1315526875f8003320", "source_status":
108
- false, "status": {"bytes": 4608, "code": 5, "elapsed": 290, "field_errors":
106
+ "total_count": 2}, "objects": [{"category": 0, "code": 200, "columns": 5,
107
+ "created": "2012-07-14T15:27:43.147000", "credits": 0.00439453125, "description":
108
+ "", "dev": true, "locale": "en_US", "name": "iris'' dataset", "number_of_models":
109
+ 0, "number_of_predictions": 0, "private": true, "resource": "dataset/50018fef035d074059000049",
110
+ "rows": 150, "size": 4608, "source": "source/50018fed035d07569b00000b", "source_status":
111
+ true, "status": {"bytes": 4608, "code": 5, "elapsed": 163, "field_errors":
109
112
  [], "message": "The dataset has been created", "row_format_errors": [], "serialized_rows":
110
- 150}, "tags": [], "updated": "2012-06-28T22:25:42.544000"}]}'
113
+ 150}, "tags": [], "updated": "2012-07-14T15:27:43.321000"}, {"category": 0,
114
+ "code": 200, "columns": 5, "created": "2012-07-14T15:27:30.076000", "credits":
115
+ 0.00439453125, "description": "", "dev": true, "locale": "en_US", "name":
116
+ "iris'' dataset", "number_of_models": 1, "number_of_predictions": 0, "private":
117
+ true, "resource": "dataset/50018fe21552681ee4000021", "rows": 150, "size":
118
+ 4608, "source": "source/50018fe01552681d6800003d", "source_status": false,
119
+ "status": {"bytes": 4608, "code": 5, "elapsed": 164, "field_errors": [], "message":
120
+ "The dataset has been created", "row_format_errors": [], "serialized_rows":
121
+ 150}, "tags": [], "updated": "2012-07-14T15:27:34.909000"}]}'
111
122
  http_version: '1.1'
112
- recorded_at: Thu, 28 Jun 2012 22:26:20 GMT
123
+ recorded_at: Sat, 14 Jul 2012 15:29:58 GMT
113
124
  - request:
114
125
  method: delete
115
- uri: https://bigml.io/andromeda/dataset/4fecd9e4035d0741f000335b?username=<USERNAME>&api_key=<API_KEY>
126
+ uri: https://bigml.io/dev/andromeda/dataset/50018fef035d074059000049?username=<USERNAME>&api_key=<API_KEY>
116
127
  body:
117
128
  encoding: US-ASCII
118
129
  string: ''
@@ -129,7 +140,7 @@ http_interactions:
129
140
  content-type:
130
141
  - text/html; charset=utf-8
131
142
  date:
132
- - Thu, 28 Jun 2012 22:24:09 GMT
143
+ - Sat, 14 Jul 2012 15:28:57 GMT
133
144
  server:
134
145
  - nginx/1.0.12
135
146
  connection:
@@ -138,10 +149,10 @@ http_interactions:
138
149
  encoding: US-ASCII
139
150
  string: ''
140
151
  http_version: '1.1'
141
- recorded_at: Thu, 28 Jun 2012 22:26:22 GMT
152
+ recorded_at: Sat, 14 Jul 2012 15:30:00 GMT
142
153
  - request:
143
- method: get
144
- uri: https://bigml.io/andromeda/model?username=<USERNAME>&api_key=<API_KEY>
154
+ method: delete
155
+ uri: https://bigml.io/dev/andromeda/dataset/50018fe21552681ee4000021?username=<USERNAME>&api_key=<API_KEY>
145
156
  body:
146
157
  encoding: US-ASCII
147
158
  string: ''
@@ -150,46 +161,27 @@ http_interactions:
150
161
  - close
151
162
  response:
152
163
  status:
153
- code: 200
154
- message: OK
164
+ code: 204
165
+ message: NO CONTENT
155
166
  headers:
167
+ content-length:
168
+ - '0'
156
169
  content-type:
157
- - application/json; charset=utf-8
170
+ - text/html; charset=utf-8
158
171
  date:
159
- - Thu, 28 Jun 2012 22:21:38 GMT
172
+ - Sat, 14 Jul 2012 15:23:59 GMT
160
173
  server:
161
174
  - nginx/1.0.12
162
- content-length:
163
- - '1589'
164
175
  connection:
165
176
  - Close
166
177
  body:
167
178
  encoding: US-ASCII
168
- string: ! '{"meta": {"limit": 20, "next": null, "offset": 0, "previous": null,
169
- "total_count": 2}, "objects": [{"category": 0, "code": 200, "columns": 5,
170
- "created": "2012-06-28T22:25:42.532000", "credits": 0.017578125, "dataset":
171
- "dataset/4fecd9e4035d0741f000335b", "dataset_status": false, "description":
172
- "", "holdout": 0.0, "input_fields": ["000000", "000001", "000002", "000003"],
173
- "locale": "en_US", "max_columns": 5, "max_rows": 150, "name": "iris'' dataset
174
- model", "number_of_predictions": 0, "objective_fields": ["000004"], "private":
175
- true, "range": [1, 150], "resource": "model/4fecd9e6035d0741f000335e", "rows":
176
- 150, "size": 4608, "source": "source/4fecda1315526875f8003320", "source_status":
177
- false, "status": {"code": 5, "elapsed": 133, "message": "The model has been
178
- created", "progress": 1}, "tags": [], "updated": "2012-06-28T22:25:48.864000"},
179
- {"category": 0, "code": 200, "columns": 5, "created": "2012-06-27T02:29:29.487000",
180
- "credits": 0.017578125, "dataset": "dataset/4fea700715526875f5001bff", "dataset_status":
181
- false, "description": "", "holdout": 0.0, "input_fields": ["000000", "000001",
182
- "000002", "000003"], "locale": "en_US", "max_columns": 5, "max_rows": 150,
183
- "name": "iris'' dataset model", "number_of_predictions": 1, "objective_fields":
184
- ["000004"], "private": true, "range": [1, 150], "resource": "model/4fea700915526875f3001c2b",
185
- "rows": 150, "size": 4608, "source": "source/4fea6fd9035d0741f4001bdb", "source_status":
186
- false, "status": {"code": 5, "elapsed": 153, "message": "The model has been
187
- created", "progress": 1}, "tags": [], "updated": "2012-06-27T02:28:47.911000"}]}'
179
+ string: ''
188
180
  http_version: '1.1'
189
- recorded_at: Thu, 28 Jun 2012 22:26:25 GMT
181
+ recorded_at: Sat, 14 Jul 2012 15:30:02 GMT
190
182
  - request:
191
- method: delete
192
- uri: https://bigml.io/andromeda/model/4fecd9e6035d0741f000335e?username=<USERNAME>&api_key=<API_KEY>
183
+ method: get
184
+ uri: https://bigml.io/dev/andromeda/model?username=<USERNAME>&api_key=<API_KEY>
193
185
  body:
194
186
  encoding: US-ASCII
195
187
  string: ''
@@ -198,27 +190,37 @@ http_interactions:
198
190
  - close
199
191
  response:
200
192
  status:
201
- code: 204
202
- message: NO CONTENT
193
+ code: 200
194
+ message: OK
203
195
  headers:
204
- content-length:
205
- - '0'
206
196
  content-type:
207
- - text/html; charset=utf-8
197
+ - application/json; charset=utf-8
208
198
  date:
209
- - Thu, 28 Jun 2012 22:24:13 GMT
199
+ - Sat, 14 Jul 2012 15:29:00 GMT
210
200
  server:
211
201
  - nginx/1.0.12
202
+ content-length:
203
+ - '857'
212
204
  connection:
213
205
  - Close
214
206
  body:
215
207
  encoding: US-ASCII
216
- string: ''
208
+ string: ! '{"meta": {"limit": 20, "next": null, "offset": 0, "previous": null,
209
+ "total_count": 1}, "objects": [{"category": 0, "code": 200, "columns": 5,
210
+ "created": "2012-07-14T15:26:27.577000", "credits": 0.017578125, "dataset":
211
+ "dataset/50018fe21552681ee4000021", "dataset_status": false, "description":
212
+ "", "dev": true, "holdout": 0.0, "input_fields": ["000000", "000001", "000002",
213
+ "000003"], "locale": "en_US", "max_columns": 5, "max_rows": 150, "name": "iris''
214
+ dataset model", "number_of_predictions": 0, "objective_fields": ["000004"],
215
+ "private": true, "range": [1, 150], "resource": "model/50018fa3035d07569b000008",
216
+ "rows": 150, "size": 4608, "source": "source/50018fe01552681d6800003d", "source_status":
217
+ false, "status": {"code": 5, "elapsed": 147, "message": "The model has been
218
+ created", "progress": 1}, "tags": [], "updated": "2012-07-14T15:27:34.912000"}]}'
217
219
  http_version: '1.1'
218
- recorded_at: Thu, 28 Jun 2012 22:26:26 GMT
220
+ recorded_at: Sat, 14 Jul 2012 15:30:03 GMT
219
221
  - request:
220
222
  method: delete
221
- uri: https://bigml.io/andromeda/model/4fea700915526875f3001c2b?username=<USERNAME>&api_key=<API_KEY>
223
+ uri: https://bigml.io/dev/andromeda/model/50018fa3035d07569b000008?username=<USERNAME>&api_key=<API_KEY>
222
224
  body:
223
225
  encoding: US-ASCII
224
226
  string: ''
@@ -235,7 +237,7 @@ http_interactions:
235
237
  content-type:
236
238
  - text/html; charset=utf-8
237
239
  date:
238
- - Thu, 28 Jun 2012 22:21:42 GMT
240
+ - Sat, 14 Jul 2012 15:24:02 GMT
239
241
  server:
240
242
  - nginx/1.0.12
241
243
  connection:
@@ -244,10 +246,10 @@ http_interactions:
244
246
  encoding: US-ASCII
245
247
  string: ''
246
248
  http_version: '1.1'
247
- recorded_at: Thu, 28 Jun 2012 22:26:28 GMT
249
+ recorded_at: Sat, 14 Jul 2012 15:30:05 GMT
248
250
  - request:
249
251
  method: get
250
- uri: https://bigml.io/andromeda/model?username=<USERNAME>&api_key=<API_KEY>
252
+ uri: https://bigml.io/dev/andromeda/model?username=<USERNAME>&api_key=<API_KEY>
251
253
  body:
252
254
  encoding: US-ASCII
253
255
  string: ''
@@ -262,7 +264,7 @@ http_interactions:
262
264
  content-type:
263
265
  - application/json; charset=utf-8
264
266
  date:
265
- - Thu, 28 Jun 2012 22:24:16 GMT
267
+ - Sat, 14 Jul 2012 15:29:04 GMT
266
268
  server:
267
269
  - nginx/1.0.12
268
270
  content-length:
@@ -274,5 +276,5 @@ http_interactions:
274
276
  string: ! '{"meta": {"limit": 20, "next": null, "offset": 0, "previous": null,
275
277
  "total_count": 0}, "objects": []}'
276
278
  http_version: '1.1'
277
- recorded_at: Thu, 28 Jun 2012 22:26:29 GMT
279
+ recorded_at: Sat, 14 Jul 2012 15:30:06 GMT
278
280
  recorded_with: VCR 2.2.2