Class: Classified::Classifiers

Inherits:
Object
  • Object
show all
Defined in:
lib/classified.rb

Defined Under Namespace

Classes: InvalidClassifier

Constant Summary collapse

VALID_CLASSIFIERS =

:classifier_lsi

[:classifier_bayes, :ankusa, :hoatzin]

Class Method Summary collapse

Class Method Details

.create(options = {}) ⇒ Object

Raises:



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/classified.rb', line 16

def self.create options = {}

  options = { :classifier => :ankusa }.merge!(options)
  raise InvalidClassifier unless VALID_CLASSIFIERS.include?(options[:classifier])

  case options[:classifier]
  when :ankusa
    return Classified::Ankusa.new(options)
  when :hoatzin
    return Classified::Hoatzin.new(options)
  when :classifier_bayes
    return Classified::ClassifierBayes.new(options)
  when :classifier_lsi
    return Classified::ClassifierLSI.new(options)
  end
end