tangram 0.1.1 → 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e622eeb9d9cd659b75acbf6dc167a0685a5111ab35a434c888c497de99faf742
4
- data.tar.gz: 91c21be6670a9e3d3072648dba57b570a4cc313958af8a5a16ee7588f461c9b9
3
+ metadata.gz: 1cbbca9539d05f134e2e7ba0398b50c3610b567d5db99b39001b038c06035101
4
+ data.tar.gz: 5b85cfc70d5a9ee0d3b209b951a5aa63af344f447020bfc9b970358c365e2885
5
5
  SHA512:
6
- metadata.gz: 5079553215b584e04826f4e522e5b47587711e7493c389f587ec2202acc33a72a9f769d1155e11f746bbb69320a4d2a3bee587701b33877a558ddf467d7d967c
7
- data.tar.gz: 0d86be9c1a11e988cbcd6549ae9eb55c0cde9126ab85f1f99f23f796100c158ee32401fe92e0a63b28bacee114cf3a15f2cf0af6b265bf3dbd03717ed44bd86d
6
+ metadata.gz: 633884f7217d78f2ca19d6f1a29889c6e95e610a3ed93db2cf4210239590fb19f9df2d4d46feb7f5fe4b2366ef62f6ed012cc06130653e4003f4e5440548a1e4
7
+ data.tar.gz: ee6a7a299e53433e4feccf03d4710a69dce5fab905aabf65c79c36eec6c0e04aef3e9079be33a73c945d8addae8263378cbcef8c4360921b39b0fc9d69a3c1ca
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2019 Tangram Inc
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # Tangram + Ruby
2
2
 
3
3
  - [Watch the Video](https://www.tangramhq.com)
4
- - [Follow the Getting Started guide](https://www.tangramhq.com/docs/getting-started)
4
+ - [Read the Docs](https://www.tangramhq.com/docs)
5
5
 
6
6
  The Tangram Ruby library makes it easy to make predictions with your Tangram machine learning model from Ruby.
7
7
 
@@ -27,7 +27,11 @@ output = model.predict(input)
27
27
  puts(output)
28
28
  ```
29
29
 
30
- For more information, follow the [Getting Started guide](https://www.tangramhq.com/docs/getting-started).
30
+ For more information, [read the docs](https://www.tangramhq.com/docs).
31
+
32
+ ## Platform Support
33
+
34
+ `tangram-ruby` is currently supported for Linux, macOS, and Windows on x64-64/amd64/x64 CPUs. Are you interested in another platform? Get in touch via email at help@tangramhq.com or with the chat bubble on our website at https://www.tangramhq.com.
31
35
 
32
36
  ## Examples
33
37
 
@@ -49,4 +53,4 @@ $ TANGRAM_TOKEN=<YOUR TOKEN HERE> ruby examples/monitor/main.rb
49
53
 
50
54
  Now if you refresh the production stats or production metrics tabs for the model you uploaded, you should see predictions and true values being reported.
51
55
 
52
- For more information on reporting and monitoring, follow the [Getting Started guide](https://www.tangramhq.com/docs/getting-started).
56
+ For more information on reporting and monitoring, [read the docs](https://www.tangramhq.com/docs).
Binary file
Binary file
@@ -5,11 +5,11 @@ module LibTangram
5
5
  cpu = RbConfig::CONFIG['host_cpu']
6
6
  os = RbConfig::CONFIG['host_os']
7
7
  if cpu == 'x86_64' and os =~ /linux/
8
- library_name = 'libtangram-0.1.0-linux-x86_64.so'
8
+ library_name = 'libtangram-0.1.3-linux-x86_64.so'
9
9
  elsif cpu == 'x86_64' and os =~ /darwin/
10
- library_name = 'libtangram-0.1.0-macos-x86_64.dylib'
10
+ library_name = 'libtangram-0.1.3-macos-x86_64.dylib'
11
11
  elsif cpu == 'x86_64' and os =~ /mingw/
12
- library_name = 'tangram-0.1.0-windows-x86_64.dll'
12
+ library_name = 'tangram-0.1.3-windows-x86_64.dll'
13
13
  else
14
14
  raise 'tangram-ruby does not yet support your combination of operating system and CPU architecture. Want support for your platform? Get in touch at help@tangramhq.com.'
15
15
  end
data/lib/tangram/model.rb CHANGED
@@ -67,43 +67,19 @@ module Tangram
67
67
  end
68
68
 
69
69
  def log_prediction(identifier:, options: nil, input:, output:)
70
- self.log_event({
71
- type: 'prediction',
72
- modelId: self.id,
73
- identifier: identifier,
74
- options: options,
75
- input: input,
76
- output: output,
77
- })
70
+ self.log_event(self.prediction_event(identifier, options, input, output))
78
71
  end
79
72
 
80
73
  def enqueue_log_prediction(identifier:, options: nil, input:, output:)
81
- self.log_queue.push({
82
- type: 'prediction',
83
- modelId: self.id,
84
- identifier: identifier,
85
- options: options,
86
- input: input,
87
- output: output,
88
- })
74
+ self.log_queue.push(self.prediction_event(identifier, options, input, output))
89
75
  end
90
76
 
91
77
  def log_true_value(identifier:, true_value:)
92
- self.log_event({
93
- type: 'true_value',
94
- modelId: self.id,
95
- identifier: identifier,
96
- trueValue: true_value,
97
- })
78
+ self.log_event(self.true_value_event(identifier, true_value))
98
79
  end
99
80
 
100
81
  def enqueue_log_true_value(identifier:, true_value:)
101
- self.log_queue.push({
102
- type: 'true_value',
103
- modelId: self.id,
104
- identifier: identifier,
105
- trueValue: true_value,
106
- })
82
+ self.log_queue.push(self.true_value_event(identifier, true_value))
107
83
  end
108
84
 
109
85
  def flush_log_queue()
@@ -133,5 +109,25 @@ module Tangram
133
109
  end
134
110
  end
135
111
 
112
+ def prediction_event(identifier:, options: nil, input:, output:)
113
+ return {
114
+ type: 'prediction',
115
+ modelId: self.id,
116
+ identifier: identifier,
117
+ options: options,
118
+ input: input,
119
+ output: output,
120
+ }
121
+ end
122
+
123
+ def true_value_event(identifier:, true_value:)
124
+ return {
125
+ type: 'true_value',
126
+ modelId: self.id,
127
+ identifier: identifier,
128
+ trueValue: true_value,
129
+ }
130
+ end
131
+
136
132
  end
137
133
  end
data/tangram.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "tangram"
3
- s.version = "0.1.1"
3
+ s.version = "0.1.3"
4
4
  s.summary = "Tangram for Ruby"
5
5
  s.description = "Make predictions with a Tangram model from your Ruby app. Learn more at https://www.tangramhq.com/."
6
6
  s.authors = ["Tangram"]
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tangram
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tangram
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-01-15 00:00:00.000000000 Z
11
+ date: 2020-01-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ffi
@@ -31,17 +31,18 @@ executables: []
31
31
  extensions: []
32
32
  extra_rdoc_files: []
33
33
  files:
34
+ - LICENSE
34
35
  - README.md
35
36
  - examples/monitor/heart-disease.tangram
36
37
  - examples/monitor/main.rb
37
38
  - examples/predict/heart-disease.tangram
38
39
  - examples/predict/main.rb
39
40
  - lib/tangram.rb
40
- - lib/tangram/libtangram-0.1.0-linux-x86_64.so
41
- - lib/tangram/libtangram-0.1.0-macos-x86_64.dylib
41
+ - lib/tangram/libtangram-0.1.3-linux-x86_64.so
42
+ - lib/tangram/libtangram-0.1.3-macos-x86_64.dylib
42
43
  - lib/tangram/libtangram.rb
43
44
  - lib/tangram/model.rb
44
- - lib/tangram/tangram-0.1.0-windows-x86_64.dll
45
+ - lib/tangram/tangram-0.1.3-windows-x86_64.dll
45
46
  - scripts/build
46
47
  - tangram.gemspec
47
48
  homepage: http://rubygems.org/gems/tangram