netica 0.0.7-java → 0.0.8-java

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.
data/Gemfile CHANGED
@@ -5,3 +5,4 @@ gemspec
5
5
 
6
6
  gem 'rake'
7
7
  gem 'rspec'
8
+
data/README.md CHANGED
@@ -67,6 +67,8 @@ Then, re-read the value of the Belief node.
67
67
 
68
68
  ## Release Notes
69
69
 
70
+ * Added Batch Processing as BayesNetwork#analyze, which takes a hash of node names and their values including an "id", and a list of output nodes, and returns the resulting values of the output nodes, along with the "id".
71
+
70
72
  ### Version 0.0.7
71
73
 
72
74
  * Added Node Set identification and collection to BayesNetwork
@@ -58,19 +58,22 @@ module Netica
58
58
  node_hash
59
59
  end
60
60
 
61
- # def analyze(json)
62
- # analysis_hash = JSON.parse(json)
63
- # analysis_hash['input_nodes'].each do |nodeName, value|
64
- # node(nodeName).enterValue(value)
65
- # end
66
- #
67
- # outcome = {}
68
- # analysis_hash['output_nodes'].each do |nodeName|
69
- # outcome[nodeName] = node(nodeName).value
70
- # end
71
- # outcome
72
- # #JSON.dump(:results => outcome)
73
- # end
61
+ def analyze(input_values, output_nodes)
62
+ outcome = []
63
+ input_values.each do |value_collection|
64
+ id = value_collection.delete("id")
65
+ value_collection.each do |nodeName, value|
66
+ node(nodeName).enterValue(value)
67
+ end
68
+ result = { :id => id }
69
+ output_nodes.each do |nodeName|
70
+ result[nodeName] = node(nodeName).value
71
+ end
72
+ outcome << result
73
+ current_network.retractFindings
74
+ end
75
+ outcome
76
+ end
74
77
 
75
78
  private
76
79
 
@@ -1,3 +1,3 @@
1
1
  module Netica
2
- VERSION = "0.0.7"
2
+ VERSION = "0.0.8"
3
3
  end
@@ -18,4 +18,5 @@ Gem::Specification.new do |gem|
18
18
  gem.executables = gem.files.grep(%r{^bin/}) { |f| File.basename(f) }
19
19
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
20
20
  gem.require_paths = ["lib"]
21
+ gem.add_development_dependency 'redis'
21
22
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: netica
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  prerelease:
6
6
  platform: java
7
7
  authors:
@@ -9,8 +9,26 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-05-16 00:00:00.000000000 Z
13
- dependencies: []
12
+ date: 2013-05-30 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: redis
16
+ version_requirements: !ruby/object:Gem::Requirement
17
+ requirements:
18
+ - - ">="
19
+ - !ruby/object:Gem::Version
20
+ version: !binary |-
21
+ MA==
22
+ none: false
23
+ requirement: !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - ">="
26
+ - !ruby/object:Gem::Version
27
+ version: !binary |-
28
+ MA==
29
+ none: false
30
+ prerelease: false
31
+ type: :development
14
32
  description: Netica Bayes Network Management
15
33
  email:
16
34
  - jerry@jerryr.com