Class: OpenCV::CvGBTrees
- Inherits:
-
Object
- Object
- OpenCV::CvGBTrees
- Extended by:
- FFI::DataConverter
- Defined in:
- lib/ropencv/ropencv_types.rb
Constants collapse
- SQUARED_LOSS =
0
- ABSOLUTE_LOSS =
0
- HUBER_LOSS =
3
- DEVIANCE_LOSS =
3
Class Method Summary collapse
- .cast_from_cv_stat_model(ptr) ⇒ CvGBTrees (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
methods.
- #load(filename, name = 0) ⇒ Void
- #predict(sample, missing = Cv::Mat.new(), slice = Cv::Range::all(), k = -1)) ⇒ Float
- #save(filename, name = 0) ⇒ Void
-
#to_s ⇒ Object
converts CvGBTrees 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 = CvGBTreesParams.new(), update = false) ⇒ Bool
Class Method Details
.cast_from_cv_stat_model(ptr) ⇒ CvGBTrees Also known as: castFromCvStatModel
wrapper for static method CvGBTrees* CvGBTrees::castFromCvStatModel(CvStatModel* ptr)
45049 45050 45051 |
# File 'lib/ropencv/ropencv_types.rb', line 45049 def self.cast_from_cv_stat_model(ptr) Rbind::cvgb_trees_cast_from_cv_stat_model(ptr) end |
.cvgb_trees ⇒ Object .cvgb_trees(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 = CvGBTreesParams.new()) ⇒ Object
44886 44887 44888 44889 44890 44891 44892 44893 44894 44895 44896 44897 44898 44899 44900 44901 44902 44903 44904 44905 44906 44907 44908 44909 44910 44911 44912 44913 44914 44915 44916 44917 44918 44919 44920 |
# File 'lib/ropencv/ropencv_types.rb', line 44886 def self.new(*args) if args.first.is_a?(FFI::Pointer) || args.first.is_a?(CvGBTreesStruct) raise ArgumentError, "too many arguments for creating #{self.name} from Pointer" unless args.size == 1 return super(args.first) end # overloaded method wrapper for CvGBTrees::CvGBTrees() @@cvgb_trees_cvgb_trees_defaults0 ||= [] if(args.size >= 0 && args.size <= 0) targs = args.clone targs.size.upto(-1) do |i| targs[i] = @@cvgb_trees_cvgb_trees_defaults0[i] end begin return Rbind::cvgb_trees_cvgb_trees(*targs) rescue TypeError => e @error = e end end # overloaded method wrapper for CvGBTrees::CvGBTrees(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 CvGBTreesParams params = CvGBTreesParams()) @@cvgb_trees_cvgb_trees2_defaults1 ||= [nil, nil, nil, Cv::Mat.new(), Cv::Mat.new(), Cv::Mat.new(), Cv::Mat.new(), CvGBTreesParams.new()] if(args.size >= 3 && args.size <= 8) targs = args.clone targs.size.upto(7) do |i| targs[i] = @@cvgb_trees_cvgb_trees2_defaults1[i] end begin return Rbind::cvgb_trees_cvgb_trees2(*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
44871 44872 44873 |
# File 'lib/ropencv/ropencv_types.rb', line 44871 def self.null new(CvGBTreesStruct.new) end |
Instance Method Details
#cast_to_cv_stat_model ⇒ CvStatModel Also known as: castToCvStatModel
method wrapper for CvStatModel* CvGBTrees::castToCvStatModel()
45035 45036 45037 45038 45039 45040 45041 45042 45043 |
# File 'lib/ropencv/ropencv_types.rb', line 45035 def cast_to_cv_stat_model() __validate_pointer__ result = Rbind::cvgb_trees_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 CvGBTrees::clear()
methods
45001 45002 45003 45004 |
# File 'lib/ropencv/ropencv_types.rb', line 45001 def clear() __validate_pointer__ Rbind::cvgb_trees_clear( self) end |
#load(filename, name = 0) ⇒ Void
method wrapper for void CvGBTrees::load(c_string filename, c_string name = 0)
45067 45068 45069 45070 |
# File 'lib/ropencv/ropencv_types.rb', line 45067 def load(filename, name = 0) __validate_pointer__ Rbind::cvgb_trees_load( self, filename, name) end |
#predict(sample, missing = Cv::Mat.new(), slice = Cv::Range::all(), k = -1)) ⇒ Float
method wrapper for float CvGBTrees::predict(const cv::Mat sample, const cv::Mat missing = cv::Mat(), const cv::Range slice = cv::Range::all(), int k = -1)
45028 45029 45030 45031 |
# File 'lib/ropencv/ropencv_types.rb', line 45028 def predict(sample, missing = Cv::Mat.new(), slice = Cv::Range::all(), k = -1) __validate_pointer__ Rbind::cvgb_trees_predict( self, sample, missing, slice, k) end |
#save(filename, name = 0) ⇒ Void
method wrapper for void CvGBTrees::save(c_string filename, c_string name = 0)
45058 45059 45060 45061 |
# File 'lib/ropencv/ropencv_types.rb', line 45058 def save(filename, name = 0) __validate_pointer__ Rbind::cvgb_trees_save( self, filename, name) end |
#to_s ⇒ Object
converts CvGBTrees into a string by crawling through all its attributes
44986 44987 44988 |
# File 'lib/ropencv/ropencv_types.rb', line 44986 def to_s "#<CvGBTrees >" 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 = CvGBTreesParams.new(), update = false) ⇒ Bool
method wrapper for bool CvGBTrees::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 CvGBTreesParams params = CvGBTreesParams(), bool update = false)
45017 45018 45019 45020 |
# File 'lib/ropencv/ropencv_types.rb', line 45017 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 = CvGBTreesParams.new(), update = false) __validate_pointer__ Rbind::cvgb_trees_train( self, train_data, tflag, responses, var_idx, sample_idx, var_type, missing_data_mask, params, update) end |