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:53 GMT
20
+ - Sat, 14 Jul 2012 15:11:11 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:23:31.187000", "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": 0, "number_of_predictions":
39
- 0, "private": true, "resource": "source/4fecd963035d0741ed0032f2", "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": 89, "message": "The
44
- source has been created"}, "tags": [], "type": 0, "updated": "2012-06-28T22:24:21.809000"}]}'
31
+ "application/octet-stream", "created": "2012-07-14T15:17:48.534000", "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/50018d9c1552681ee4000009", "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": 91, "message": "The source has been created"}, "tags":
45
+ [], "type": 0, "updated": "2012-07-14T15:16:45.645000"}]}'
45
46
  http_version: '1.1'
46
- recorded_at: Thu, 28 Jun 2012 22:24:06 GMT
47
+ recorded_at: Sat, 14 Jul 2012 15:17:14 GMT
47
48
  - request:
48
49
  method: delete
49
- uri: https://bigml.io/andromeda/source/4fecd963035d0741ed0032f2?username=<USERNAME>&api_key=<API_KEY>
50
+ uri: https://bigml.io/dev/andromeda/source/50018d9c1552681ee4000009?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:19:24 GMT
65
+ - Sat, 14 Jul 2012 15:16:12 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=50018d5d035d07405900001a''."],
76
+ "message": "Id does not exist"}}'
74
77
  http_version: '1.1'
75
- recorded_at: Thu, 28 Jun 2012 22:24:10 GMT
78
+ recorded_at: Sat, 14 Jul 2012 15:17:15 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,29 @@ http_interactions:
90
93
  content-type:
91
94
  - application/json; charset=utf-8
92
95
  date:
93
- - Thu, 28 Jun 2012 22:21:59 GMT
96
+ - Sat, 14 Jul 2012 15:11:13 GMT
94
97
  server:
95
98
  - nginx/1.0.12
96
99
  content-length:
97
- - '705'
100
+ - '716'
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
106
  "total_count": 1}, "objects": [{"category": 0, "code": 200, "columns": 5,
104
- "created": "2012-06-28T22:24:21.804000", "credits": 0.00439453125, "description":
105
- "", "locale": "en_US", "name": "iris'' dataset", "number_of_models": 0, "number_of_predictions":
106
- 0, "private": true, "resource": "dataset/4fecd99515526875f3003330", "rows":
107
- 150, "size": 4608, "source": "source/4fecd963035d0741ed0032f2", "source_status":
108
- false, "status": {"bytes": 4608, "code": 5, "elapsed": 1306, "field_errors":
107
+ "created": "2012-07-14T15:16:45.639000", "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/50018d5d035d07405900001a",
110
+ "rows": 150, "size": 4608, "source": "source/50018d9c1552681ee4000009", "source_status":
111
+ true, "status": {"bytes": 4608, "code": 5, "elapsed": 182, "field_errors":
109
112
  [], "message": "The dataset has been created", "row_format_errors": [], "serialized_rows":
110
- 150}, "tags": [], "updated": "2012-06-28T22:23:35.631000"}]}'
113
+ 150}, "tags": [], "updated": "2012-07-14T15:16:45.758000"}]}'
111
114
  http_version: '1.1'
112
- recorded_at: Thu, 28 Jun 2012 22:24:12 GMT
115
+ recorded_at: Sat, 14 Jul 2012 15:17:16 GMT
113
116
  - request:
114
117
  method: delete
115
- uri: https://bigml.io/andromeda/dataset/4fecd99515526875f3003330?username=<USERNAME>&api_key=<API_KEY>
118
+ uri: https://bigml.io/dev/andromeda/dataset/50018d5d035d07405900001a?username=<USERNAME>&api_key=<API_KEY>
116
119
  body:
117
120
  encoding: US-ASCII
118
121
  string: ''
@@ -129,7 +132,7 @@ http_interactions:
129
132
  content-type:
130
133
  - text/html; charset=utf-8
131
134
  date:
132
- - Thu, 28 Jun 2012 22:19:29 GMT
135
+ - Sat, 14 Jul 2012 15:16:15 GMT
133
136
  server:
134
137
  - nginx/1.0.12
135
138
  connection:
@@ -138,10 +141,10 @@ http_interactions:
138
141
  encoding: US-ASCII
139
142
  string: ''
140
143
  http_version: '1.1'
141
- recorded_at: Thu, 28 Jun 2012 22:24:16 GMT
144
+ recorded_at: Sat, 14 Jul 2012 15:17:18 GMT
142
145
  - request:
143
146
  method: post
144
- uri: https://bigml.io/andromeda/source
147
+ uri: https://bigml.io/dev/andromeda/source
145
148
  body:
146
149
  encoding: US-ASCII
147
150
  string: ''
@@ -149,7 +152,7 @@ http_interactions:
149
152
  content-type:
150
153
  - multipart/form-data; boundary=-----------RubyMultipartPost
151
154
  content-length:
152
- - '5147'
155
+ - '5149'
153
156
  connection:
154
157
  - close
155
158
  response:
@@ -160,33 +163,33 @@ http_interactions:
160
163
  content-type:
161
164
  - application/json; charset=utf-8
162
165
  date:
163
- - Thu, 28 Jun 2012 22:22:06 GMT
166
+ - Sat, 14 Jul 2012 15:11:17 GMT
164
167
  location:
165
- - http://bigml.io/andromeda/source/4fecd9a215526875f50032f1
168
+ - http://bigml.io/andromeda/source/50018d64035d07405900001c
166
169
  server:
167
170
  - nginx/1.0.12
168
171
  content-length:
169
- - '567'
172
+ - '580'
170
173
  connection:
171
174
  - Close
172
175
  body:
173
176
  encoding: US-ASCII
174
177
  string: ! '{"category": 0, "code": 201, "content_type": "application/octet-stream",
175
- "created": "2012-06-28T22:24:34.290180", "credits": 0.0, "description": "",
176
- "file_name": "iris.csv", "md5": "d1175c032e1042bec7f974c91e4a65ae", "name":
177
- "iris.csv", "number_of_datasets": 0, "number_of_models": 0, "number_of_predictions":
178
- 0, "private": true, "resource": "source/4fecd9a215526875f50032f1", "size":
178
+ "created": "2012-07-14T15:16:52.914557", "credits": 0.0, "description": "",
179
+ "dev": true, "file_name": "iris.csv", "md5": "d1175c032e1042bec7f974c91e4a65ae",
180
+ "name": "iris.csv", "number_of_datasets": 0, "number_of_models": 0, "number_of_predictions":
181
+ 0, "private": true, "resource": "source/50018d64035d07405900001c", "size":
179
182
  4608, "source_parser": {}, "status": {"code": 1, "message": "The request has
180
183
  been queued and will be processed soon"}, "tags": [], "type": 0, "updated":
181
- "2012-06-28T22:24:34.290203"}'
184
+ "2012-07-14T15:16:52.914582"}'
182
185
  http_version: '1.1'
183
- recorded_at: Thu, 28 Jun 2012 22:24:19 GMT
186
+ recorded_at: Sat, 14 Jul 2012 15:17:20 GMT
184
187
  - request:
185
188
  method: post
186
- uri: https://bigml.io/andromeda/dataset?username=<USERNAME>&api_key=<API_KEY>
189
+ uri: https://bigml.io/dev/andromeda/dataset?username=<USERNAME>&api_key=<API_KEY>
187
190
  body:
188
191
  encoding: UTF-8
189
- string: ! '{"source":"source/4fecd9a215526875f50032f1"}'
192
+ string: ! '{"source":"source/50018d64035d07405900001c"}'
190
193
  headers:
191
194
  content-type:
192
195
  - application/json
@@ -200,34 +203,34 @@ http_interactions:
200
203
  content-type:
201
204
  - application/json; charset=utf-8
202
205
  date:
203
- - Thu, 28 Jun 2012 22:19:35 GMT
206
+ - Sat, 14 Jul 2012 15:16:19 GMT
204
207
  location:
205
- - http://bigml.io/andromeda/dataset/4fecd974035d0741f400329b
208
+ - http://bigml.io/andromeda/dataset/50018da71552681edf000008
206
209
  server:
207
210
  - nginx/1.0.12
208
211
  content-length:
209
- - '921'
212
+ - '934'
210
213
  connection:
211
214
  - Close
212
215
  body:
213
216
  encoding: US-ASCII
214
- string: ! '{"category": 0, "code": 201, "columns": 5, "created": "2012-06-28T22:23:48.725020",
215
- "credits": 0.00439453125, "description": "", "fields": {"000000": {"column_number":
216
- 0, "name": "sepal length", "optype": "numeric"}, "000001": {"column_number":
217
- 1, "name": "sepal width", "optype": "numeric"}, "000002": {"column_number":
218
- 2, "name": "petal length", "optype": "numeric"}, "000003": {"column_number":
219
- 3, "name": "petal width", "optype": "numeric"}, "000004": {"column_number":
220
- 4, "name": "species", "optype": "categorical"}}, "locale": "en_US", "name":
221
- "iris'' dataset", "number_of_models": 0, "number_of_predictions": 0, "private":
222
- true, "resource": "dataset/4fecd974035d0741f400329b", "rows": 0, "size": 4608,
223
- "source": "source/4fecd9a215526875f50032f1", "source_status": true, "status":
224
- {"code": 1, "message": "The dataset is being processed and will be created
225
- soon"}, "tags": [], "updated": "2012-06-28T22:23:48.725039"}'
217
+ string: ! '{"category": 0, "code": 201, "columns": 5, "created": "2012-07-14T15:17:59.150987",
218
+ "credits": 0.00439453125, "description": "", "dev": true, "fields": {"000000":
219
+ {"column_number": 0, "name": "sepal length", "optype": "numeric"}, "000001":
220
+ {"column_number": 1, "name": "sepal width", "optype": "numeric"}, "000002":
221
+ {"column_number": 2, "name": "petal length", "optype": "numeric"}, "000003":
222
+ {"column_number": 3, "name": "petal width", "optype": "numeric"}, "000004":
223
+ {"column_number": 4, "name": "species", "optype": "categorical"}}, "locale":
224
+ "en_US", "name": "iris'' dataset", "number_of_models": 0, "number_of_predictions":
225
+ 0, "private": true, "resource": "dataset/50018da71552681edf000008", "rows":
226
+ 0, "size": 4608, "source": "source/50018d64035d07405900001c", "source_status":
227
+ true, "status": {"code": 1, "message": "The dataset is being processed and
228
+ will be created soon"}, "tags": [], "updated": "2012-07-14T15:17:59.151016"}'
226
229
  http_version: '1.1'
227
- recorded_at: Thu, 28 Jun 2012 22:24:21 GMT
230
+ recorded_at: Sat, 14 Jul 2012 15:17:22 GMT
228
231
  - request:
229
232
  method: get
230
- uri: https://bigml.io/andromeda/dataset?username=<USERNAME>&api_key=<API_KEY>
233
+ uri: https://bigml.io/dev/andromeda/dataset?username=<USERNAME>&api_key=<API_KEY>
231
234
  body:
232
235
  encoding: US-ASCII
233
236
  string: ''
@@ -242,24 +245,24 @@ http_interactions:
242
245
  content-type:
243
246
  - application/json; charset=utf-8
244
247
  date:
245
- - Thu, 28 Jun 2012 22:22:09 GMT
248
+ - Sat, 14 Jul 2012 15:11:20 GMT
246
249
  server:
247
250
  - nginx/1.0.12
248
- content-length:
249
- - '703'
251
+ transfer-encoding:
252
+ - chunked
250
253
  connection:
251
254
  - Close
252
255
  body:
253
256
  encoding: US-ASCII
254
257
  string: ! '{"meta": {"limit": 20, "next": null, "offset": 0, "previous": null,
255
258
  "total_count": 1}, "objects": [{"category": 0, "code": 200, "columns": 5,
256
- "created": "2012-06-28T22:23:48.725000", "credits": 0.00439453125, "description":
257
- "", "locale": "en_US", "name": "iris'' dataset", "number_of_models": 0, "number_of_predictions":
258
- 0, "private": true, "resource": "dataset/4fecd974035d0741f400329b", "rows":
259
- 150, "size": 4608, "source": "source/4fecd9a215526875f50032f1", "source_status":
260
- true, "status": {"bytes": 4608, "code": 5, "elapsed": 130, "field_errors":
259
+ "created": "2012-07-14T15:17:59.150000", "credits": 0.00439453125, "description":
260
+ "", "dev": true, "locale": "en_US", "name": "iris'' dataset", "number_of_models":
261
+ 0, "number_of_predictions": 0, "private": true, "resource": "dataset/50018da71552681edf000008",
262
+ "rows": 150, "size": 4608, "source": "source/50018d64035d07405900001c", "source_status":
263
+ true, "status": {"bytes": 4608, "code": 5, "elapsed": 132, "field_errors":
261
264
  [], "message": "The dataset has been created", "row_format_errors": [], "serialized_rows":
262
- 150}, "tags": [], "updated": "2012-06-28T22:23:48.883000"}]}'
265
+ 150}, "tags": [], "updated": "2012-07-14T15:17:59.393000"}]}'
263
266
  http_version: '1.1'
264
- recorded_at: Thu, 28 Jun 2012 22:24:22 GMT
267
+ recorded_at: Sat, 14 Jul 2012 15:17:23 GMT
265
268
  recorded_with: VCR 2.2.2