wise 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2a469f870f0bfb99281a39c1e9fe70ee6fa934ef
4
- data.tar.gz: 3c78f866622f4e94b646aaf8b57f7c3ac234da56
3
+ metadata.gz: 4a6adfee57ccafb203b820565ac0d4578207dadd
4
+ data.tar.gz: 6468469a76041e8223970f55ca762f197746bb50
5
5
  SHA512:
6
- metadata.gz: eb3baee4b3c30a3fc0ea2cc1410e143af9013b6cfdf674d880d1162fc6c0ba86e10a003b1d2c4c2a3702ee1f97c35f1fb471a9ab79f7d22e103dff851cb247b0
7
- data.tar.gz: 05bb8080fb112808c45d60a3be4cea813521c47bbf51ae10ef82156b27ee68b83f0a73a5ff1e6c3ca3eda74528291dfae5bf23224f7196343832601e535645f9
6
+ metadata.gz: 62a000cf1335f1df4994225e30389cd84b3e8a890ffc76b6fb50debe9be66394ec7f8599e049015f80e3d48d1c130ce856ebb8c1652d99e8304e44838aeab850
7
+ data.tar.gz: 2cd3b35673aad8d722bf9c2cc1dcbf4c2a9ef09f854066310f96d697ca4a8f96858df7f945449c05b9d4436c63072b46caae3a551b0717b8cd154e18f4b9462c
@@ -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
@@ -25,5 +25,5 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25
25
  =end
26
26
 
27
27
  module Wise
28
- VERSION = "0.1.2" # :nodoc:
28
+ VERSION = "0.1.3" # :nodoc:
29
29
  end
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.2
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-05-03 00:00:00.000000000 Z
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.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.