Class: OpenCV::Cv::Ml::SVMSGD
- Inherits:
-
Object
- Object
- OpenCV::Cv::Ml::SVMSGD
- Extended by:
- FFI::DataConverter
- Defined in:
- lib/ropencv/ropencv_types.rb
Constants collapse
- SGD =
0
- ASGD =
1
- SOFT_MARGIN =
0
- HARD_MARGIN =
1
Class Method Summary collapse
- .create ⇒ Cv::Ptr::Cv_Ml_SVMSGD
- .load(filepath, node_name = Std::String.new()) ⇒ Cv::Ptr::Cv_Ml_SVMSGD
- .new(*args) ⇒ Object
-
.null ⇒ Object
returns a null pointer to the object.
Instance Method Summary collapse
- #calc_error(data, test, resp) ⇒ Float (also: #calcError)
- #cast_to_algorithm(parse_ownership) ⇒ Cv::Algorithm (also: #castToAlgorithm)
- #cast_to_stat_model(parse_ownership) ⇒ Cv::Ml::StatModel (also: #castToStatModel)
- #clear ⇒ Void
- #empty ⇒ Bool
- #get_default_name ⇒ Std::String (also: #getDefaultName)
- #get_initial_step_size ⇒ Float (also: #getInitialStepSize)
- #get_margin_regularization ⇒ Float (also: #getMarginRegularization)
- #get_margin_type ⇒ Fixnum (also: #getMarginType)
- #get_shift ⇒ Float (also: #getShift)
- #get_step_decreasing_power ⇒ Float (also: #getStepDecreasingPower)
- #get_svmsgd_type ⇒ Fixnum (also: #getSvmsgdType)
- #get_term_criteria ⇒ Cv::TermCriteria (also: #getTermCriteria)
- #get_var_count ⇒ Fixnum (also: #getVarCount)
-
#get_weights ⇒ Cv::Mat
(also: #getWeights)
methods.
- #is_classifier ⇒ Bool (also: #isClassifier)
- #is_trained ⇒ Bool (also: #isTrained)
- #predict(samples, results = Cv::Mat.new(), flags = 0) ⇒ Float
- #read(fn) ⇒ Void
- #save(filename) ⇒ Void
- #set_initial_step_size(initial_step_size) ⇒ Void (also: #setInitialStepSize)
- #set_margin_regularization(margin_regularization) ⇒ Void (also: #setMarginRegularization)
- #set_margin_type(margin_type) ⇒ Void (also: #setMarginType)
- #set_optimal_parameters(svmsgd_type = SVMSGD::ASGD, margin_type = SVMSGD::SOFT_MARGIN) ⇒ Void (also: #setOptimalParameters)
- #set_step_decreasing_power(step_decreasing_power) ⇒ Void (also: #setStepDecreasingPower)
- #set_svmsgd_type(svmsgd_type) ⇒ Void (also: #setSvmsgdType)
- #set_term_criteria(val) ⇒ Void (also: #setTermCriteria)
-
#to_s ⇒ Object
converts SVMSGD into a string by crawling through all its attributes.
- #train(*args) ⇒ Object
- #write(fs, name = Std::String.new()) ⇒ Void
Class Method Details
.create ⇒ Cv::Ptr::Cv_Ml_SVMSGD
wrapper for static method const cv::Ptrcv::ml::SVMSGD cv::ml::SVMSGD::create()
52108 52109 52110 |
# File 'lib/ropencv/ropencv_types.rb', line 52108 def self.create() Rbind::cv_ml_svmsgd_create() end |
.load(filepath, node_name = Std::String.new()) ⇒ Cv::Ptr::Cv_Ml_SVMSGD
wrapper for static method const cv::Ptrcv::ml::SVMSGD cv::ml::SVMSGD::load(const std::string filepath, const std::string nodeName = String())
52116 52117 52118 |
# File 'lib/ropencv/ropencv_types.rb', line 52116 def self.load(filepath, node_name = Std::String.new()) Rbind::cv_ml_svmsgd_load(filepath, node_name) end |
.new(*args) ⇒ Object
51999 52000 52001 52002 52003 52004 52005 52006 |
# File 'lib/ropencv/ropencv_types.rb', line 51999 def self.new(*args) if args.first.is_a?(FFI::Pointer) || args.first.is_a?(SVMSGDStruct) raise ArgumentError, "too many arguments for creating #{self.name} from Pointer" unless args.size == 1 return super(args.first) end raise ArgumentError, "no constructor for #{self}(#{args.inspect})" end |
.null ⇒ Object
returns a null pointer to the object
51995 51996 51997 |
# File 'lib/ropencv/ropencv_types.rb', line 51995 def self.null new(SVMSGDStruct.new) end |
Instance Method Details
#calc_error(data, test, resp) ⇒ Float Also known as: calcError
method wrapper for float cv::ml::SVMSGD::calcError(const cv::Ptrcv::ml::TrainData data, bool test, cv::Mat& resp)
52331 52332 52333 52334 |
# File 'lib/ropencv/ropencv_types.rb', line 52331 def calc_error(data, test, resp) __validate_pointer__ Rbind::cv_ml_svmsgd_calc_error( self, data, test, resp) end |
#cast_to_algorithm(parse_ownership) ⇒ Cv::Algorithm Also known as: castToAlgorithm
method wrapper for cv::Algorithm* cv::ml::SVMSGD::castToAlgorithm(bool parse_ownership)
52350 52351 52352 52353 52354 52355 52356 52357 52358 |
# File 'lib/ropencv/ropencv_types.rb', line 52350 def cast_to_algorithm(parse_ownership) __validate_pointer__ result = Rbind::cv_ml_svmsgd_cast_to_algorithm( self, parse_ownership) if result.respond_to?(:__owner__?) && !result.__owner__? # store owner insight the pointer to not get garbage collected result.instance_variable_get(:@__obj_ptr__).instance_variable_set(:@__owner__,self) end result end |
#cast_to_stat_model(parse_ownership) ⇒ Cv::Ml::StatModel Also known as: castToStatModel
method wrapper for cv::ml::StatModel* cv::ml::SVMSGD::castToStatModel(bool parse_ownership)
52240 52241 52242 52243 52244 52245 52246 52247 52248 |
# File 'lib/ropencv/ropencv_types.rb', line 52240 def cast_to_stat_model(parse_ownership) __validate_pointer__ result = Rbind::cv_ml_svmsgd_cast_to_stat_model( self, parse_ownership) if result.respond_to?(:__owner__?) && !result.__owner__? # store owner insight the pointer to not get garbage collected result.instance_variable_get(:@__obj_ptr__).instance_variable_set(:@__owner__,self) end result end |
#clear ⇒ Void
method wrapper for void cv::ml::SVMSGD::clear()
52363 52364 52365 52366 |
# File 'lib/ropencv/ropencv_types.rb', line 52363 def clear() __validate_pointer__ Rbind::cv_ml_svmsgd_clear( self) end |
#empty ⇒ Bool
method wrapper for bool cv::ml::SVMSGD::empty()
52261 52262 52263 52264 |
# File 'lib/ropencv/ropencv_types.rb', line 52261 def empty() __validate_pointer__ Rbind::cv_ml_svmsgd_empty( self) end |
#get_default_name ⇒ Std::String Also known as: getDefaultName
method wrapper for const std::string cv::ml::SVMSGD::getDefaultName()
52395 52396 52397 52398 52399 52400 52401 52402 52403 |
# File 'lib/ropencv/ropencv_types.rb', line 52395 def get_default_name() __validate_pointer__ result = Rbind::cv_ml_svmsgd_get_default_name( self) if result.respond_to?(:__owner__?) && !result.__owner__? # store owner insight the pointer to not get garbage collected result.instance_variable_get(:@__obj_ptr__).instance_variable_set(:@__owner__,self) end result end |
#get_initial_step_size ⇒ Float Also known as: getInitialStepSize
method wrapper for float cv::ml::SVMSGD::getInitialStepSize()
52183 52184 52185 52186 |
# File 'lib/ropencv/ropencv_types.rb', line 52183 def get_initial_step_size() __validate_pointer__ Rbind::cv_ml_svmsgd_get_initial_step_size( self) end |
#get_margin_regularization ⇒ Float Also known as: getMarginRegularization
method wrapper for float cv::ml::SVMSGD::getMarginRegularization()
52166 52167 52168 52169 |
# File 'lib/ropencv/ropencv_types.rb', line 52166 def get_margin_regularization() __validate_pointer__ Rbind::cv_ml_svmsgd_get_margin_regularization( self) end |
#get_margin_type ⇒ Fixnum Also known as: getMarginType
method wrapper for int cv::ml::SVMSGD::getMarginType()
52149 52150 52151 52152 |
# File 'lib/ropencv/ropencv_types.rb', line 52149 def get_margin_type() __validate_pointer__ Rbind::cv_ml_svmsgd_get_margin_type( self) end |
#get_shift ⇒ Float Also known as: getShift
method wrapper for float cv::ml::SVMSGD::getShift()
52100 52101 52102 52103 |
# File 'lib/ropencv/ropencv_types.rb', line 52100 def get_shift() __validate_pointer__ Rbind::cv_ml_svmsgd_get_shift( self) end |
#get_step_decreasing_power ⇒ Float Also known as: getStepDecreasingPower
method wrapper for float cv::ml::SVMSGD::getStepDecreasingPower()
52200 52201 52202 52203 |
# File 'lib/ropencv/ropencv_types.rb', line 52200 def get_step_decreasing_power() __validate_pointer__ Rbind::cv_ml_svmsgd_get_step_decreasing_power( self) end |
#get_svmsgd_type ⇒ Fixnum Also known as: getSvmsgdType
method wrapper for int cv::ml::SVMSGD::getSvmsgdType()
52132 52133 52134 52135 |
# File 'lib/ropencv/ropencv_types.rb', line 52132 def get_svmsgd_type() __validate_pointer__ Rbind::cv_ml_svmsgd_get_svmsgd_type( self) end |
#get_term_criteria ⇒ Cv::TermCriteria Also known as: getTermCriteria
method wrapper for const cv::TermCriteria cv::ml::SVMSGD::getTermCriteria()
52217 52218 52219 52220 52221 52222 52223 52224 52225 |
# File 'lib/ropencv/ropencv_types.rb', line 52217 def get_term_criteria() __validate_pointer__ result = Rbind::cv_ml_svmsgd_get_term_criteria( self) if result.respond_to?(:__owner__?) && !result.__owner__? # store owner insight the pointer to not get garbage collected result.instance_variable_get(:@__obj_ptr__).instance_variable_set(:@__owner__,self) end result end |
#get_var_count ⇒ Fixnum Also known as: getVarCount
method wrapper for int cv::ml::SVMSGD::getVarCount()
52253 52254 52255 52256 |
# File 'lib/ropencv/ropencv_types.rb', line 52253 def get_var_count() __validate_pointer__ Rbind::cv_ml_svmsgd_get_var_count( self) end |
#get_weights ⇒ Cv::Mat Also known as: getWeights
method wrapper for const cv::Mat cv::ml::SVMSGD::getWeights()
methods
52087 52088 52089 52090 52091 52092 52093 52094 52095 |
# File 'lib/ropencv/ropencv_types.rb', line 52087 def get_weights() __validate_pointer__ result = Rbind::cv_ml_svmsgd_get_weights( self) if result.respond_to?(:__owner__?) && !result.__owner__? # store owner insight the pointer to not get garbage collected result.instance_variable_get(:@__obj_ptr__).instance_variable_set(:@__owner__,self) end result end |
#is_classifier ⇒ Bool Also known as: isClassifier
method wrapper for bool cv::ml::SVMSGD::isClassifier()
52276 52277 52278 52279 |
# File 'lib/ropencv/ropencv_types.rb', line 52276 def is_classifier() __validate_pointer__ Rbind::cv_ml_svmsgd_is_classifier( self) end |
#is_trained ⇒ Bool Also known as: isTrained
method wrapper for bool cv::ml::SVMSGD::isTrained()
52268 52269 52270 52271 |
# File 'lib/ropencv/ropencv_types.rb', line 52268 def is_trained() __validate_pointer__ Rbind::cv_ml_svmsgd_is_trained( self) end |
#predict(samples, results = Cv::Mat.new(), flags = 0) ⇒ Float
method wrapper for float cv::ml::SVMSGD::predict(const cv::Mat samples, const cv::Mat results = Mat()/O, int flags = 0)
52342 52343 52344 52345 |
# File 'lib/ropencv/ropencv_types.rb', line 52342 def predict(samples, results = Cv::Mat.new(), flags = 0) __validate_pointer__ Rbind::cv_ml_svmsgd_predict( self, samples, results, flags) end |
#read(fn) ⇒ Void
method wrapper for void cv::ml::SVMSGD::read(const cv::FileNode fn)
52380 52381 52382 52383 |
# File 'lib/ropencv/ropencv_types.rb', line 52380 def read(fn) __validate_pointer__ Rbind::cv_ml_svmsgd_read( self, fn) end |
#save(filename) ⇒ Void
method wrapper for void cv::ml::SVMSGD::save(const std::string filename)
52388 52389 52390 52391 |
# File 'lib/ropencv/ropencv_types.rb', line 52388 def save(filename) __validate_pointer__ Rbind::cv_ml_svmsgd_save( self, filename) end |
#set_initial_step_size(initial_step_size) ⇒ Void Also known as: setInitialStepSize
method wrapper for void cv::ml::SVMSGD::setInitialStepSize(float InitialStepSize)
52192 52193 52194 52195 |
# File 'lib/ropencv/ropencv_types.rb', line 52192 def set_initial_step_size(initial_step_size) __validate_pointer__ Rbind::cv_ml_svmsgd_set_initial_step_size( self, initial_step_size) end |
#set_margin_regularization(margin_regularization) ⇒ Void Also known as: setMarginRegularization
method wrapper for void cv::ml::SVMSGD::setMarginRegularization(float marginRegularization)
52175 52176 52177 52178 |
# File 'lib/ropencv/ropencv_types.rb', line 52175 def set_margin_regularization(margin_regularization) __validate_pointer__ Rbind::cv_ml_svmsgd_set_margin_regularization( self, margin_regularization) end |
#set_margin_type(margin_type) ⇒ Void Also known as: setMarginType
method wrapper for void cv::ml::SVMSGD::setMarginType(int marginType)
52158 52159 52160 52161 |
# File 'lib/ropencv/ropencv_types.rb', line 52158 def set_margin_type(margin_type) __validate_pointer__ Rbind::cv_ml_svmsgd_set_margin_type( self, margin_type) end |
#set_optimal_parameters(svmsgd_type = SVMSGD::ASGD, margin_type = SVMSGD::SOFT_MARGIN) ⇒ Void Also known as: setOptimalParameters
method wrapper for void cv::ml::SVMSGD::setOptimalParameters(int svmsgdType = SVMSGD::ASGD, int marginType = SVMSGD::SOFT_MARGIN)
52124 52125 52126 52127 |
# File 'lib/ropencv/ropencv_types.rb', line 52124 def set_optimal_parameters(svmsgd_type = SVMSGD::ASGD, margin_type = SVMSGD::SOFT_MARGIN) __validate_pointer__ Rbind::cv_ml_svmsgd_set_optimal_parameters( self, svmsgd_type, margin_type) end |
#set_step_decreasing_power(step_decreasing_power) ⇒ Void Also known as: setStepDecreasingPower
method wrapper for void cv::ml::SVMSGD::setStepDecreasingPower(float stepDecreasingPower)
52209 52210 52211 52212 |
# File 'lib/ropencv/ropencv_types.rb', line 52209 def set_step_decreasing_power(step_decreasing_power) __validate_pointer__ Rbind::cv_ml_svmsgd_set_step_decreasing_power( self, step_decreasing_power) end |
#set_svmsgd_type(svmsgd_type) ⇒ Void Also known as: setSvmsgdType
method wrapper for void cv::ml::SVMSGD::setSvmsgdType(int svmsgdType)
52141 52142 52143 52144 |
# File 'lib/ropencv/ropencv_types.rb', line 52141 def set_svmsgd_type(svmsgd_type) __validate_pointer__ Rbind::cv_ml_svmsgd_set_svmsgd_type( self, svmsgd_type) end |
#set_term_criteria(val) ⇒ Void Also known as: setTermCriteria
method wrapper for void cv::ml::SVMSGD::setTermCriteria(const cv::TermCriteria val)
52231 52232 52233 52234 |
# File 'lib/ropencv/ropencv_types.rb', line 52231 def set_term_criteria(val) __validate_pointer__ Rbind::cv_ml_svmsgd_set_term_criteria( self, val) end |
#to_s ⇒ Object
converts SVMSGD into a string by crawling through all its attributes
52072 52073 52074 |
# File 'lib/ropencv/ropencv_types.rb', line 52072 def to_s "#<cv::ml::SVMSGD >" end |
#train(train_data, flags = 0) ⇒ Bool #train(samples, layout, responses) ⇒ Bool
wrapper for overloaded method train
52293 52294 52295 52296 52297 52298 52299 52300 52301 52302 52303 52304 52305 52306 52307 52308 52309 52310 52311 52312 52313 52314 52315 52316 52317 52318 52319 52320 52321 52322 52323 52324 |
# File 'lib/ropencv/ropencv_types.rb', line 52293 def train(*args) __validate_pointer__ # overloaded method wrapper for bool cv::ml::SVMSGD::train(const cv::Ptr<cv::ml::TrainData> trainData, int flags = 0) @@cv_ml_svmsgd_train_defaults0 ||= [nil, 0] if(args.size >= 1 && args.size <= 2) targs = args.clone targs.size.upto(1) do |i| targs[i] = @@cv_ml_svmsgd_train_defaults0[i] end begin return Rbind::cv_ml_svmsgd_train(self,*targs) rescue TypeError => e @error = e end end # overloaded method wrapper for bool cv::ml::SVMSGD::train(const cv::Mat samples, int layout, const cv::Mat responses) @@cv_ml_svmsgd_train__2_defaults1 ||= [nil, nil, nil] if(args.size >= 3 && args.size <= 3) targs = args.clone targs.size.upto(2) do |i| targs[i] = @@cv_ml_svmsgd_train__2_defaults1[i] end begin return Rbind::cv_ml_svmsgd_train__2(self,*targs) rescue TypeError => e @error = e end end raise ArgumentError, "No overloaded signature fits to: #{args.map(&:class)}" end |
#write(fs, name = Std::String.new()) ⇒ Void
method wrapper for void cv::ml::SVMSGD::write(const cv::Ptrcv::FileStorage fs, const std::string name = String())
52372 52373 52374 52375 |
# File 'lib/ropencv/ropencv_types.rb', line 52372 def write(fs, name = Std::String.new()) __validate_pointer__ Rbind::cv_ml_svmsgd_write( self, fs, name) end |