yhat 0.0.1 → 0.0.2
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/Gemfile +1 -0
- data/lib/yhat.rb +3 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dd2847f0420ea6318ec9fc960bca45dfa437c1f0
|
4
|
+
data.tar.gz: 0dbf843daadb93fdce811851656f36a81734f199
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b5b549913aaaaa784851a6638fc69cc94d5618eb3596ef32415e0caf8e0447856b4e8771717230243d62cda5a417df756ab3fec43dc0daf6ad8ab8be541d0c30
|
7
|
+
data.tar.gz: 225cceee507057ec30e3c30062932a42e559f00570bf116000a587057f347e217cad093e8837b4f79e3cf42423fb8af250284b10d8dea928e7a18c4e2246a779
|
data/Gemfile
CHANGED
data/lib/yhat.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
require 'rubygems'
|
2
2
|
require 'json'
|
3
|
-
|
3
|
+
require 'net/http'
|
4
|
+
require 'uri'
|
4
5
|
|
5
6
|
class Yhat
|
6
7
|
# Class that can be used to access the Yhat API
|
@@ -27,7 +28,7 @@ class Yhat
|
|
27
28
|
# @param data [Hash]
|
28
29
|
# @return [Hash]
|
29
30
|
def predict(modelname, data)
|
30
|
-
uri = URI
|
31
|
+
uri = URI::parse(@base_uri)
|
31
32
|
http = Net::HTTP.new(uri.host, uri.port)
|
32
33
|
request = Net::HTTP::Post.new("/models/" + modelname + "/")
|
33
34
|
request.add_field('Content-Type', 'application/json')
|