Class: SVMModel
- Inherits:
-
VectorModel
- Object
- VectorModel
- SVMModel
- Defined in:
- lib/rbbt/vector/model/svm.rb
Instance Attribute Summary
Attributes inherited from VectorModel
#balance, #bar, #directory, #eval_model, #extract_features, #factor_levels, #features, #labels, #model_file, #model_options, #names, #post_process, #train_model
Instance Method Summary collapse
-
#initialize(dir) ⇒ SVMModel
constructor
A new instance of SVMModel.
Methods inherited from VectorModel
R_eval, R_run, R_train, #__load_method, #add, #add_list, #balance_labels, #clear, #cross_validation, #eval, #eval_list, f1_metrics, #run, #save_models, #train
Constructor Details
#initialize(dir) ⇒ SVMModel
Returns a new instance of SVMModel.
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/rbbt/vector/model/svm.rb', line 3 def initialize(dir) super(dir) @extract_features ||= Proc.new{|element| element } @train_model ||="rbbt.require('e1071');\nmodel = svm(as.factor(label) ~ ., data = features);\n EOF\n \n @eval_model ||=<<-EOF\nrbbt.require('e1071');\nlabel = predict(model, features);\n EOF\nend\n" |