1
我正在嘗試在我正在使用的紅寶石項目中使用Ankusa(https://github.com/livingsocial/ankusa)gem。即使使用寶石,Ruby'未初始化常量'錯誤
我運行下面的代碼安裝了ankusa寶石,但我仍然得到一個錯誤: 未初始化的常量Ankusa :: MemoryStorage(NameError)
require 'rubygems'
require 'ankusa'
require 'ankusa/hbase_storage'
storage = Ankusa::MemoryStorage.new
c = Ankusa::NaiveBayesClassifier.new storage
c.train :spam, "This is some spammy text"
c.train :good, "This is not the bad stuff"
puts c.classify "This is some spammy text"
puts c.classifications "This is some spammy text"
puts c.log_likelihoods "This is some spammy text"
puts c.classnames
storage.close
任何幫助將不勝感激。
感謝的作品。我需要'ankusa'和'ankusa/memory_storage' – AFraser