Sha256: 6d61530554e2acc6ea69c75cf7615621010774e27318e65a77e809faed75d151
Contents?: true
Size: 1.1 KB
Versions: 12
Compression:
Stored size: 1.1 KB
Contents
require 'node' require 'conditional_probability_matrix' class A class << self # def will_pay # @will_pay ||= Node.new :true, :false # end # # def has_money # @has_money ||= Node.new :plenty => 0.1, :some => 0.8, :little => 0.1 # end # # def ones # Matrix.ones(will_pay.values.length, has_money.values.length) # end # # def parents # will_pay.values.col * has_money.values # # will_pay.each do |value| # # # # end # end # # def cpm # ConditionalProbabilityMatrix.new(will_pay, has_money) # end def killer_identity @killer_identity ||= Node.new(:killer_identity, :jack => 0.8, :joe => 0.1, :jeff => 0.1) end alias :k :killer_identity alias :x :killer_identity def fingerprint_information @fingerprint_information ||= Node.new(:fingerprint_information, :jack => 2/3.0, :joe => 1/6.0, :jeff => 1/6.0) end alias :f :fingerprint_information alias :y :fingerprint_information def cpm @cpm ||= ConditionalProbabilityMatrix.new(x, y) end end end
Version data entries
12 entries across 12 versions & 1 rubygems