big_ml 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +19 -0
- data/.rspec +2 -0
- data/.rvmrc +1 -0
- data/.rvmrc.example +1 -0
- data/.travis.yml +4 -0
- data/CHANGELOG.md +8 -0
- data/Gemfile +4 -0
- data/LICENSE +22 -0
- data/README.md +49 -0
- data/Rakefile +6 -0
- data/TODO.md +6 -0
- data/big_ml.gemspec +23 -0
- data/lib/big_ml/authenticable.rb +10 -0
- data/lib/big_ml/base.rb +51 -0
- data/lib/big_ml/client.rb +29 -0
- data/lib/big_ml/config.rb +30 -0
- data/lib/big_ml/dataset.rb +19 -0
- data/lib/big_ml/model.rb +21 -0
- data/lib/big_ml/prediction.rb +19 -0
- data/lib/big_ml/request.rb +29 -0
- data/lib/big_ml/source.rb +18 -0
- data/lib/big_ml/version.rb +3 -0
- data/lib/big_ml.rb +13 -0
- data/spec/fixtures/iris.csv +151 -0
- data/spec/integration/dataset_spec.rb +51 -0
- data/spec/integration/model_spec.rb +53 -0
- data/spec/integration/prediction_spec.rb +55 -0
- data/spec/integration/source_spec.rb +55 -0
- data/spec/spec_helper.rb +22 -0
- data/spec/units/client_spec.rb +50 -0
- data/spec/units/source_spec.rb +20 -0
- data/spec/vcr_cassettes/BigML_Dataset/no_dataset/_all/must_be_empty.yml +136 -0
- data/spec/vcr_cassettes/BigML_Dataset/one_dataset/must_be_able_to_be_find_using_the_reference.yml +293 -0
- data/spec/vcr_cassettes/BigML_Dataset/one_dataset/must_be_able_to_remove_the_dataset.yml +318 -0
- data/spec/vcr_cassettes/BigML_Dataset/one_dataset/must_be_able_to_update_the_name.yml +360 -0
- data/spec/vcr_cassettes/BigML_Dataset/one_dataset/must_have_only_one_item.yml +265 -0
- data/spec/vcr_cassettes/BigML_Dataset/one_dataset/must_have_the_same_file_name.yml +265 -0
- data/spec/vcr_cassettes/BigML_Dataset/one_dataset/was_created_successfully.yml +149 -0
- data/spec/vcr_cassettes/BigML_Model/no_model/_all/must_be_empty.yml +166 -0
- data/spec/vcr_cassettes/BigML_Model/one_model/must_be_able_to_be_find_using_the_reference.yml +446 -0
- data/spec/vcr_cassettes/BigML_Model/one_model/must_be_able_to_remove_the_model.yml +426 -0
- data/spec/vcr_cassettes/BigML_Model/one_model/must_be_able_to_update_the_name.yml +558 -0
- data/spec/vcr_cassettes/BigML_Model/one_model/must_have_only_one_item.yml +258 -0
- data/spec/vcr_cassettes/BigML_Model/one_model/must_have_the_same_file_name.yml +375 -0
- data/spec/vcr_cassettes/BigML_Model/one_model/must_have_the_same_size.yml +375 -0
- data/spec/vcr_cassettes/BigML_Model/one_model/was_created_successfully.yml +298 -0
- data/spec/vcr_cassettes/BigML_Prediction/no_prediction/_all/must_be_empty.yml +305 -0
- data/spec/vcr_cassettes/BigML_Prediction/one_prediction/must_be_able_to_be_find_using_the_reference.yml +502 -0
- data/spec/vcr_cassettes/BigML_Prediction/one_prediction/must_be_able_to_remove_the_prediction.yml +547 -0
- data/spec/vcr_cassettes/BigML_Prediction/one_prediction/must_be_able_to_update_the_name.yml +546 -0
- data/spec/vcr_cassettes/BigML_Prediction/one_prediction/must_have_only_one_item.yml +503 -0
- data/spec/vcr_cassettes/BigML_Prediction/one_prediction/must_have_the_same_name.yml +420 -0
- data/spec/vcr_cassettes/BigML_Prediction/one_prediction/was_created_successfully.yml +297 -0
- data/spec/vcr_cassettes/BigML_Source/no_source/_all/must_be_empty.yml +136 -0
- data/spec/vcr_cassettes/BigML_Source/one_source/must_be_able_to_be_find_using_the_reference.yml +191 -0
- data/spec/vcr_cassettes/BigML_Source/one_source/must_be_able_to_remove_the_source.yml +195 -0
- data/spec/vcr_cassettes/BigML_Source/one_source/must_be_able_to_update_the_name.yml +279 -0
- data/spec/vcr_cassettes/BigML_Source/one_source/must_have_only_one_item.yml +192 -0
- data/spec/vcr_cassettes/BigML_Source/one_source/must_have_the_same_file_name.yml +192 -0
- data/spec/vcr_cassettes/BigML_Source/one_source/was_created_successfully.yml +105 -0
- metadata +224 -0
@@ -0,0 +1,55 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe BigML::Prediction, :vcr do
|
4
|
+
|
5
|
+
before(:each) do
|
6
|
+
BigML::Source.delete_all
|
7
|
+
BigML::Dataset.delete_all
|
8
|
+
BigML::Model.delete_all
|
9
|
+
BigML::Prediction.delete_all
|
10
|
+
end
|
11
|
+
|
12
|
+
describe "no prediction" do
|
13
|
+
describe ".all" do
|
14
|
+
it "must be empty" do
|
15
|
+
BigML::Prediction.all.should == []
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
describe "one prediction" do
|
21
|
+
before do
|
22
|
+
@source = BigML::Source.create("spec/fixtures/iris.csv")
|
23
|
+
@dataset = BigML::Dataset.create(@source.resource)
|
24
|
+
@model = BigML::Model.create(@dataset.resource)
|
25
|
+
@prediction = BigML::Prediction.create(@model.resource, { :input_data => { "000001" => 3 }})
|
26
|
+
end
|
27
|
+
|
28
|
+
it "was created successfully" do
|
29
|
+
@prediction.code.should == 201
|
30
|
+
end
|
31
|
+
|
32
|
+
it "must have only one item" do
|
33
|
+
BigML::Prediction.all.should have(1).predictions
|
34
|
+
end
|
35
|
+
|
36
|
+
it "must have the same name" do
|
37
|
+
BigML::Prediction.all.first.name.should == "Prediction for species"
|
38
|
+
end
|
39
|
+
|
40
|
+
it "must be able to be find using the reference" do
|
41
|
+
BigML::Prediction.find(@prediction.id) == @prediction
|
42
|
+
end
|
43
|
+
|
44
|
+
it "must be able to update the name" do
|
45
|
+
BigML::Prediction.update(@prediction.id, { :name => 'foo name' }).code.should == 202
|
46
|
+
BigML::Prediction.find(@prediction.id).name.should == 'foo name'
|
47
|
+
end
|
48
|
+
|
49
|
+
it "must be able to remove the prediction" do
|
50
|
+
BigML::Prediction.delete(@prediction.id)
|
51
|
+
BigML::Prediction.find(@prediction.id).should be_nil
|
52
|
+
BigML::Prediction.all.should have(0).predictions
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
@@ -0,0 +1,55 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe BigML::Source, :vcr do
|
4
|
+
|
5
|
+
before(:each) do
|
6
|
+
BigML::Source.all.each do |s|
|
7
|
+
BigML::Source.delete(s.id)
|
8
|
+
end
|
9
|
+
BigML::Dataset.all.each do |s|
|
10
|
+
BigML::Dataset.delete(s.id)
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
describe "no source" do
|
15
|
+
describe ".all" do
|
16
|
+
it "must be empty" do
|
17
|
+
BigML::Source.all.should == []
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
describe "one source" do
|
23
|
+
before do
|
24
|
+
@source = BigML::Source.create("spec/fixtures/iris.csv")
|
25
|
+
end
|
26
|
+
|
27
|
+
it "was created successfully" do
|
28
|
+
@source.code.should == 201
|
29
|
+
end
|
30
|
+
|
31
|
+
it "must have only one item" do
|
32
|
+
BigML::Source.all.should have(1).sources
|
33
|
+
end
|
34
|
+
|
35
|
+
it "must have the same file_name" do
|
36
|
+
BigML::Source.all.first.file_name.should == "iris.csv"
|
37
|
+
end
|
38
|
+
|
39
|
+
it "must be able to be find using the reference" do
|
40
|
+
BigML::Source.find(@source.id) == @source
|
41
|
+
end
|
42
|
+
|
43
|
+
it "must be able to update the name" do
|
44
|
+
BigML::Source.find(@source.id).name.should == 'iris.csv'
|
45
|
+
BigML::Source.update(@source.id, { :name => 'new name' }).code.should == 202
|
46
|
+
BigML::Source.find(@source.id).name.should == 'new name'
|
47
|
+
end
|
48
|
+
|
49
|
+
it "must be able to remove the source" do
|
50
|
+
BigML::Source.delete(@source.id)
|
51
|
+
BigML::Source.find(@source.id).should be_nil
|
52
|
+
BigML::Source.all.should have(0).sources
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
require 'big_ml'
|
2
|
+
require 'rspec'
|
3
|
+
require 'vcr'
|
4
|
+
|
5
|
+
BigML.configure do |c|
|
6
|
+
c.username = 'foo'
|
7
|
+
c.api_key = 'bar'
|
8
|
+
end
|
9
|
+
|
10
|
+
VCR.configure do |c|
|
11
|
+
c.cassette_library_dir = 'spec/vcr_cassettes'
|
12
|
+
c.configure_rspec_metadata!
|
13
|
+
c.hook_into :fakeweb
|
14
|
+
c.filter_sensitive_data('<USERNAME>') { BigML.username }
|
15
|
+
c.filter_sensitive_data('<API_KEY>') { BigML.api_key }
|
16
|
+
end
|
17
|
+
|
18
|
+
|
19
|
+
RSpec.configure do |c|
|
20
|
+
c.mock_with :rspec
|
21
|
+
c.treat_symbols_as_metadata_keys_with_true_values = true
|
22
|
+
end
|
@@ -0,0 +1,50 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe BigML::Client do
|
4
|
+
let(:keys) {
|
5
|
+
BigML::Config::VALID_OPTIONS_KEYS
|
6
|
+
}
|
7
|
+
|
8
|
+
context "module configuration" do
|
9
|
+
before(:each) {
|
10
|
+
BigML.configure do |config|
|
11
|
+
keys.each { |key| config.send("#{key}=", key) }
|
12
|
+
end
|
13
|
+
}
|
14
|
+
|
15
|
+
it "should inherit module configuration" do
|
16
|
+
api = BigML::Client.new
|
17
|
+
keys.each { |key| api.send(key).should == key }
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
context "class configuration" do
|
22
|
+
let(:credentials) {
|
23
|
+
{
|
24
|
+
:username => 'user',
|
25
|
+
:api_key => 'secret'
|
26
|
+
}
|
27
|
+
}
|
28
|
+
|
29
|
+
context "during initialization" do
|
30
|
+
it "should override module configuration" do
|
31
|
+
api = BigML::Client.new(credentials)
|
32
|
+
keys.each { |key| api.send(key).should == credentials[key] }
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
context "after initilization" do
|
37
|
+
before(:each) {
|
38
|
+
BigML.configure do |config|
|
39
|
+
keys.each { |key| config.send("#{key}=", key) }
|
40
|
+
end
|
41
|
+
}
|
42
|
+
|
43
|
+
it "should override module configuration" do
|
44
|
+
api = BigML::Client.new
|
45
|
+
credentials.each { |key, value| api.send("#{key}=", value) }
|
46
|
+
keys.each { |key| api.send(key).should == credentials[key] }
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe BigML::Source do
|
4
|
+
describe "#code" do
|
5
|
+
it "return code when set" do
|
6
|
+
source = BigML::Source.new('code' => 201)
|
7
|
+
source.code.should == 201
|
8
|
+
end
|
9
|
+
|
10
|
+
it "return nil when not set" do
|
11
|
+
source = BigML::Source.new('code' => nil)
|
12
|
+
source.code.should be_nil
|
13
|
+
end
|
14
|
+
|
15
|
+
it "extract source id from resource" do
|
16
|
+
source = BigML::Source.new('resource' => 'souce/4f66a0b903ce8940c5000000')
|
17
|
+
source.id.should == "4f66a0b903ce8940c5000000"
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,136 @@
|
|
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 03:52:18 GMT
|
21
|
+
server:
|
22
|
+
- nginx/1.0.12
|
23
|
+
content-length:
|
24
|
+
- '1280'
|
25
|
+
connection:
|
26
|
+
- Close
|
27
|
+
body:
|
28
|
+
encoding: US-ASCII
|
29
|
+
string: ! '{"meta": {"limit": 20, "next": null, "offset": 0, "previous": null,
|
30
|
+
"total_count": 1}, "objects": [{"category": 0, "code": 200, "content_type":
|
31
|
+
"application/octet-stream", "created": "2012-06-20T03:49:33.139000", "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": 0, "number_of_models": 0, "number_of_predictions":
|
39
|
+
0, "private": true, "resource": "source/4fe1484d035d074a1e0000f1", "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": 69, "message": "The
|
44
|
+
source has been created"}, "tags": [], "type": 0, "updated": "2012-06-20T03:49:33.160000"}]}'
|
45
|
+
http_version: '1.1'
|
46
|
+
recorded_at: Wed, 20 Jun 2012 03:56:09 GMT
|
47
|
+
- request:
|
48
|
+
method: delete
|
49
|
+
uri: https://bigml.io/andromeda/source/4fe1484d035d074a1e0000f1?username=<USERNAME>&api_key=<API_KEY>
|
50
|
+
body:
|
51
|
+
encoding: US-ASCII
|
52
|
+
string: ''
|
53
|
+
headers:
|
54
|
+
connection:
|
55
|
+
- close
|
56
|
+
response:
|
57
|
+
status:
|
58
|
+
code: 204
|
59
|
+
message: NO CONTENT
|
60
|
+
headers:
|
61
|
+
content-length:
|
62
|
+
- '0'
|
63
|
+
content-type:
|
64
|
+
- text/html; charset=utf-8
|
65
|
+
date:
|
66
|
+
- Wed, 20 Jun 2012 03:54:40 GMT
|
67
|
+
server:
|
68
|
+
- nginx/1.0.12
|
69
|
+
connection:
|
70
|
+
- Close
|
71
|
+
body:
|
72
|
+
encoding: US-ASCII
|
73
|
+
string: ''
|
74
|
+
http_version: '1.1'
|
75
|
+
recorded_at: Wed, 20 Jun 2012 03:56:11 GMT
|
76
|
+
- request:
|
77
|
+
method: get
|
78
|
+
uri: https://bigml.io/andromeda/dataset?username=<USERNAME>&api_key=<API_KEY>
|
79
|
+
body:
|
80
|
+
encoding: US-ASCII
|
81
|
+
string: ''
|
82
|
+
headers:
|
83
|
+
connection:
|
84
|
+
- close
|
85
|
+
response:
|
86
|
+
status:
|
87
|
+
code: 200
|
88
|
+
message: OK
|
89
|
+
headers:
|
90
|
+
content-type:
|
91
|
+
- application/json; charset=utf-8
|
92
|
+
date:
|
93
|
+
- Wed, 20 Jun 2012 03:52:22 GMT
|
94
|
+
server:
|
95
|
+
- nginx/1.0.12
|
96
|
+
content-length:
|
97
|
+
- '101'
|
98
|
+
connection:
|
99
|
+
- Close
|
100
|
+
body:
|
101
|
+
encoding: US-ASCII
|
102
|
+
string: ! '{"meta": {"limit": 20, "next": null, "offset": 0, "previous": null,
|
103
|
+
"total_count": 0}, "objects": []}'
|
104
|
+
http_version: '1.1'
|
105
|
+
recorded_at: Wed, 20 Jun 2012 03:56:12 GMT
|
106
|
+
- request:
|
107
|
+
method: get
|
108
|
+
uri: https://bigml.io/andromeda/dataset?username=<USERNAME>&api_key=<API_KEY>
|
109
|
+
body:
|
110
|
+
encoding: US-ASCII
|
111
|
+
string: ''
|
112
|
+
headers:
|
113
|
+
connection:
|
114
|
+
- close
|
115
|
+
response:
|
116
|
+
status:
|
117
|
+
code: 200
|
118
|
+
message: OK
|
119
|
+
headers:
|
120
|
+
content-type:
|
121
|
+
- application/json; charset=utf-8
|
122
|
+
date:
|
123
|
+
- Wed, 20 Jun 2012 03:54:42 GMT
|
124
|
+
server:
|
125
|
+
- nginx/1.0.12
|
126
|
+
content-length:
|
127
|
+
- '101'
|
128
|
+
connection:
|
129
|
+
- Close
|
130
|
+
body:
|
131
|
+
encoding: US-ASCII
|
132
|
+
string: ! '{"meta": {"limit": 20, "next": null, "offset": 0, "previous": null,
|
133
|
+
"total_count": 0}, "objects": []}'
|
134
|
+
http_version: '1.1'
|
135
|
+
recorded_at: Wed, 20 Jun 2012 03:56:13 GMT
|
136
|
+
recorded_with: VCR 2.2.2
|
data/spec/vcr_cassettes/BigML_Dataset/one_dataset/must_be_able_to_be_find_using_the_reference.yml
ADDED
@@ -0,0 +1,293 @@
|
|
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 03:52:46 GMT
|
21
|
+
server:
|
22
|
+
- nginx/1.0.12
|
23
|
+
content-length:
|
24
|
+
- '1281'
|
25
|
+
connection:
|
26
|
+
- Close
|
27
|
+
body:
|
28
|
+
encoding: US-ASCII
|
29
|
+
string: ! '{"meta": {"limit": 20, "next": null, "offset": 0, "previous": null,
|
30
|
+
"total_count": 1}, "objects": [{"category": 0, "code": 200, "content_type":
|
31
|
+
"application/octet-stream", "created": "2012-06-20T03:56:50.608000", "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/4fe14a021552687d42000136", "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": 100, "message":
|
44
|
+
"The source has been created"}, "tags": [], "type": 0, "updated": "2012-06-20T03:56:23.639000"}]}'
|
45
|
+
http_version: '1.1'
|
46
|
+
recorded_at: Wed, 20 Jun 2012 03:56:37 GMT
|
47
|
+
- request:
|
48
|
+
method: delete
|
49
|
+
uri: https://bigml.io/andromeda/source/4fe14a021552687d42000136?username=<USERNAME>&api_key=<API_KEY>
|
50
|
+
body:
|
51
|
+
encoding: US-ASCII
|
52
|
+
string: ''
|
53
|
+
headers:
|
54
|
+
connection:
|
55
|
+
- close
|
56
|
+
response:
|
57
|
+
status:
|
58
|
+
code: 204
|
59
|
+
message: NO CONTENT
|
60
|
+
headers:
|
61
|
+
content-length:
|
62
|
+
- '0'
|
63
|
+
content-type:
|
64
|
+
- text/html; charset=utf-8
|
65
|
+
date:
|
66
|
+
- Wed, 20 Jun 2012 03:55:07 GMT
|
67
|
+
server:
|
68
|
+
- nginx/1.0.12
|
69
|
+
connection:
|
70
|
+
- Close
|
71
|
+
body:
|
72
|
+
encoding: US-ASCII
|
73
|
+
string: ''
|
74
|
+
http_version: '1.1'
|
75
|
+
recorded_at: Wed, 20 Jun 2012 03:56:38 GMT
|
76
|
+
- request:
|
77
|
+
method: get
|
78
|
+
uri: https://bigml.io/andromeda/dataset?username=<USERNAME>&api_key=<API_KEY>
|
79
|
+
body:
|
80
|
+
encoding: US-ASCII
|
81
|
+
string: ''
|
82
|
+
headers:
|
83
|
+
connection:
|
84
|
+
- close
|
85
|
+
response:
|
86
|
+
status:
|
87
|
+
code: 200
|
88
|
+
message: OK
|
89
|
+
headers:
|
90
|
+
content-type:
|
91
|
+
- application/json; charset=utf-8
|
92
|
+
date:
|
93
|
+
- Wed, 20 Jun 2012 03:52:49 GMT
|
94
|
+
server:
|
95
|
+
- nginx/1.0.12
|
96
|
+
content-length:
|
97
|
+
- '703'
|
98
|
+
connection:
|
99
|
+
- Close
|
100
|
+
body:
|
101
|
+
encoding: US-ASCII
|
102
|
+
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-20T03:56:23.634000", "credits": 0.0087890625, "description":
|
105
|
+
"", "locale": "en_US", "name": "iris'' dataset", "number_of_models": 0, "number_of_predictions":
|
106
|
+
0, "private": true, "resource": "dataset/4fe149e7035d074a21000141", "rows":
|
107
|
+
150, "size": 4608, "source": "source/4fe14a021552687d42000136", "source_status":
|
108
|
+
false, "status": {"bytes": 4608, "code": 5, "elapsed": 107, "field_errors":
|
109
|
+
[], "message": "The dataset has been created", "row_format_errors": [], "serialized_rows":
|
110
|
+
150}, "tags": [], "updated": "2012-06-20T03:56:24.895000"}]}'
|
111
|
+
http_version: '1.1'
|
112
|
+
recorded_at: Wed, 20 Jun 2012 03:56:39 GMT
|
113
|
+
- request:
|
114
|
+
method: delete
|
115
|
+
uri: https://bigml.io/andromeda/dataset/4fe149e7035d074a21000141?username=<USERNAME>&api_key=<API_KEY>
|
116
|
+
body:
|
117
|
+
encoding: US-ASCII
|
118
|
+
string: ''
|
119
|
+
headers:
|
120
|
+
connection:
|
121
|
+
- close
|
122
|
+
response:
|
123
|
+
status:
|
124
|
+
code: 204
|
125
|
+
message: NO CONTENT
|
126
|
+
headers:
|
127
|
+
content-length:
|
128
|
+
- '0'
|
129
|
+
content-type:
|
130
|
+
- text/html; charset=utf-8
|
131
|
+
date:
|
132
|
+
- Wed, 20 Jun 2012 03:55:10 GMT
|
133
|
+
server:
|
134
|
+
- nginx/1.0.12
|
135
|
+
connection:
|
136
|
+
- Close
|
137
|
+
body:
|
138
|
+
encoding: US-ASCII
|
139
|
+
string: ''
|
140
|
+
http_version: '1.1'
|
141
|
+
recorded_at: Wed, 20 Jun 2012 03:56:41 GMT
|
142
|
+
- request:
|
143
|
+
method: post
|
144
|
+
uri: https://bigml.io/andromeda/source
|
145
|
+
body:
|
146
|
+
encoding: US-ASCII
|
147
|
+
string: ''
|
148
|
+
headers:
|
149
|
+
content-type:
|
150
|
+
- multipart/form-data; boundary=-----------RubyMultipartPost
|
151
|
+
content-length:
|
152
|
+
- '5147'
|
153
|
+
connection:
|
154
|
+
- close
|
155
|
+
response:
|
156
|
+
status:
|
157
|
+
code: 201
|
158
|
+
message: CREATED
|
159
|
+
headers:
|
160
|
+
content-type:
|
161
|
+
- application/json; charset=utf-8
|
162
|
+
date:
|
163
|
+
- Wed, 20 Jun 2012 03:52:52 GMT
|
164
|
+
location:
|
165
|
+
- http://bigml.io/andromeda/source/4fe14a0b1552687d4200013a
|
166
|
+
server:
|
167
|
+
- nginx/1.0.12
|
168
|
+
content-length:
|
169
|
+
- '567'
|
170
|
+
connection:
|
171
|
+
- Close
|
172
|
+
body:
|
173
|
+
encoding: US-ASCII
|
174
|
+
string: ! '{"category": 0, "code": 201, "content_type": "application/octet-stream",
|
175
|
+
"created": "2012-06-20T03:56:59.857540", "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/4fe14a0b1552687d4200013a", "size":
|
179
|
+
4608, "source_parser": {}, "status": {"code": 1, "message": "The request has
|
180
|
+
been queued and will be processed soon"}, "tags": [], "type": 0, "updated":
|
181
|
+
"2012-06-20T03:56:59.857561"}'
|
182
|
+
http_version: '1.1'
|
183
|
+
recorded_at: Wed, 20 Jun 2012 03:56:43 GMT
|
184
|
+
- request:
|
185
|
+
method: post
|
186
|
+
uri: https://bigml.io/andromeda/dataset?username=<USERNAME>&api_key=<API_KEY>
|
187
|
+
body:
|
188
|
+
encoding: UTF-8
|
189
|
+
string: ! '{"source":"source/4fe14a0b1552687d4200013a"}'
|
190
|
+
headers:
|
191
|
+
content-type:
|
192
|
+
- application/json
|
193
|
+
connection:
|
194
|
+
- close
|
195
|
+
response:
|
196
|
+
status:
|
197
|
+
code: 201
|
198
|
+
message: CREATED
|
199
|
+
headers:
|
200
|
+
content-type:
|
201
|
+
- application/json; charset=utf-8
|
202
|
+
date:
|
203
|
+
- Wed, 20 Jun 2012 03:55:14 GMT
|
204
|
+
location:
|
205
|
+
- http://bigml.io/andromeda/dataset/4fe14a0d1552687d480000fa
|
206
|
+
server:
|
207
|
+
- nginx/1.0.12
|
208
|
+
content-length:
|
209
|
+
- '920'
|
210
|
+
connection:
|
211
|
+
- Close
|
212
|
+
body:
|
213
|
+
encoding: US-ASCII
|
214
|
+
string: ! '{"category": 0, "code": 201, "columns": 5, "created": "2012-06-20T03:57:01.914340",
|
215
|
+
"credits": 0.0087890625, "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/4fe14a0d1552687d480000fa", "rows": 0, "size": 4608,
|
223
|
+
"source": "source/4fe14a0b1552687d4200013a", "source_status": true, "status":
|
224
|
+
{"code": 1, "message": "The dataset is being processed and will be created
|
225
|
+
soon"}, "tags": [], "updated": "2012-06-20T03:57:01.914358"}'
|
226
|
+
http_version: '1.1'
|
227
|
+
recorded_at: Wed, 20 Jun 2012 03:56:45 GMT
|
228
|
+
- request:
|
229
|
+
method: get
|
230
|
+
uri: https://bigml.io/andromeda/dataset/4fe14a0d1552687d480000fa?username=<USERNAME>&api_key=<API_KEY>
|
231
|
+
body:
|
232
|
+
encoding: US-ASCII
|
233
|
+
string: ''
|
234
|
+
headers:
|
235
|
+
connection:
|
236
|
+
- close
|
237
|
+
response:
|
238
|
+
status:
|
239
|
+
code: 200
|
240
|
+
message: OK
|
241
|
+
headers:
|
242
|
+
content-type:
|
243
|
+
- application/json; charset=utf-8
|
244
|
+
date:
|
245
|
+
- Wed, 20 Jun 2012 03:52:55 GMT
|
246
|
+
server:
|
247
|
+
- nginx/1.0.12
|
248
|
+
transfer-encoding:
|
249
|
+
- chunked
|
250
|
+
connection:
|
251
|
+
- Close
|
252
|
+
body:
|
253
|
+
encoding: US-ASCII
|
254
|
+
string: ! '{"category": 0, "code": 200, "columns": 5, "created": "2012-06-20T03:57:01.914000",
|
255
|
+
"credits": 0.0087890625, "description": "", "fields": {"000000": {"column_number":
|
256
|
+
0, "datatype": "double", "name": "sepal length", "optype": "numeric", "preferred":
|
257
|
+
true, "summary": {"maximum": 7.9, "median": 5.77889, "minimum": 4.3, "missing_count":
|
258
|
+
0, "population": 150, "splits": [4.51526, 4.67252, 4.81113, 4.89582, 4.96139,
|
259
|
+
5.01131, 5.05992, 5.11148, 5.18177, 5.35681, 5.44129, 5.5108, 5.58255, 5.65532,
|
260
|
+
5.71658, 5.77889, 5.85381, 5.97078, 6.05104, 6.13074, 6.23023, 6.29578, 6.35078,
|
261
|
+
6.41459, 6.49383, 6.63013, 6.70719, 6.79218, 6.92597, 7.20423, 7.64746], "sum":
|
262
|
+
876.5, "sum_squares": 5223.85}}, "000001": {"column_number": 1, "datatype":
|
263
|
+
"double", "name": "sepal width", "optype": "numeric", "preferred": true, "summary":
|
264
|
+
{"counts": [[2, 1], [2.2, 3], [2.3, 4], [2.4, 3], [2.5, 8], [2.6, 5], [2.7,
|
265
|
+
9], [2.8, 14], [2.9, 10], [3, 26], [3.1, 11], [3.2, 13], [3.3, 6], [3.4, 12],
|
266
|
+
[3.5, 6], [3.6, 4], [3.7, 3], [3.8, 6], [3.9, 2], [4, 1], [4.1, 1], [4.2,
|
267
|
+
1], [4.4, 1]], "maximum": 4.4, "median": 3.02044, "minimum": 2, "missing_count":
|
268
|
+
0, "population": 150, "sum": 458.6, "sum_squares": 1430.4}}, "000002": {"column_number":
|
269
|
+
2, "datatype": "double", "name": "petal length", "optype": "numeric", "preferred":
|
270
|
+
true, "summary": {"maximum": 6.9, "median": 4.34142, "minimum": 1, "missing_count":
|
271
|
+
0, "population": 150, "splits": [1.25138, 1.32426, 1.37171, 1.40962, 1.44567,
|
272
|
+
1.48173, 1.51859, 1.56301, 1.6255, 1.74645, 3.23033, 3.675, 3.94203, 4.0469,
|
273
|
+
4.18243, 4.34142, 4.45309, 4.51823, 4.61771, 4.72566, 4.83445, 4.93363, 5.03807,
|
274
|
+
5.1064, 5.20938, 5.43979, 5.5744, 5.6646, 5.81496, 6.02913, 6.38125], "sum":
|
275
|
+
563.7, "sum_squares": 2582.71}}, "000003": {"column_number": 3, "datatype":
|
276
|
+
"double", "name": "petal width", "optype": "numeric", "preferred": true, "summary":
|
277
|
+
{"counts": [[0.1, 5], [0.2, 29], [0.3, 7], [0.4, 7], [0.5, 1], [0.6, 1], [1,
|
278
|
+
7], [1.1, 3], [1.2, 5], [1.3, 13], [1.4, 8], [1.5, 12], [1.6, 4], [1.7, 2],
|
279
|
+
[1.8, 12], [1.9, 5], [2, 6], [2.1, 6], [2.2, 3], [2.3, 8], [2.4, 3], [2.5,
|
280
|
+
3]], "maximum": 2.5, "median": 1.32848, "minimum": 0.1, "missing_count": 0,
|
281
|
+
"population": 150, "sum": 179.9, "sum_squares": 302.33}}, "000004": {"column_number":
|
282
|
+
4, "datatype": "string", "name": "species", "optype": "categorical", "preferred":
|
283
|
+
true, "summary": {"categories": [["Iris-versicolor", 50], ["Iris-setosa",
|
284
|
+
50], ["Iris-virginica", 50]], "missing_count": 0}}}, "locale": "en_US", "name":
|
285
|
+
"iris'' dataset", "number_of_models": 0, "number_of_predictions": 0, "private":
|
286
|
+
true, "resource": "dataset/4fe14a0d1552687d480000fa", "rows": 150, "size":
|
287
|
+
4608, "source": "source/4fe14a0b1552687d4200013a", "source_status": true,
|
288
|
+
"status": {"bytes": 4608, "code": 5, "elapsed": 846, "field_errors": [], "message":
|
289
|
+
"The dataset has been created", "row_format_errors": [], "serialized_rows":
|
290
|
+
150}, "tags": [], "updated": "2012-06-20T03:57:01.995000"}'
|
291
|
+
http_version: '1.1'
|
292
|
+
recorded_at: Wed, 20 Jun 2012 03:56:46 GMT
|
293
|
+
recorded_with: VCR 2.2.2
|