Class: OpenCV::Cv::Ml::LogisticRegression
- Inherits:
-
Object
- Object
- OpenCV::Cv::Ml::LogisticRegression
- Extended by:
- FFI::DataConverter
- Defined in:
- lib/ropencv/ropencv_types.rb
Constants collapse
- REG_DISABLE =
-1
- REG_L1 =
0
- REG_L2 =
1
- BATCH =
0
- MINI_BATCH =
1
Class Method Summary collapse
- .create ⇒ Cv::Ptr::Cv_Ml_LogisticRegression
- .load(filepath, node_name = Std::String.new()) ⇒ Cv::Ptr::Cv_Ml_LogisticRegression
- .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_iterations ⇒ Fixnum (also: #getIterations)
-
#get_learning_rate ⇒ Double
(also: #getLearningRate)
methods.
- #get_learnt_thetas ⇒ Cv::Mat
- #get_mini_batch_size ⇒ Fixnum (also: #getMiniBatchSize)
- #get_regularization ⇒ Fixnum (also: #getRegularization)
- #get_term_criteria ⇒ Cv::TermCriteria (also: #getTermCriteria)
- #get_train_method ⇒ Fixnum (also: #getTrainMethod)
- #get_var_count ⇒ Fixnum (also: #getVarCount)
- #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_iterations(val) ⇒ Void (also: #setIterations)
- #set_learning_rate(val) ⇒ Void (also: #setLearningRate)
- #set_mini_batch_size(val) ⇒ Void (also: #setMiniBatchSize)
- #set_regularization(val) ⇒ Void (also: #setRegularization)
- #set_term_criteria(val) ⇒ Void (also: #setTermCriteria)
- #set_train_method(val) ⇒ Void (also: #setTrainMethod)
-
#to_s ⇒ Object
converts LogisticRegression 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_LogisticRegression
wrapper for static method const cv::Ptrcv::ml::LogisticRegression cv::ml::LogisticRegression::create()
51782 51783 51784 |
# File 'lib/ropencv/ropencv_types.rb', line 51782 def self.create() Rbind::cv_ml_logistic_regression_create() end |
.load(filepath, node_name = Std::String.new()) ⇒ Cv::Ptr::Cv_Ml_LogisticRegression
wrapper for static method const cv::Ptrcv::ml::LogisticRegression cv::ml::LogisticRegression::load(const std::string filepath, const std::string nodeName = String())
51790 51791 51792 |
# File 'lib/ropencv/ropencv_types.rb', line 51790 def self.load(filepath, node_name = Std::String.new()) Rbind::cv_ml_logistic_regression_load(filepath, node_name) end |
.new(*args) ⇒ Object
51564 51565 51566 51567 51568 51569 51570 51571 |
# File 'lib/ropencv/ropencv_types.rb', line 51564 def self.new(*args) if args.first.is_a?(FFI::Pointer) || args.first.is_a?(LogisticRegressionStruct) 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
51560 51561 51562 |
# File 'lib/ropencv/ropencv_types.rb', line 51560 def self.null new(LogisticRegressionStruct.new) end |
Instance Method Details
#calc_error(data, test, resp) ⇒ Float Also known as: calcError
method wrapper for float cv::ml::LogisticRegression::calcError(const cv::Ptrcv::ml::TrainData data, bool test, cv::Mat& resp)
51888 51889 51890 51891 |
# File 'lib/ropencv/ropencv_types.rb', line 51888 def calc_error(data, test, resp) __validate_pointer__ Rbind::cv_ml_logistic_regression_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::LogisticRegression::castToAlgorithm(bool parse_ownership)
51897 51898 51899 51900 51901 51902 51903 51904 51905 |
# File 'lib/ropencv/ropencv_types.rb', line 51897 def cast_to_algorithm(parse_ownership) __validate_pointer__ result = Rbind::cv_ml_logistic_regression_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::LogisticRegression::castToStatModel(bool parse_ownership)
51797 51798 51799 51800 51801 51802 51803 51804 51805 |
# File 'lib/ropencv/ropencv_types.rb', line 51797 def cast_to_stat_model(parse_ownership) __validate_pointer__ result = Rbind::cv_ml_logistic_regression_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::LogisticRegression::clear()
51910 51911 51912 51913 |
# File 'lib/ropencv/ropencv_types.rb', line 51910 def clear() __validate_pointer__ Rbind::cv_ml_logistic_regression_clear( self) end |
#empty ⇒ Bool
method wrapper for bool cv::ml::LogisticRegression::empty()
51818 51819 51820 51821 |
# File 'lib/ropencv/ropencv_types.rb', line 51818 def empty() __validate_pointer__ Rbind::cv_ml_logistic_regression_empty( self) end |
#get_default_name ⇒ Std::String Also known as: getDefaultName
method wrapper for const std::string cv::ml::LogisticRegression::getDefaultName()
51942 51943 51944 51945 51946 51947 51948 51949 51950 |
# File 'lib/ropencv/ropencv_types.rb', line 51942 def get_default_name() __validate_pointer__ result = Rbind::cv_ml_logistic_regression_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_iterations ⇒ Fixnum Also known as: getIterations
method wrapper for int cv::ml::LogisticRegression::getIterations()
51670 51671 51672 51673 |
# File 'lib/ropencv/ropencv_types.rb', line 51670 def get_iterations() __validate_pointer__ Rbind::cv_ml_logistic_regression_get_iterations( self) end |
#get_learning_rate ⇒ Double Also known as: getLearningRate
method wrapper for double cv::ml::LogisticRegression::getLearningRate()
methods
51653 51654 51655 51656 |
# File 'lib/ropencv/ropencv_types.rb', line 51653 def get_learning_rate() __validate_pointer__ Rbind::cv_ml_logistic_regression_get_learning_rate( self) end |
#get_learnt_thetas ⇒ Cv::Mat
method wrapper for const cv::Mat cv::ml::LogisticRegression::get_learnt_thetas()
51770 51771 51772 51773 51774 51775 51776 51777 51778 |
# File 'lib/ropencv/ropencv_types.rb', line 51770 def get_learnt_thetas() __validate_pointer__ result = Rbind::cv_ml_logistic_regression_get_learnt_thetas( 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_mini_batch_size ⇒ Fixnum Also known as: getMiniBatchSize
method wrapper for int cv::ml::LogisticRegression::getMiniBatchSize()
51721 51722 51723 51724 |
# File 'lib/ropencv/ropencv_types.rb', line 51721 def get_mini_batch_size() __validate_pointer__ Rbind::cv_ml_logistic_regression_get_mini_batch_size( self) end |
#get_regularization ⇒ Fixnum Also known as: getRegularization
method wrapper for int cv::ml::LogisticRegression::getRegularization()
51687 51688 51689 51690 |
# File 'lib/ropencv/ropencv_types.rb', line 51687 def get_regularization() __validate_pointer__ Rbind::cv_ml_logistic_regression_get_regularization( self) end |
#get_term_criteria ⇒ Cv::TermCriteria Also known as: getTermCriteria
method wrapper for const cv::TermCriteria cv::ml::LogisticRegression::getTermCriteria()
51738 51739 51740 51741 51742 51743 51744 51745 51746 |
# File 'lib/ropencv/ropencv_types.rb', line 51738 def get_term_criteria() __validate_pointer__ result = Rbind::cv_ml_logistic_regression_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_train_method ⇒ Fixnum Also known as: getTrainMethod
method wrapper for int cv::ml::LogisticRegression::getTrainMethod()
51704 51705 51706 51707 |
# File 'lib/ropencv/ropencv_types.rb', line 51704 def get_train_method() __validate_pointer__ Rbind::cv_ml_logistic_regression_get_train_method( self) end |
#get_var_count ⇒ Fixnum Also known as: getVarCount
method wrapper for int cv::ml::LogisticRegression::getVarCount()
51810 51811 51812 51813 |
# File 'lib/ropencv/ropencv_types.rb', line 51810 def get_var_count() __validate_pointer__ Rbind::cv_ml_logistic_regression_get_var_count( self) end |
#is_classifier ⇒ Bool Also known as: isClassifier
method wrapper for bool cv::ml::LogisticRegression::isClassifier()
51833 51834 51835 51836 |
# File 'lib/ropencv/ropencv_types.rb', line 51833 def is_classifier() __validate_pointer__ Rbind::cv_ml_logistic_regression_is_classifier( self) end |
#is_trained ⇒ Bool Also known as: isTrained
method wrapper for bool cv::ml::LogisticRegression::isTrained()
51825 51826 51827 51828 |
# File 'lib/ropencv/ropencv_types.rb', line 51825 def is_trained() __validate_pointer__ Rbind::cv_ml_logistic_regression_is_trained( self) end |
#predict(samples, results = Cv::Mat.new(), flags = 0) ⇒ Float
method wrapper for float cv::ml::LogisticRegression::predict(const cv::Mat samples, const cv::Mat results = Mat()/O, int flags = 0)
51763 51764 51765 51766 |
# File 'lib/ropencv/ropencv_types.rb', line 51763 def predict(samples, results = Cv::Mat.new(), flags = 0) __validate_pointer__ Rbind::cv_ml_logistic_regression_predict( self, samples, results, flags) end |
#read(fn) ⇒ Void
method wrapper for void cv::ml::LogisticRegression::read(const cv::FileNode fn)
51927 51928 51929 51930 |
# File 'lib/ropencv/ropencv_types.rb', line 51927 def read(fn) __validate_pointer__ Rbind::cv_ml_logistic_regression_read( self, fn) end |
#save(filename) ⇒ Void
method wrapper for void cv::ml::LogisticRegression::save(const std::string filename)
51935 51936 51937 51938 |
# File 'lib/ropencv/ropencv_types.rb', line 51935 def save(filename) __validate_pointer__ Rbind::cv_ml_logistic_regression_save( self, filename) end |
#set_iterations(val) ⇒ Void Also known as: setIterations
method wrapper for void cv::ml::LogisticRegression::setIterations(int val)
51679 51680 51681 51682 |
# File 'lib/ropencv/ropencv_types.rb', line 51679 def set_iterations(val) __validate_pointer__ Rbind::cv_ml_logistic_regression_set_iterations( self, val) end |
#set_learning_rate(val) ⇒ Void Also known as: setLearningRate
method wrapper for void cv::ml::LogisticRegression::setLearningRate(double val)
51662 51663 51664 51665 |
# File 'lib/ropencv/ropencv_types.rb', line 51662 def set_learning_rate(val) __validate_pointer__ Rbind::cv_ml_logistic_regression_set_learning_rate( self, val) end |
#set_mini_batch_size(val) ⇒ Void Also known as: setMiniBatchSize
method wrapper for void cv::ml::LogisticRegression::setMiniBatchSize(int val)
51730 51731 51732 51733 |
# File 'lib/ropencv/ropencv_types.rb', line 51730 def set_mini_batch_size(val) __validate_pointer__ Rbind::cv_ml_logistic_regression_set_mini_batch_size( self, val) end |
#set_regularization(val) ⇒ Void Also known as: setRegularization
method wrapper for void cv::ml::LogisticRegression::setRegularization(int val)
51696 51697 51698 51699 |
# File 'lib/ropencv/ropencv_types.rb', line 51696 def set_regularization(val) __validate_pointer__ Rbind::cv_ml_logistic_regression_set_regularization( self, val) end |
#set_term_criteria(val) ⇒ Void Also known as: setTermCriteria
method wrapper for void cv::ml::LogisticRegression::setTermCriteria(const cv::TermCriteria val)
51752 51753 51754 51755 |
# File 'lib/ropencv/ropencv_types.rb', line 51752 def set_term_criteria(val) __validate_pointer__ Rbind::cv_ml_logistic_regression_set_term_criteria( self, val) end |
#set_train_method(val) ⇒ Void Also known as: setTrainMethod
method wrapper for void cv::ml::LogisticRegression::setTrainMethod(int val)
51713 51714 51715 51716 |
# File 'lib/ropencv/ropencv_types.rb', line 51713 def set_train_method(val) __validate_pointer__ Rbind::cv_ml_logistic_regression_set_train_method( self, val) end |
#to_s ⇒ Object
converts LogisticRegression into a string by crawling through all its attributes
51637 51638 51639 |
# File 'lib/ropencv/ropencv_types.rb', line 51637 def to_s "#<cv::ml::LogisticRegression >" end |
#train(train_data, flags = 0) ⇒ Bool #train(samples, layout, responses) ⇒ Bool
wrapper for overloaded method train
51850 51851 51852 51853 51854 51855 51856 51857 51858 51859 51860 51861 51862 51863 51864 51865 51866 51867 51868 51869 51870 51871 51872 51873 51874 51875 51876 51877 51878 51879 51880 51881 |
# File 'lib/ropencv/ropencv_types.rb', line 51850 def train(*args) __validate_pointer__ # overloaded method wrapper for bool cv::ml::LogisticRegression::train(const cv::Ptr<cv::ml::TrainData> trainData, int flags = 0) @@cv_ml_logistic_regression_train_defaults0 ||= [nil, 0] if(args.size >= 1 && args.size <= 2) targs = args.clone targs.size.upto(1) do |i| targs[i] = @@cv_ml_logistic_regression_train_defaults0[i] end begin return Rbind::cv_ml_logistic_regression_train(self,*targs) rescue TypeError => e @error = e end end # overloaded method wrapper for bool cv::ml::LogisticRegression::train(const cv::Mat samples, int layout, const cv::Mat responses) @@cv_ml_logistic_regression_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_logistic_regression_train__2_defaults1[i] end begin return Rbind::cv_ml_logistic_regression_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::LogisticRegression::write(const cv::Ptrcv::FileStorage fs, const std::string name = String())
51919 51920 51921 51922 |
# File 'lib/ropencv/ropencv_types.rb', line 51919 def write(fs, name = Std::String.new()) __validate_pointer__ Rbind::cv_ml_logistic_regression_write( self, fs, name) end |