23 lines
632 B
Ruby
23 lines
632 B
Ruby
|
|
module SVMKit
|
|
module Base
|
|
# Module for all classifiers in SVMKit.
|
|
module Classifier
|
|
# An abstract method for fitting a model.
|
|
def fit
|
|
raise NotImplementedError, "#{__method__} has to be implemented in #{self.class}."
|
|
end
|
|
|
|
# An abstract method for predicting labels.
|
|
def predict
|
|
raise NotImplementedError, "#{__method__} has to be implemented in #{self.class}."
|
|
end
|
|
|
|
# An abstract method for calculating classification accuracy.
|
|
def score
|
|
raise NotImplementedError, "#{__method__} has to be implemented in #{self.class}."
|
|
end
|
|
end
|
|
end
|
|
end
|