Sha256: 907a2691eb1bd5429c99ed155231e7dc5188db8ab081771c21afb927a6d4217e

Contents?: true

Size: 471 Bytes

Versions: 1

Compression:

Stored size: 471 Bytes

Contents

module OmniCat
  module Classifiers
    module BayesInternals
      class Category < ::OmniCat::Base
        attr_accessor :doc_count, :prior, :tokens, :token_count

        def initialize(category_hash = {})
          self.doc_count = category_hash[:doc_count].to_i
          self.prior = category_hash[:prior].to_f
          self.tokens = category_hash[:tokens] || {}
          self.token_count = category_hash[:token_count].to_i
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
omnicat-0.1.3 lib/omnicat/classifiers/bayes_internals/category.rb