wise 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/wise/project.rb +3 -2
- data/lib/wise/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 4a6adfee57ccafb203b820565ac0d4578207dadd
|
|
4
|
+
data.tar.gz: 6468469a76041e8223970f55ca762f197746bb50
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 62a000cf1335f1df4994225e30389cd84b3e8a890ffc76b6fb50debe9be66394ec7f8599e049015f80e3d48d1c130ce856ebb8c1652d99e8304e44838aeab850
|
|
7
|
+
data.tar.gz: 2cd3b35673aad8d722bf9c2cc1dcbf4c2a9ef09f854066310f96d697ca4a8f96858df7f945449c05b9d4436c63072b46caae3a551b0717b8cd154e18f4b9462c
|
data/lib/wise/project.rb
CHANGED
|
@@ -72,7 +72,7 @@ module Wise
|
|
|
72
72
|
# The predictions for the data as an array.
|
|
73
73
|
def predict model, f, raw = false
|
|
74
74
|
params = {}
|
|
75
|
-
|
|
75
|
+
content_type = "text/csv"
|
|
76
76
|
if (f.is_a? String) && (File.exists? File.join(Dir.pwd, f))
|
|
77
77
|
data = File.read(f)
|
|
78
78
|
elsif (f.is_a? File) && !f.closed?
|
|
@@ -81,13 +81,14 @@ module Wise
|
|
|
81
81
|
dataset = f.delete(:dataset)
|
|
82
82
|
data = f.to_json
|
|
83
83
|
params = {:dataset_id => (@client.dataset_id dataset)}
|
|
84
|
+
content_type = "application/json"
|
|
84
85
|
else
|
|
85
86
|
data = f
|
|
86
87
|
end
|
|
87
88
|
|
|
88
89
|
m_id = @client.model_id model
|
|
89
90
|
resp = @client.resource("model/#{m_id}/predict").get(:payload => data,
|
|
90
|
-
:params => params)
|
|
91
|
+
:params => params, :content_type => content_type)
|
|
91
92
|
raw ? resp : CSV.parse(resp, :converters => [:float])
|
|
92
93
|
end
|
|
93
94
|
end
|
data/lib/wise/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: wise
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Wise.io, Inc.
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2013-
|
|
11
|
+
date: 2013-09-16 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rest-client
|
|
@@ -79,7 +79,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
79
79
|
version: '0'
|
|
80
80
|
requirements: []
|
|
81
81
|
rubyforge_project:
|
|
82
|
-
rubygems_version: 2.0.
|
|
82
|
+
rubygems_version: 2.0.2
|
|
83
83
|
signing_key:
|
|
84
84
|
specification_version: 4
|
|
85
85
|
summary: Ruby client for the Wise.io platform.
|