jubatus 0.1.0 → 0.4.0

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.
@@ -1,25 +1,4 @@
1
- #
2
- # Copyright (c) 2012 Preferred Infrastructure, inc.
3
- #
4
- # Permission is hereby granted, free of charge, to any person obtaining a copy
5
- # of this software and associated documentation files (the "Software"), to deal
6
- # in the Software without restriction, including without limitation the rights
7
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
- # copies of the Software, and to permit persons to whom the Software is
9
- # furnished to do so, subject to the following conditions:
10
- #
11
- # The above copyright notice and this permission notice shall be included in
12
- # all copies or substantial portions of the Software.
13
- #
14
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
- # SOFTWARE.
21
- #
22
- # This file is auto-generated from ./jubatus/jubatus.github/src/server//graph.idl
1
+ # This file is auto-generated from jubatus-generate/src/server/graph.idl
23
2
  # *** DO NOT EDIT ***
24
3
 
25
4
  require 'rubygems'
@@ -38,38 +17,30 @@ class Hash
38
17
  end
39
18
 
40
19
  module Jubatus
20
+ module Graph
41
21
 
42
- class Property
43
- def Property.from_tuple(tuple)
44
- tuple.each_with_object({}) {|(k,v),h| h[k] = v }
45
- end
46
- def to_tuple(o)
47
- o
48
- end
49
- end
50
-
51
- class Node_info
52
- def initialize(p, in_edges, out_edges)
53
- @p = p
22
+ class Node
23
+ def initialize(property, in_edges, out_edges)
24
+ @property = property
54
25
  @in_edges = in_edges
55
26
  @out_edges = out_edges
56
27
  end
57
28
  def to_tuple
58
- [@p.to_tuple,
29
+ [@property.each_with_object({}) {|(k,v),h| h[k] = v},
59
30
  @in_edges.map {|x| x},
60
31
  @out_edges.map {|x| x}]
61
32
  end
62
33
  def to_msgpack(out = '')
63
34
  to_tuple.to_msgpack(out)
64
35
  end
65
- def Node_info.from_tuple(tuple)
66
- Node_info.new(
67
- Property.from_tuple(tuple[0]),
36
+ def Node.from_tuple(tuple)
37
+ Node.new(
38
+ tuple[0].each_with_object({}) {|(k,v),h| h[k] = v },
68
39
  tuple[1].map { |x| x },
69
40
  tuple[2].map { |x| x }
70
41
  )
71
42
  end
72
- attr_reader :p
43
+ attr_reader :property
73
44
  attr_accessor :in_edges, :out_edges
74
45
  end
75
46
 
@@ -94,58 +65,59 @@ class Preset_query
94
65
  attr_accessor :edge_query, :node_query
95
66
  end
96
67
 
97
- class Edge_info
98
- def initialize(p, src, tgt)
99
- @p = p
100
- @src = src
101
- @tgt = tgt
68
+ class Edge
69
+ def initialize(property, source, target)
70
+ @property = property
71
+ @source = source
72
+ @target = target
102
73
  end
103
74
  def to_tuple
104
- [@p.to_tuple,
105
- @src,
106
- @tgt]
75
+ [@property.each_with_object({}) {|(k,v),h| h[k] = v},
76
+ @source,
77
+ @target]
107
78
  end
108
79
  def to_msgpack(out = '')
109
80
  to_tuple.to_msgpack(out)
110
81
  end
111
- def Edge_info.from_tuple(tuple)
112
- Edge_info.new(
113
- Property.from_tuple(tuple[0]),
82
+ def Edge.from_tuple(tuple)
83
+ Edge.new(
84
+ tuple[0].each_with_object({}) {|(k,v),h| h[k] = v },
114
85
  tuple[1],
115
86
  tuple[2]
116
87
  )
117
88
  end
118
- attr_reader :p
119
- attr_accessor :src, :tgt
89
+ attr_reader :property
90
+ attr_accessor :source, :target
120
91
  end
121
92
 
122
- class Shortest_path_req
123
- def initialize(src, tgt, max_hop, q)
124
- @src = src
125
- @tgt = tgt
93
+ class Shortest_path_query
94
+ def initialize(source, target, max_hop, query)
95
+ @source = source
96
+ @target = target
126
97
  @max_hop = max_hop
127
- @q = q
98
+ @query = query
128
99
  end
129
100
  def to_tuple
130
- [@src,
131
- @tgt,
101
+ [@source,
102
+ @target,
132
103
  @max_hop,
133
- @q.to_tuple]
104
+ @query.to_tuple]
134
105
  end
135
106
  def to_msgpack(out = '')
136
107
  to_tuple.to_msgpack(out)
137
108
  end
138
- def Shortest_path_req.from_tuple(tuple)
139
- Shortest_path_req.new(
109
+ def Shortest_path_query.from_tuple(tuple)
110
+ Shortest_path_query.new(
140
111
  tuple[0],
141
112
  tuple[1],
142
113
  tuple[2],
143
114
  Preset_query.from_tuple(tuple[3])
144
115
  )
145
116
  end
146
- attr_reader :q
147
- attr_accessor :src, :tgt, :max_hop
117
+ attr_reader :query
118
+ attr_accessor :source, :target, :max_hop
148
119
  end
149
120
 
150
121
  end
122
+ end
151
123
 
@@ -1,25 +1,4 @@
1
- #
2
- # Copyright (c) 2012 Preferred Infrastructure, inc.
3
- #
4
- # Permission is hereby granted, free of charge, to any person obtaining a copy
5
- # of this software and associated documentation files (the "Software"), to deal
6
- # in the Software without restriction, including without limitation the rights
7
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
- # copies of the Software, and to permit persons to whom the Software is
9
- # furnished to do so, subject to the following conditions:
10
- #
11
- # The above copyright notice and this permission notice shall be included in
12
- # all copies or substantial portions of the Software.
13
- #
14
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
- # SOFTWARE.
21
- #
22
- # This file is auto-generated from ./jubatus/jubatus.github/src/server//recommender.idl
1
+ # This file is auto-generated from jubatus-generate/src/server/recommender.idl
23
2
  # *** DO NOT EDIT ***
24
3
 
25
4
  require 'rubygems'
@@ -27,23 +6,21 @@ require 'msgpack/rpc'
27
6
  require File.join(File.dirname(__FILE__), 'types')
28
7
 
29
8
  module Jubatus
9
+ module Recommender
30
10
  module Client
31
11
 
32
12
  class Recommender
33
13
  def initialize(host, port)
34
14
  @cli = MessagePack::RPC::Client.new(host, port)
35
15
  end
36
- def set_config(name, c)
37
- @cli.call(:set_config, name, c)
38
- end
39
16
  def get_config(name)
40
- Config_data.from_tuple(@cli.call(:get_config, name))
17
+ @cli.call(:get_config, name)
41
18
  end
42
19
  def clear_row(name, id)
43
20
  @cli.call(:clear_row, name, id)
44
21
  end
45
- def update_row(name, id, d)
46
- @cli.call(:update_row, name, id, d)
22
+ def update_row(name, id, row)
23
+ @cli.call(:update_row, name, id, row)
47
24
  end
48
25
  def clear(name)
49
26
  @cli.call(:clear, name)
@@ -51,14 +28,14 @@ class Recommender
51
28
  def complete_row_from_id(name, id)
52
29
  Datum.from_tuple(@cli.call(:complete_row_from_id, name, id))
53
30
  end
54
- def complete_row_from_data(name, d)
55
- Datum.from_tuple(@cli.call(:complete_row_from_data, name, d))
31
+ def complete_row_from_datum(name, row)
32
+ Datum.from_tuple(@cli.call(:complete_row_from_datum, name, row))
56
33
  end
57
34
  def similar_row_from_id(name, id, size)
58
35
  Similar_result.from_tuple(@cli.call(:similar_row_from_id, name, id, size))
59
36
  end
60
- def similar_row_from_data(name, data, size)
61
- Similar_result.from_tuple(@cli.call(:similar_row_from_data, name, data, size))
37
+ def similar_row_from_datum(name, row, size)
38
+ Similar_result.from_tuple(@cli.call(:similar_row_from_datum, name, row, size))
62
39
  end
63
40
  def decode_row(name, id)
64
41
  Datum.from_tuple(@cli.call(:decode_row, name, id))
@@ -66,11 +43,11 @@ class Recommender
66
43
  def get_all_rows(name)
67
44
  @cli.call(:get_all_rows, name)
68
45
  end
69
- def similarity(name, lhs, rhs)
70
- @cli.call(:similarity, name, lhs, rhs)
46
+ def calc_similarity(name, lhs, rhs)
47
+ @cli.call(:calc_similarity, name, lhs, rhs)
71
48
  end
72
- def l2norm(name, d)
73
- @cli.call(:l2norm, name, d)
49
+ def calc_l2norm(name, row)
50
+ @cli.call(:calc_l2norm, name, row)
74
51
  end
75
52
  def save(name, id)
76
53
  @cli.call(:save, name, id)
@@ -85,3 +62,4 @@ end
85
62
 
86
63
  end
87
64
  end
65
+ end
@@ -1,30 +1,10 @@
1
- #
2
- # Copyright (c) 2012 Preferred Infrastructure, inc.
3
- #
4
- # Permission is hereby granted, free of charge, to any person obtaining a copy
5
- # of this software and associated documentation files (the "Software"), to deal
6
- # in the Software without restriction, including without limitation the rights
7
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
- # copies of the Software, and to permit persons to whom the Software is
9
- # furnished to do so, subject to the following conditions:
10
- #
11
- # The above copyright notice and this permission notice shall be included in
12
- # all copies or substantial portions of the Software.
13
- #
14
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
- # SOFTWARE.
21
- #
22
- # This file is auto-generated from ./jubatus/jubatus.github/src/server//recommender.idl
1
+ # This file is auto-generated from jubatus-generate/src/server/recommender.idl
23
2
  # *** DO NOT EDIT ***
24
3
 
25
4
  require 'rubygems'
26
5
  require 'msgpack/rpc'
27
6
  module Jubatus
7
+ module Recommender
28
8
 
29
9
  class Similar_result
30
10
  def Similar_result.from_tuple(tuple)
@@ -35,27 +15,6 @@ class Similar_result
35
15
  end
36
16
  end
37
17
 
38
- class Config_data
39
- def initialize(method, converter)
40
- @method = method
41
- @converter = converter
42
- end
43
- def to_tuple
44
- [@method,
45
- @converter]
46
- end
47
- def to_msgpack(out = '')
48
- to_tuple.to_msgpack(out)
49
- end
50
- def Config_data.from_tuple(tuple)
51
- Config_data.new(
52
- tuple[0],
53
- tuple[1]
54
- )
55
- end
56
- attr_accessor :method, :converter
57
- end
58
-
59
18
  class Datum
60
19
  def initialize(string_values, num_values)
61
20
  @string_values = string_values
@@ -78,4 +37,5 @@ class Datum
78
37
  end
79
38
 
80
39
  end
40
+ end
81
41
 
@@ -1,25 +1,4 @@
1
- #
2
- # Copyright (c) 2012 Preferred Infrastructure, inc.
3
- #
4
- # Permission is hereby granted, free of charge, to any person obtaining a copy
5
- # of this software and associated documentation files (the "Software"), to deal
6
- # in the Software without restriction, including without limitation the rights
7
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
- # copies of the Software, and to permit persons to whom the Software is
9
- # furnished to do so, subject to the following conditions:
10
- #
11
- # The above copyright notice and this permission notice shall be included in
12
- # all copies or substantial portions of the Software.
13
- #
14
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
- # SOFTWARE.
21
- #
22
- # This file is auto-generated from ./jubatus/jubatus.github/src/server//regression.idl
1
+ # This file is auto-generated from jubatus-generate/src/server/regression.idl
23
2
  # *** DO NOT EDIT ***
24
3
 
25
4
  require 'rubygems'
@@ -27,17 +6,15 @@ require 'msgpack/rpc'
27
6
  require File.join(File.dirname(__FILE__), 'types')
28
7
 
29
8
  module Jubatus
9
+ module Regression
30
10
  module Client
31
11
 
32
12
  class Regression
33
13
  def initialize(host, port)
34
14
  @cli = MessagePack::RPC::Client.new(host, port)
35
15
  end
36
- def set_config(name, c)
37
- @cli.call(:set_config, name, c)
38
- end
39
16
  def get_config(name)
40
- Config_data.from_tuple(@cli.call(:get_config, name))
17
+ @cli.call(:get_config, name)
41
18
  end
42
19
  def train(name, train_data)
43
20
  @cli.call(:train, name, train_data)
@@ -45,11 +22,11 @@ class Regression
45
22
  def estimate(name, estimate_data)
46
23
  @cli.call(:estimate, name, estimate_data)
47
24
  end
48
- def save(name, arg1)
49
- @cli.call(:save, name, arg1)
25
+ def save(name, id)
26
+ @cli.call(:save, name, id)
50
27
  end
51
- def load(name, arg1)
52
- @cli.call(:load, name, arg1)
28
+ def load(name, id)
29
+ @cli.call(:load, name, id)
53
30
  end
54
31
  def get_status(name)
55
32
  @cli.call(:get_status, name)
@@ -58,3 +35,4 @@ end
58
35
 
59
36
  end
60
37
  end
38
+ end
@@ -1,60 +1,10 @@
1
- #
2
- # Copyright (c) 2012 Preferred Infrastructure, inc.
3
- #
4
- # Permission is hereby granted, free of charge, to any person obtaining a copy
5
- # of this software and associated documentation files (the "Software"), to deal
6
- # in the Software without restriction, including without limitation the rights
7
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
- # copies of the Software, and to permit persons to whom the Software is
9
- # furnished to do so, subject to the following conditions:
10
- #
11
- # The above copyright notice and this permission notice shall be included in
12
- # all copies or substantial portions of the Software.
13
- #
14
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
- # SOFTWARE.
21
- #
22
- # This file is auto-generated from ./jubatus/jubatus.github/src/server//regression.idl
1
+ # This file is auto-generated from jubatus-generate/src/server/regression.idl
23
2
  # *** DO NOT EDIT ***
24
3
 
25
4
  require 'rubygems'
26
5
  require 'msgpack/rpc'
27
6
  module Jubatus
28
-
29
- class Param_t
30
- def Param_t.from_tuple(tuple)
31
- tuple.each_with_object({}) {|(k,v),h| h[k] = v }
32
- end
33
- def to_tuple(o)
34
- o
35
- end
36
- end
37
-
38
- class Config_data
39
- def initialize(method, config)
40
- @method = method
41
- @config = config
42
- end
43
- def to_tuple
44
- [@method,
45
- @config]
46
- end
47
- def to_msgpack(out = '')
48
- to_tuple.to_msgpack(out)
49
- end
50
- def Config_data.from_tuple(tuple)
51
- Config_data.new(
52
- tuple[0],
53
- tuple[1]
54
- )
55
- end
56
- attr_accessor :method, :config
57
- end
7
+ module Regression
58
8
 
59
9
  class Datum
60
10
  def initialize(string_values, num_values)
@@ -78,4 +28,5 @@ class Datum
78
28
  end
79
29
 
80
30
  end
31
+ end
81
32