Class: OpenCV::CvBoost
- Inherits:
-
Object
- Object
- OpenCV::CvBoost
- Extended by:
- FFI::DataConverter
- Defined in:
- lib/ropencv/ropencv_types.rb
Constants collapse
- DISCRETE =
0
- REAL =
1
- LOGIT =
2
- GENTLE =
3
- DEFAULT =
0
- GINI =
1
- MISCLASS =
3
- SQERR =
4
Class Method Summary collapse
- .cast_from_cv_stat_model(ptr) ⇒ CvBoost (also: castFromCvStatModel)
- .new(*args) ⇒ Object
-
.null ⇒ Object
returns a null pointer to the object.
Instance Method Summary collapse
- #cast_to_cv_stat_model ⇒ CvStatModel (also: #castToCvStatModel)
- #clear ⇒ Void
- #load(filename, name = 0) ⇒ Void
- #predict(sample, missing = Cv::Mat.new(), slice = Cv::Range::all(), raw_mode = false, return_sum = false) ⇒ Float
- #prune(slice) ⇒ Void
- #save(filename, name = 0) ⇒ Void
-
#to_s ⇒ Object
converts CvBoost into a string by crawling through all its attributes.
-
#train(train_data, tflag, responses, var_idx = Cv::Mat.new(), sample_idx = Cv::Mat.new(), var_type = Cv::Mat.new(), missing_data_mask = Cv::Mat.new(), params = CvBoostParams.new(), update = false) ⇒ Bool
methods.
Class Method Details
.cast_from_cv_stat_model(ptr) ⇒ CvBoost Also known as: castFromCvStatModel
wrapper for static method CvBoost* CvBoost::castFromCvStatModel(CvStatModel* ptr)
44610 44611 44612 |
# File 'lib/ropencv/ropencv_types.rb', line 44610 def self.cast_from_cv_stat_model(ptr) Rbind::cv_boost_cast_from_cv_stat_model(ptr) end |
.cv_boost ⇒ Object .cv_boost(train_data, tflag, responses, var_idx = Cv::Mat.new(), sample_idx = Cv::Mat.new(), var_type = Cv::Mat.new(), missing_data_mask = Cv::Mat.new(), params = CvBoostParams.new()) ⇒ Object
44434 44435 44436 44437 44438 44439 44440 44441 44442 44443 44444 44445 44446 44447 44448 44449 44450 44451 44452 44453 44454 44455 44456 44457 44458 44459 44460 44461 44462 44463 44464 44465 44466 44467 44468 |
# File 'lib/ropencv/ropencv_types.rb', line 44434 def self.new(*args) if args.first.is_a?(FFI::Pointer) || args.first.is_a?(CvBoostStruct) raise ArgumentError, "too many arguments for creating #{self.name} from Pointer" unless args.size == 1 return super(args.first) end # overloaded method wrapper for CvBoost::CvBoost() @@cv_boost_cv_boost_defaults0 ||= [] if(args.size >= 0 && args.size <= 0) targs = args.clone targs.size.upto(-1) do |i| targs[i] = @@cv_boost_cv_boost_defaults0[i] end begin return Rbind::cv_boost_cv_boost(*targs) rescue TypeError => e @error = e end end # overloaded method wrapper for CvBoost::CvBoost(const cv::Mat trainData, int tflag, const cv::Mat responses, const cv::Mat varIdx = cv::Mat(), const cv::Mat sampleIdx = cv::Mat(), const cv::Mat varType = cv::Mat(), const cv::Mat missingDataMask = cv::Mat(), const CvBoostParams params = CvBoostParams()) @@cv_boost_cv_boost2_defaults1 ||= [nil, nil, nil, Cv::Mat.new(), Cv::Mat.new(), Cv::Mat.new(), Cv::Mat.new(), CvBoostParams.new()] if(args.size >= 3 && args.size <= 8) targs = args.clone targs.size.upto(7) do |i| targs[i] = @@cv_boost_cv_boost2_defaults1[i] end begin return Rbind::cv_boost_cv_boost2(*targs) rescue TypeError => e @error = e end end raise ArgumentError, "no constructor for #{self}(#{args.inspect})" end |
.null ⇒ Object
returns a null pointer to the object
44419 44420 44421 |
# File 'lib/ropencv/ropencv_types.rb', line 44419 def self.null new(CvBoostStruct.new) end |
Instance Method Details
#cast_to_cv_stat_model ⇒ CvStatModel Also known as: castToCvStatModel
method wrapper for CvStatModel* CvBoost::castToCvStatModel()
44596 44597 44598 44599 44600 44601 44602 44603 44604 |
# File 'lib/ropencv/ropencv_types.rb', line 44596 def cast_to_cv_stat_model() __validate_pointer__ result = Rbind::cv_boost_cast_to_cv_stat_model( 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 |
#clear ⇒ Void
method wrapper for void CvBoost::clear()
44589 44590 44591 44592 |
# File 'lib/ropencv/ropencv_types.rb', line 44589 def clear() __validate_pointer__ Rbind::cv_boost_clear( self) end |
#load(filename, name = 0) ⇒ Void
method wrapper for void CvBoost::load(c_string filename, c_string name = 0)
44628 44629 44630 44631 |
# File 'lib/ropencv/ropencv_types.rb', line 44628 def load(filename, name = 0) __validate_pointer__ Rbind::cv_boost_load( self, filename, name) end |
#predict(sample, missing = Cv::Mat.new(), slice = Cv::Range::all(), raw_mode = false, return_sum = false) ⇒ Float
method wrapper for float CvBoost::predict(const cv::Mat sample, const cv::Mat missing = cv::Mat(), const cv::Range slice = cv::Range::all(), bool rawMode = false, bool returnSum = false)
44574 44575 44576 44577 |
# File 'lib/ropencv/ropencv_types.rb', line 44574 def predict(sample, missing = Cv::Mat.new(), slice = Cv::Range::all(), raw_mode = false, return_sum = false) __validate_pointer__ Rbind::cv_boost_predict( self, sample, missing, slice, raw_mode, return_sum) end |
#prune(slice) ⇒ Void
method wrapper for void CvBoost::prune(const CvSlice slice)
44582 44583 44584 44585 |
# File 'lib/ropencv/ropencv_types.rb', line 44582 def prune(slice) __validate_pointer__ Rbind::cv_boost_prune( self, slice) end |
#save(filename, name = 0) ⇒ Void
method wrapper for void CvBoost::save(c_string filename, c_string name = 0)
44619 44620 44621 44622 |
# File 'lib/ropencv/ropencv_types.rb', line 44619 def save(filename, name = 0) __validate_pointer__ Rbind::cv_boost_save( self, filename, name) end |
#to_s ⇒ Object
converts CvBoost into a string by crawling through all its attributes
44534 44535 44536 |
# File 'lib/ropencv/ropencv_types.rb', line 44534 def to_s "#<CvBoost >" end |
#train(train_data, tflag, responses, var_idx = Cv::Mat.new(), sample_idx = Cv::Mat.new(), var_type = Cv::Mat.new(), missing_data_mask = Cv::Mat.new(), params = CvBoostParams.new(), update = false) ⇒ Bool
method wrapper for bool CvBoost::train(const cv::Mat trainData, int tflag, const cv::Mat responses, const cv::Mat varIdx = cv::Mat(), const cv::Mat sampleIdx = cv::Mat(), const cv::Mat varType = cv::Mat(), const cv::Mat missingDataMask = cv::Mat(), const CvBoostParams params = CvBoostParams(), bool update = false)
methods
44562 44563 44564 44565 |
# File 'lib/ropencv/ropencv_types.rb', line 44562 def train(train_data, tflag, responses, var_idx = Cv::Mat.new(), sample_idx = Cv::Mat.new(), var_type = Cv::Mat.new(), missing_data_mask = Cv::Mat.new(), params = CvBoostParams.new(), update = false) __validate_pointer__ Rbind::cv_boost_train( self, train_data, tflag, responses, var_idx, sample_idx, var_type, missing_data_mask, params, update) end |