Class: SVMLight::Model
- Inherits:
-
Object
- Object
- SVMLight::Model
- Defined in:
- lib/svmredlight/model.rb
Overview
A model is the product of training a SVM, once created it can take documents as inputs and act of them (by for instance classifying them). Models can also be read from files created by svm_learn.
Constant Summary collapse
- TYPES =
[:classification]
Class Method Summary collapse
-
.new(type, documents_and_lables, learn_params, kernel_params, alphas = nil) ⇒ Object
Learns a model from a set of labeled documents.
Class Method Details
.new(type, documents_and_lables, learn_params, kernel_params, alphas = nil) ⇒ Object
Learns a model from a set of labeled documents.
14 15 16 17 18 |
# File 'lib/svmredlight/model.rb', line 14 def self.new(type, documents_and_lables, learn_params, kernel_params, alphas = nil ) raise ArgumentError, "Supporte types are (for now) #{TYPES}" unless TYPES.include? type learn_classification(documents_and_lables, learn_params, kernel_params, false, alphas) end |