Class | Ai4r::Classifiers::ZeroR |
In: |
lib/ai4r/classifiers/zero_r.rb
|
Parent: | Classifier |
The idea behind the ZeroR classifier is to identify the the most common class value in the training set. It always returns that value when evaluating an instance. It is frequently used as a baseline for evaluating other machine learning algorithms.
class_value | [R] | |
data_set | [R] |
Build a new ZeroR classifier. You must provide a DataSet instance as parameter. The last attribute of each item is considered as the item class.
You can evaluate new data, predicting its class. e.g.
classifier.eval(['New York', '<30', 'F']) # => 'Y'