LogisticRegression.h 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256
  1. //
  2. // This file is auto-generated. Please don't modify it!
  3. //
  4. #pragma once
  5. #ifdef __cplusplus
  6. //#import "opencv.hpp"
  7. #import "opencv2/ml.hpp"
  8. #else
  9. #define CV_EXPORTS
  10. #endif
  11. #import <Foundation/Foundation.h>
  12. #import "StatModel.h"
  13. @class Mat;
  14. @class TermCriteria;
  15. // C++: enum Methods (cv.ml.LogisticRegression.Methods)
  16. typedef NS_ENUM(int, Methods) {
  17. BATCH = 0,
  18. MINI_BATCH = 1
  19. };
  20. // C++: enum RegKinds (cv.ml.LogisticRegression.RegKinds)
  21. typedef NS_ENUM(int, RegKinds) {
  22. REG_DISABLE = -1,
  23. REG_L1 = 0,
  24. REG_L2 = 1
  25. };
  26. NS_ASSUME_NONNULL_BEGIN
  27. // C++: class LogisticRegression
  28. /**
  29. * Implements Logistic Regression classifier.
  30. *
  31. * @see REF: ml_intro_lr
  32. *
  33. * Member of `Ml`
  34. */
  35. CV_EXPORTS @interface LogisticRegression : StatModel
  36. #ifdef __cplusplus
  37. @property(readonly)cv::Ptr<cv::ml::LogisticRegression> nativePtrLogisticRegression;
  38. #endif
  39. #ifdef __cplusplus
  40. - (instancetype)initWithNativePtr:(cv::Ptr<cv::ml::LogisticRegression>)nativePtr;
  41. + (instancetype)fromNative:(cv::Ptr<cv::ml::LogisticRegression>)nativePtr;
  42. #endif
  43. #pragma mark - Methods
  44. //
  45. // double cv::ml::LogisticRegression::getLearningRate()
  46. //
  47. /**
  48. * @see `-setLearningRate:`
  49. */
  50. - (double)getLearningRate NS_SWIFT_NAME(getLearningRate());
  51. //
  52. // void cv::ml::LogisticRegression::setLearningRate(double val)
  53. //
  54. /**
  55. * getLearningRate @see `-getLearningRate:`
  56. */
  57. - (void)setLearningRate:(double)val NS_SWIFT_NAME(setLearningRate(val:));
  58. //
  59. // int cv::ml::LogisticRegression::getIterations()
  60. //
  61. /**
  62. * @see `-setIterations:`
  63. */
  64. - (int)getIterations NS_SWIFT_NAME(getIterations());
  65. //
  66. // void cv::ml::LogisticRegression::setIterations(int val)
  67. //
  68. /**
  69. * getIterations @see `-getIterations:`
  70. */
  71. - (void)setIterations:(int)val NS_SWIFT_NAME(setIterations(val:));
  72. //
  73. // int cv::ml::LogisticRegression::getRegularization()
  74. //
  75. /**
  76. * @see `-setRegularization:`
  77. */
  78. - (int)getRegularization NS_SWIFT_NAME(getRegularization());
  79. //
  80. // void cv::ml::LogisticRegression::setRegularization(int val)
  81. //
  82. /**
  83. * getRegularization @see `-getRegularization:`
  84. */
  85. - (void)setRegularization:(int)val NS_SWIFT_NAME(setRegularization(val:));
  86. //
  87. // int cv::ml::LogisticRegression::getTrainMethod()
  88. //
  89. /**
  90. * @see `-setTrainMethod:`
  91. */
  92. - (int)getTrainMethod NS_SWIFT_NAME(getTrainMethod());
  93. //
  94. // void cv::ml::LogisticRegression::setTrainMethod(int val)
  95. //
  96. /**
  97. * getTrainMethod @see `-getTrainMethod:`
  98. */
  99. - (void)setTrainMethod:(int)val NS_SWIFT_NAME(setTrainMethod(val:));
  100. //
  101. // int cv::ml::LogisticRegression::getMiniBatchSize()
  102. //
  103. /**
  104. * @see `-setMiniBatchSize:`
  105. */
  106. - (int)getMiniBatchSize NS_SWIFT_NAME(getMiniBatchSize());
  107. //
  108. // void cv::ml::LogisticRegression::setMiniBatchSize(int val)
  109. //
  110. /**
  111. * getMiniBatchSize @see `-getMiniBatchSize:`
  112. */
  113. - (void)setMiniBatchSize:(int)val NS_SWIFT_NAME(setMiniBatchSize(val:));
  114. //
  115. // TermCriteria cv::ml::LogisticRegression::getTermCriteria()
  116. //
  117. /**
  118. * @see `-setTermCriteria:`
  119. */
  120. - (TermCriteria*)getTermCriteria NS_SWIFT_NAME(getTermCriteria());
  121. //
  122. // void cv::ml::LogisticRegression::setTermCriteria(TermCriteria val)
  123. //
  124. /**
  125. * getTermCriteria @see `-getTermCriteria:`
  126. */
  127. - (void)setTermCriteria:(TermCriteria*)val NS_SWIFT_NAME(setTermCriteria(val:));
  128. //
  129. // float cv::ml::LogisticRegression::predict(Mat samples, Mat& results = Mat(), int flags = 0)
  130. //
  131. /**
  132. * Predicts responses for input samples and returns a float type.
  133. *
  134. * @param samples The input data for the prediction algorithm. Matrix [m x n], where each row
  135. * contains variables (features) of one object being classified. Should have data type CV_32F.
  136. * @param results Predicted labels as a column matrix of type CV_32S.
  137. * @param flags Not used.
  138. */
  139. - (float)predict:(Mat*)samples results:(Mat*)results flags:(int)flags NS_SWIFT_NAME(predict(samples:results:flags:));
  140. /**
  141. * Predicts responses for input samples and returns a float type.
  142. *
  143. * @param samples The input data for the prediction algorithm. Matrix [m x n], where each row
  144. * contains variables (features) of one object being classified. Should have data type CV_32F.
  145. * @param results Predicted labels as a column matrix of type CV_32S.
  146. */
  147. - (float)predict:(Mat*)samples results:(Mat*)results NS_SWIFT_NAME(predict(samples:results:));
  148. /**
  149. * Predicts responses for input samples and returns a float type.
  150. *
  151. * @param samples The input data for the prediction algorithm. Matrix [m x n], where each row
  152. * contains variables (features) of one object being classified. Should have data type CV_32F.
  153. */
  154. - (float)predict:(Mat*)samples NS_SWIFT_NAME(predict(samples:));
  155. //
  156. // Mat cv::ml::LogisticRegression::get_learnt_thetas()
  157. //
  158. /**
  159. * This function returns the trained parameters arranged across rows.
  160. *
  161. * For a two class classification problem, it returns a row matrix. It returns learnt parameters of
  162. * the Logistic Regression as a matrix of type CV_32F.
  163. */
  164. - (Mat*)get_learnt_thetas NS_SWIFT_NAME(get_learnt_thetas());
  165. //
  166. // static Ptr_LogisticRegression cv::ml::LogisticRegression::create()
  167. //
  168. /**
  169. * Creates empty model.
  170. *
  171. * Creates Logistic Regression model with parameters given.
  172. */
  173. + (LogisticRegression*)create NS_SWIFT_NAME(create());
  174. //
  175. // static Ptr_LogisticRegression cv::ml::LogisticRegression::load(String filepath, String nodeName = String())
  176. //
  177. /**
  178. * Loads and creates a serialized LogisticRegression from a file
  179. *
  180. * Use LogisticRegression::save to serialize and store an LogisticRegression to disk.
  181. * Load the LogisticRegression from this file again, by calling this function with the path to the file.
  182. * Optionally specify the node for the file containing the classifier
  183. *
  184. * @param filepath path to serialized LogisticRegression
  185. * @param nodeName name of node containing the classifier
  186. */
  187. + (LogisticRegression*)load:(NSString*)filepath nodeName:(NSString*)nodeName NS_SWIFT_NAME(load(filepath:nodeName:));
  188. /**
  189. * Loads and creates a serialized LogisticRegression from a file
  190. *
  191. * Use LogisticRegression::save to serialize and store an LogisticRegression to disk.
  192. * Load the LogisticRegression from this file again, by calling this function with the path to the file.
  193. * Optionally specify the node for the file containing the classifier
  194. *
  195. * @param filepath path to serialized LogisticRegression
  196. */
  197. + (LogisticRegression*)load:(NSString*)filepath NS_SWIFT_NAME(load(filepath:));
  198. @end
  199. NS_ASSUME_NONNULL_END