nexosis_api 1.1.1 → 1.1.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/lib/nexosis_api/column_type.rb +2 -0
- data/lib/nexosis_api/dataset_column.rb +15 -3
- data/lib/nexosis_api/session.rb +45 -46
- data/nexosisapi.gemspec +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: babec4e434789fc5e16d0aebaf206b09245d46a5
|
4
|
+
data.tar.gz: 7f7c90dfea83768cc956929d650292fe14c7f63a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 01d35de5a51e9d863e909ec0973147a0870b37d62faa1e3fe6f6b956204591dd97f9fe752a561d176a135223d9908a67aafe651397cf3637db39abaa470750a1
|
7
|
+
data.tar.gz: ab7f428b1ca8d396d79c5c449be6bba536999daac704ceedf3724c83a79e8ce3a21e867fdf1226c3e886a0fdf9c1ce1dc1365b41646fc675b6714b0611538a31
|
@@ -9,5 +9,7 @@ module NexosisApi
|
|
9
9
|
LOGICAL = :logical
|
10
10
|
# contains ISO-8601 compatible date
|
11
11
|
DATE = :date
|
12
|
+
# Indicates a number which is not countable, or is not 'ordinal scaled' but 'ratio' or 'interval' scaled - i.e. a device measurement
|
13
|
+
NUMERICMEASURE = :numericmeasure
|
12
14
|
end
|
13
15
|
end
|
@@ -3,8 +3,10 @@ module NexosisApi
|
|
3
3
|
class DatasetColumn
|
4
4
|
def initialize(column_name, value_hash)
|
5
5
|
@name = column_name
|
6
|
-
@type = NexosisApi::ColumnType.const_get(value_hash[
|
7
|
-
@role = NexosisApi::ColumnRole.const_get(value_hash[
|
6
|
+
@type = NexosisApi::ColumnType.const_get(value_hash['dataType'].upcase) unless value_hash['dataType'].nil?
|
7
|
+
@role = NexosisApi::ColumnRole.const_get(value_hash['role'].upcase) unless value_hash['role'].nil?
|
8
|
+
@imputation = value_hash['imputation'] unless value_hash['imputation'].nil?
|
9
|
+
@aggregation = value_hash['aggregation'] unless value_hash['aggregation'].nil?
|
8
10
|
end
|
9
11
|
# The column header, label, or name
|
10
12
|
# @return [String]
|
@@ -21,9 +23,19 @@ module NexosisApi
|
|
21
23
|
# @return [NexosisApi::ColumnRole]
|
22
24
|
attr_accessor :role
|
23
25
|
|
26
|
+
# The strategy used to imput missing values
|
27
|
+
# @note Either Zeroes, Mean, Median, or Mode
|
28
|
+
# @return [String]
|
29
|
+
attr_accessor :imputation
|
30
|
+
|
31
|
+
# The strategy used to aggregate data if requested prediction period is greater than observation period
|
32
|
+
# @note Either Sum, Mean, Median, or Mode
|
33
|
+
# @return [String]
|
34
|
+
attr_accessor :aggregation
|
35
|
+
|
24
36
|
# utility method to format a column description in the way it is expected on input
|
25
37
|
def to_hash
|
26
|
-
{ self.name => {
|
38
|
+
{ self.name => { 'dataType' => self.type.to_s, 'role' => self.role.to_s }}
|
27
39
|
end
|
28
40
|
|
29
41
|
def self.to_json(column_array)
|
data/lib/nexosis_api/session.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
module NexosisApi
|
2
|
-
|
3
|
-
|
2
|
+
# Class for parsing the results of a session based request
|
3
|
+
class Session
|
4
4
|
def initialize(sessionHash)
|
5
5
|
sessionHash.each do |k,v|
|
6
6
|
if(k == "links")
|
@@ -22,60 +22,59 @@ module NexosisApi
|
|
22
22
|
instance_variable_set("@#{k}", v) unless v.nil?
|
23
23
|
end
|
24
24
|
end
|
25
|
-
|
25
|
+
end
|
26
26
|
|
27
|
-
|
28
|
-
|
29
|
-
|
27
|
+
# identifier for this sesssion
|
28
|
+
# @return [String]
|
29
|
+
attr_accessor :sessionId
|
30
30
|
|
31
|
-
|
32
|
-
|
33
|
-
|
31
|
+
# What type of analysis was run during this session
|
32
|
+
# @return [String]
|
33
|
+
attr_accessor :type
|
34
34
|
|
35
|
-
|
36
|
-
|
37
|
-
|
35
|
+
# Is this session requested, estimated, started, or completed
|
36
|
+
# @return [String]
|
37
|
+
attr_accessor :status
|
38
38
|
|
39
|
-
|
40
|
-
|
41
|
-
|
39
|
+
# Date and status of each status this session has entered
|
40
|
+
# @return [Hash]
|
41
|
+
attr_accessor :statusHistory
|
42
42
|
|
43
|
-
|
44
|
-
|
45
|
-
|
43
|
+
# reserved for future extensions
|
44
|
+
# @return [Hash]
|
45
|
+
attr_accessor :extraParameters
|
46
|
+
|
47
|
+
# the dataset used in this session
|
48
|
+
# @return [String]
|
49
|
+
attr_accessor :dataSetName
|
46
50
|
|
47
|
-
|
48
|
-
|
49
|
-
|
51
|
+
# The column in the dataset for which this session ran predictions
|
52
|
+
# @return [String]
|
53
|
+
attr_accessor :targetColumn
|
50
54
|
|
51
|
-
|
52
|
-
|
53
|
-
|
55
|
+
# The start date of analysis in this session
|
56
|
+
# @return [DateTime]
|
57
|
+
attr_accessor :startDate
|
54
58
|
|
55
|
-
|
56
|
-
|
57
|
-
|
59
|
+
# The end date of analysis in this session
|
60
|
+
# @return [DateTime]
|
61
|
+
attr_accessor :endDate
|
58
62
|
|
59
|
-
|
60
|
-
|
61
|
-
|
63
|
+
# associated hypermedia
|
64
|
+
# @return [Array of NexosisApi::Link]
|
65
|
+
attr_accessor :links
|
62
66
|
|
63
|
-
|
64
|
-
|
65
|
-
|
67
|
+
# Is this session an estimate only session
|
68
|
+
# @return [Boolean]
|
69
|
+
attr_accessor :is_estimate
|
66
70
|
|
67
|
-
|
68
|
-
|
69
|
-
|
71
|
+
# The column descriptors for the data in this session
|
72
|
+
# will reflect either the metadata sent in, defaults form dataset, or inferred values
|
73
|
+
# @return[Array of NexosisApi::DatasetColumn]
|
74
|
+
attr_accessor :column_metadata
|
70
75
|
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
# The requested result interval. Default is DAY if none was requested during session creation.
|
77
|
-
# @return [NexosisApi::TimeInterval]
|
78
|
-
attr_accessor :result_interval
|
79
|
-
end
|
76
|
+
# The requested result interval. Default is DAY if none was requested during session creation.
|
77
|
+
# @return [NexosisApi::TimeInterval]
|
78
|
+
attr_accessor :result_interval
|
79
|
+
end
|
80
80
|
end
|
81
|
-
|
data/nexosisapi.gemspec
CHANGED
@@ -16,6 +16,6 @@ Gem::Specification.new do |spec|
|
|
16
16
|
spec.require_paths = ['lib']
|
17
17
|
spec.required_ruby_version = '>= 2.0.0'
|
18
18
|
spec.summary = "Ruby client for working with the Nexosis API"
|
19
|
-
spec.version = '1.1.
|
19
|
+
spec.version = '1.1.2'
|
20
20
|
spec.metadata["yard.run"] = "yri"
|
21
21
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nexosis_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nexosis,Inc
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-08-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -90,7 +90,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
90
90
|
version: '0'
|
91
91
|
requirements: []
|
92
92
|
rubyforge_project:
|
93
|
-
rubygems_version: 2.
|
93
|
+
rubygems_version: 2.5.2
|
94
94
|
signing_key:
|
95
95
|
specification_version: 4
|
96
96
|
summary: Ruby client for working with the Nexosis API
|