RTrees.h 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  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 "DTrees.h"
  13. @class Mat;
  14. @class TermCriteria;
  15. NS_ASSUME_NONNULL_BEGIN
  16. // C++: class RTrees
  17. /**
  18. * The class implements the random forest predictor.
  19. *
  20. * @see REF: ml_intro_rtrees
  21. *
  22. * Member of `Ml`
  23. */
  24. CV_EXPORTS @interface RTrees : DTrees
  25. #ifdef __cplusplus
  26. @property(readonly)cv::Ptr<cv::ml::RTrees> nativePtrRTrees;
  27. #endif
  28. #ifdef __cplusplus
  29. - (instancetype)initWithNativePtr:(cv::Ptr<cv::ml::RTrees>)nativePtr;
  30. + (instancetype)fromNative:(cv::Ptr<cv::ml::RTrees>)nativePtr;
  31. #endif
  32. #pragma mark - Methods
  33. //
  34. // bool cv::ml::RTrees::getCalculateVarImportance()
  35. //
  36. /**
  37. * @see `-setCalculateVarImportance:`
  38. */
  39. - (BOOL)getCalculateVarImportance NS_SWIFT_NAME(getCalculateVarImportance());
  40. //
  41. // void cv::ml::RTrees::setCalculateVarImportance(bool val)
  42. //
  43. /**
  44. * getCalculateVarImportance @see `-getCalculateVarImportance:`
  45. */
  46. - (void)setCalculateVarImportance:(BOOL)val NS_SWIFT_NAME(setCalculateVarImportance(val:));
  47. //
  48. // int cv::ml::RTrees::getActiveVarCount()
  49. //
  50. /**
  51. * @see `-setActiveVarCount:`
  52. */
  53. - (int)getActiveVarCount NS_SWIFT_NAME(getActiveVarCount());
  54. //
  55. // void cv::ml::RTrees::setActiveVarCount(int val)
  56. //
  57. /**
  58. * getActiveVarCount @see `-getActiveVarCount:`
  59. */
  60. - (void)setActiveVarCount:(int)val NS_SWIFT_NAME(setActiveVarCount(val:));
  61. //
  62. // TermCriteria cv::ml::RTrees::getTermCriteria()
  63. //
  64. /**
  65. * @see `-setTermCriteria:`
  66. */
  67. - (TermCriteria*)getTermCriteria NS_SWIFT_NAME(getTermCriteria());
  68. //
  69. // void cv::ml::RTrees::setTermCriteria(TermCriteria val)
  70. //
  71. /**
  72. * getTermCriteria @see `-getTermCriteria:`
  73. */
  74. - (void)setTermCriteria:(TermCriteria*)val NS_SWIFT_NAME(setTermCriteria(val:));
  75. //
  76. // Mat cv::ml::RTrees::getVarImportance()
  77. //
  78. /**
  79. * Returns the variable importance array.
  80. * The method returns the variable importance vector, computed at the training stage when
  81. * CalculateVarImportance is set to true. If this flag was set to false, the empty matrix is
  82. * returned.
  83. */
  84. - (Mat*)getVarImportance NS_SWIFT_NAME(getVarImportance());
  85. //
  86. // void cv::ml::RTrees::getVotes(Mat samples, Mat& results, int flags)
  87. //
  88. /**
  89. * Returns the result of each individual tree in the forest.
  90. * In case the model is a regression problem, the method will return each of the trees'
  91. * results for each of the sample cases. If the model is a classifier, it will return
  92. * a Mat with samples + 1 rows, where the first row gives the class number and the
  93. * following rows return the votes each class had for each sample.
  94. * @param samples Array containing the samples for which votes will be calculated.
  95. * @param results Array where the result of the calculation will be written.
  96. * @param flags Flags for defining the type of RTrees.
  97. */
  98. - (void)getVotes:(Mat*)samples results:(Mat*)results flags:(int)flags NS_SWIFT_NAME(getVotes(samples:results:flags:));
  99. //
  100. // double cv::ml::RTrees::getOOBError()
  101. //
  102. /**
  103. * Returns the OOB error value, computed at the training stage when calcOOBError is set to true.
  104. * If this flag was set to false, 0 is returned. The OOB error is also scaled by sample weighting.
  105. */
  106. - (double)getOOBError NS_SWIFT_NAME(getOOBError());
  107. //
  108. // static Ptr_RTrees cv::ml::RTrees::create()
  109. //
  110. /**
  111. * Creates the empty model.
  112. * Use StatModel::train to train the model, StatModel::train to create and train the model,
  113. * Algorithm::load to load the pre-trained model.
  114. */
  115. + (RTrees*)create NS_SWIFT_NAME(create());
  116. //
  117. // static Ptr_RTrees cv::ml::RTrees::load(String filepath, String nodeName = String())
  118. //
  119. /**
  120. * Loads and creates a serialized RTree from a file
  121. *
  122. * Use RTree::save to serialize and store an RTree to disk.
  123. * Load the RTree from this file again, by calling this function with the path to the file.
  124. * Optionally specify the node for the file containing the classifier
  125. *
  126. * @param filepath path to serialized RTree
  127. * @param nodeName name of node containing the classifier
  128. */
  129. + (RTrees*)load:(NSString*)filepath nodeName:(NSString*)nodeName NS_SWIFT_NAME(load(filepath:nodeName:));
  130. /**
  131. * Loads and creates a serialized RTree from a file
  132. *
  133. * Use RTree::save to serialize and store an RTree to disk.
  134. * Load the RTree from this file again, by calling this function with the path to the file.
  135. * Optionally specify the node for the file containing the classifier
  136. *
  137. * @param filepath path to serialized RTree
  138. */
  139. + (RTrees*)load:(NSString*)filepath NS_SWIFT_NAME(load(filepath:));
  140. @end
  141. NS_ASSUME_NONNULL_END