SVMSGD.h 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252
  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 MarginType (cv.ml.SVMSGD.MarginType)
  16. typedef NS_ENUM(int, MarginType) {
  17. SOFT_MARGIN = 0,
  18. HARD_MARGIN = 1
  19. };
  20. // C++: enum SvmsgdType (cv.ml.SVMSGD.SvmsgdType)
  21. typedef NS_ENUM(int, SvmsgdType) {
  22. SGD = 0,
  23. ASGD = 1
  24. };
  25. NS_ASSUME_NONNULL_BEGIN
  26. // C++: class SVMSGD
  27. /**
  28. * *************************************************************************************\
  29. * Stochastic Gradient Descent SVM Classifier *
  30. * \***************************************************************************************
  31. *
  32. * Member of `Ml`
  33. */
  34. CV_EXPORTS @interface SVMSGD : StatModel
  35. #ifdef __cplusplus
  36. @property(readonly)cv::Ptr<cv::ml::SVMSGD> nativePtrSVMSGD;
  37. #endif
  38. #ifdef __cplusplus
  39. - (instancetype)initWithNativePtr:(cv::Ptr<cv::ml::SVMSGD>)nativePtr;
  40. + (instancetype)fromNative:(cv::Ptr<cv::ml::SVMSGD>)nativePtr;
  41. #endif
  42. #pragma mark - Methods
  43. //
  44. // Mat cv::ml::SVMSGD::getWeights()
  45. //
  46. /**
  47. * @return the weights of the trained model (decision function f(x) = weights * x + shift).
  48. */
  49. - (Mat*)getWeights NS_SWIFT_NAME(getWeights());
  50. //
  51. // float cv::ml::SVMSGD::getShift()
  52. //
  53. /**
  54. * @return the shift of the trained model (decision function f(x) = weights * x + shift).
  55. */
  56. - (float)getShift NS_SWIFT_NAME(getShift());
  57. //
  58. // static Ptr_SVMSGD cv::ml::SVMSGD::create()
  59. //
  60. /**
  61. * Creates empty model.
  62. * Use StatModel::train to train the model. Since %SVMSGD has several parameters, you may want to
  63. * find the best parameters for your problem or use setOptimalParameters() to set some default parameters.
  64. */
  65. + (SVMSGD*)create NS_SWIFT_NAME(create());
  66. //
  67. // static Ptr_SVMSGD cv::ml::SVMSGD::load(String filepath, String nodeName = String())
  68. //
  69. /**
  70. * Loads and creates a serialized SVMSGD from a file
  71. *
  72. * Use SVMSGD::save to serialize and store an SVMSGD to disk.
  73. * Load the SVMSGD from this file again, by calling this function with the path to the file.
  74. * Optionally specify the node for the file containing the classifier
  75. *
  76. * @param filepath path to serialized SVMSGD
  77. * @param nodeName name of node containing the classifier
  78. */
  79. + (SVMSGD*)load:(NSString*)filepath nodeName:(NSString*)nodeName NS_SWIFT_NAME(load(filepath:nodeName:));
  80. /**
  81. * Loads and creates a serialized SVMSGD from a file
  82. *
  83. * Use SVMSGD::save to serialize and store an SVMSGD to disk.
  84. * Load the SVMSGD from this file again, by calling this function with the path to the file.
  85. * Optionally specify the node for the file containing the classifier
  86. *
  87. * @param filepath path to serialized SVMSGD
  88. */
  89. + (SVMSGD*)load:(NSString*)filepath NS_SWIFT_NAME(load(filepath:));
  90. //
  91. // void cv::ml::SVMSGD::setOptimalParameters(int svmsgdType = SVMSGD::ASGD, int marginType = SVMSGD::SOFT_MARGIN)
  92. //
  93. /**
  94. * Function sets optimal parameters values for chosen SVM SGD model.
  95. * @param svmsgdType is the type of SVMSGD classifier.
  96. * @param marginType is the type of margin constraint.
  97. */
  98. - (void)setOptimalParameters:(int)svmsgdType marginType:(int)marginType NS_SWIFT_NAME(setOptimalParameters(svmsgdType:marginType:));
  99. /**
  100. * Function sets optimal parameters values for chosen SVM SGD model.
  101. * @param svmsgdType is the type of SVMSGD classifier.
  102. */
  103. - (void)setOptimalParameters:(int)svmsgdType NS_SWIFT_NAME(setOptimalParameters(svmsgdType:));
  104. /**
  105. * Function sets optimal parameters values for chosen SVM SGD model.
  106. */
  107. - (void)setOptimalParameters NS_SWIFT_NAME(setOptimalParameters());
  108. //
  109. // int cv::ml::SVMSGD::getSvmsgdType()
  110. //
  111. /**
  112. * @see `-setSvmsgdType:`
  113. */
  114. - (int)getSvmsgdType NS_SWIFT_NAME(getSvmsgdType());
  115. //
  116. // void cv::ml::SVMSGD::setSvmsgdType(int svmsgdType)
  117. //
  118. /**
  119. * getSvmsgdType @see `-getSvmsgdType:`
  120. */
  121. - (void)setSvmsgdType:(int)svmsgdType NS_SWIFT_NAME(setSvmsgdType(svmsgdType:));
  122. //
  123. // int cv::ml::SVMSGD::getMarginType()
  124. //
  125. /**
  126. * @see `-setMarginType:`
  127. */
  128. - (int)getMarginType NS_SWIFT_NAME(getMarginType());
  129. //
  130. // void cv::ml::SVMSGD::setMarginType(int marginType)
  131. //
  132. /**
  133. * getMarginType @see `-getMarginType:`
  134. */
  135. - (void)setMarginType:(int)marginType NS_SWIFT_NAME(setMarginType(marginType:));
  136. //
  137. // float cv::ml::SVMSGD::getMarginRegularization()
  138. //
  139. /**
  140. * @see `-setMarginRegularization:`
  141. */
  142. - (float)getMarginRegularization NS_SWIFT_NAME(getMarginRegularization());
  143. //
  144. // void cv::ml::SVMSGD::setMarginRegularization(float marginRegularization)
  145. //
  146. /**
  147. * getMarginRegularization @see `-getMarginRegularization:`
  148. */
  149. - (void)setMarginRegularization:(float)marginRegularization NS_SWIFT_NAME(setMarginRegularization(marginRegularization:));
  150. //
  151. // float cv::ml::SVMSGD::getInitialStepSize()
  152. //
  153. /**
  154. * @see `-setInitialStepSize:`
  155. */
  156. - (float)getInitialStepSize NS_SWIFT_NAME(getInitialStepSize());
  157. //
  158. // void cv::ml::SVMSGD::setInitialStepSize(float InitialStepSize)
  159. //
  160. /**
  161. * getInitialStepSize @see `-getInitialStepSize:`
  162. */
  163. - (void)setInitialStepSize:(float)InitialStepSize NS_SWIFT_NAME(setInitialStepSize(InitialStepSize:));
  164. //
  165. // float cv::ml::SVMSGD::getStepDecreasingPower()
  166. //
  167. /**
  168. * @see `-setStepDecreasingPower:`
  169. */
  170. - (float)getStepDecreasingPower NS_SWIFT_NAME(getStepDecreasingPower());
  171. //
  172. // void cv::ml::SVMSGD::setStepDecreasingPower(float stepDecreasingPower)
  173. //
  174. /**
  175. * getStepDecreasingPower @see `-getStepDecreasingPower:`
  176. */
  177. - (void)setStepDecreasingPower:(float)stepDecreasingPower NS_SWIFT_NAME(setStepDecreasingPower(stepDecreasingPower:));
  178. //
  179. // TermCriteria cv::ml::SVMSGD::getTermCriteria()
  180. //
  181. /**
  182. * @see `-setTermCriteria:`
  183. */
  184. - (TermCriteria*)getTermCriteria NS_SWIFT_NAME(getTermCriteria());
  185. //
  186. // void cv::ml::SVMSGD::setTermCriteria(TermCriteria val)
  187. //
  188. /**
  189. * getTermCriteria @see `-getTermCriteria:`
  190. */
  191. - (void)setTermCriteria:(TermCriteria*)val NS_SWIFT_NAME(setTermCriteria(val:));
  192. @end
  193. NS_ASSUME_NONNULL_END