001//
002// This file is auto-generated. Please don't modify it!
003//
004package org.opencv.ml;
005
006import org.opencv.core.Mat;
007import org.opencv.ml.DTrees;
008import org.opencv.ml.StatModel;
009
010// C++: class DTrees
011/**
012 * The class represents a single decision tree or a collection of decision trees.
013 *
014 * The current public interface of the class allows user to train only a single decision tree, however
015 * the class is capable of storing multiple decision trees and using them for prediction (by summing
016 * responses or using a voting schemes), and the derived from DTrees classes (such as RTrees and Boost)
017 * use this capability to implement decision tree ensembles.
018 *
019 * SEE: REF: ml_intro_trees
020 */
021public class DTrees extends StatModel {
022
023    protected DTrees(long addr) { super(addr); }
024
025    // internal usage only
026    public static DTrees __fromPtr__(long addr) { return new DTrees(addr); }
027
028    // C++: enum Flags (cv.ml.DTrees.Flags)
029    public static final int
030            PREDICT_AUTO = 0,
031            PREDICT_SUM = (1<<8),
032            PREDICT_MAX_VOTE = (2<<8),
033            PREDICT_MASK = (3<<8);
034
035
036    //
037    // C++:  int cv::ml::DTrees::getMaxCategories()
038    //
039
040    /**
041     * SEE: setMaxCategories
042     * @return automatically generated
043     */
044    public int getMaxCategories() {
045        return getMaxCategories_0(nativeObj);
046    }
047
048
049    //
050    // C++:  void cv::ml::DTrees::setMaxCategories(int val)
051    //
052
053    /**
054     *  getMaxCategories SEE: getMaxCategories
055     * @param val automatically generated
056     */
057    public void setMaxCategories(int val) {
058        setMaxCategories_0(nativeObj, val);
059    }
060
061
062    //
063    // C++:  int cv::ml::DTrees::getMaxDepth()
064    //
065
066    /**
067     * SEE: setMaxDepth
068     * @return automatically generated
069     */
070    public int getMaxDepth() {
071        return getMaxDepth_0(nativeObj);
072    }
073
074
075    //
076    // C++:  void cv::ml::DTrees::setMaxDepth(int val)
077    //
078
079    /**
080     *  getMaxDepth SEE: getMaxDepth
081     * @param val automatically generated
082     */
083    public void setMaxDepth(int val) {
084        setMaxDepth_0(nativeObj, val);
085    }
086
087
088    //
089    // C++:  int cv::ml::DTrees::getMinSampleCount()
090    //
091
092    /**
093     * SEE: setMinSampleCount
094     * @return automatically generated
095     */
096    public int getMinSampleCount() {
097        return getMinSampleCount_0(nativeObj);
098    }
099
100
101    //
102    // C++:  void cv::ml::DTrees::setMinSampleCount(int val)
103    //
104
105    /**
106     *  getMinSampleCount SEE: getMinSampleCount
107     * @param val automatically generated
108     */
109    public void setMinSampleCount(int val) {
110        setMinSampleCount_0(nativeObj, val);
111    }
112
113
114    //
115    // C++:  int cv::ml::DTrees::getCVFolds()
116    //
117
118    /**
119     * SEE: setCVFolds
120     * @return automatically generated
121     */
122    public int getCVFolds() {
123        return getCVFolds_0(nativeObj);
124    }
125
126
127    //
128    // C++:  void cv::ml::DTrees::setCVFolds(int val)
129    //
130
131    /**
132     *  getCVFolds SEE: getCVFolds
133     * @param val automatically generated
134     */
135    public void setCVFolds(int val) {
136        setCVFolds_0(nativeObj, val);
137    }
138
139
140    //
141    // C++:  bool cv::ml::DTrees::getUseSurrogates()
142    //
143
144    /**
145     * SEE: setUseSurrogates
146     * @return automatically generated
147     */
148    public boolean getUseSurrogates() {
149        return getUseSurrogates_0(nativeObj);
150    }
151
152
153    //
154    // C++:  void cv::ml::DTrees::setUseSurrogates(bool val)
155    //
156
157    /**
158     *  getUseSurrogates SEE: getUseSurrogates
159     * @param val automatically generated
160     */
161    public void setUseSurrogates(boolean val) {
162        setUseSurrogates_0(nativeObj, val);
163    }
164
165
166    //
167    // C++:  bool cv::ml::DTrees::getUse1SERule()
168    //
169
170    /**
171     * SEE: setUse1SERule
172     * @return automatically generated
173     */
174    public boolean getUse1SERule() {
175        return getUse1SERule_0(nativeObj);
176    }
177
178
179    //
180    // C++:  void cv::ml::DTrees::setUse1SERule(bool val)
181    //
182
183    /**
184     *  getUse1SERule SEE: getUse1SERule
185     * @param val automatically generated
186     */
187    public void setUse1SERule(boolean val) {
188        setUse1SERule_0(nativeObj, val);
189    }
190
191
192    //
193    // C++:  bool cv::ml::DTrees::getTruncatePrunedTree()
194    //
195
196    /**
197     * SEE: setTruncatePrunedTree
198     * @return automatically generated
199     */
200    public boolean getTruncatePrunedTree() {
201        return getTruncatePrunedTree_0(nativeObj);
202    }
203
204
205    //
206    // C++:  void cv::ml::DTrees::setTruncatePrunedTree(bool val)
207    //
208
209    /**
210     *  getTruncatePrunedTree SEE: getTruncatePrunedTree
211     * @param val automatically generated
212     */
213    public void setTruncatePrunedTree(boolean val) {
214        setTruncatePrunedTree_0(nativeObj, val);
215    }
216
217
218    //
219    // C++:  float cv::ml::DTrees::getRegressionAccuracy()
220    //
221
222    /**
223     * SEE: setRegressionAccuracy
224     * @return automatically generated
225     */
226    public float getRegressionAccuracy() {
227        return getRegressionAccuracy_0(nativeObj);
228    }
229
230
231    //
232    // C++:  void cv::ml::DTrees::setRegressionAccuracy(float val)
233    //
234
235    /**
236     *  getRegressionAccuracy SEE: getRegressionAccuracy
237     * @param val automatically generated
238     */
239    public void setRegressionAccuracy(float val) {
240        setRegressionAccuracy_0(nativeObj, val);
241    }
242
243
244    //
245    // C++:  Mat cv::ml::DTrees::getPriors()
246    //
247
248    /**
249     * SEE: setPriors
250     * @return automatically generated
251     */
252    public Mat getPriors() {
253        return new Mat(getPriors_0(nativeObj));
254    }
255
256
257    //
258    // C++:  void cv::ml::DTrees::setPriors(Mat val)
259    //
260
261    /**
262     *  getPriors SEE: getPriors
263     * @param val automatically generated
264     */
265    public void setPriors(Mat val) {
266        setPriors_0(nativeObj, val.nativeObj);
267    }
268
269
270    //
271    // C++: static Ptr_DTrees cv::ml::DTrees::create()
272    //
273
274    /**
275     * Creates the empty model
276     *
277     *     The static method creates empty decision tree with the specified parameters. It should be then
278     *     trained using train method (see StatModel::train). Alternatively, you can load the model from
279     *     file using Algorithm::load&lt;DTrees&gt;(filename).
280     * @return automatically generated
281     */
282    public static DTrees create() {
283        return DTrees.__fromPtr__(create_0());
284    }
285
286
287    //
288    // C++: static Ptr_DTrees cv::ml::DTrees::load(String filepath, String nodeName = String())
289    //
290
291    /**
292     * Loads and creates a serialized DTrees from a file
293     *
294     * Use DTree::save to serialize and store an DTree to disk.
295     * Load the DTree from this file again, by calling this function with the path to the file.
296     * Optionally specify the node for the file containing the classifier
297     *
298     * @param filepath path to serialized DTree
299     * @param nodeName name of node containing the classifier
300     * @return automatically generated
301     */
302    public static DTrees load(String filepath, String nodeName) {
303        return DTrees.__fromPtr__(load_0(filepath, nodeName));
304    }
305
306    /**
307     * Loads and creates a serialized DTrees from a file
308     *
309     * Use DTree::save to serialize and store an DTree to disk.
310     * Load the DTree from this file again, by calling this function with the path to the file.
311     * Optionally specify the node for the file containing the classifier
312     *
313     * @param filepath path to serialized DTree
314     * @return automatically generated
315     */
316    public static DTrees load(String filepath) {
317        return DTrees.__fromPtr__(load_1(filepath));
318    }
319
320
321    @Override
322    protected void finalize() throws Throwable {
323        delete(nativeObj);
324    }
325
326
327
328    // C++:  int cv::ml::DTrees::getMaxCategories()
329    private static native int getMaxCategories_0(long nativeObj);
330
331    // C++:  void cv::ml::DTrees::setMaxCategories(int val)
332    private static native void setMaxCategories_0(long nativeObj, int val);
333
334    // C++:  int cv::ml::DTrees::getMaxDepth()
335    private static native int getMaxDepth_0(long nativeObj);
336
337    // C++:  void cv::ml::DTrees::setMaxDepth(int val)
338    private static native void setMaxDepth_0(long nativeObj, int val);
339
340    // C++:  int cv::ml::DTrees::getMinSampleCount()
341    private static native int getMinSampleCount_0(long nativeObj);
342
343    // C++:  void cv::ml::DTrees::setMinSampleCount(int val)
344    private static native void setMinSampleCount_0(long nativeObj, int val);
345
346    // C++:  int cv::ml::DTrees::getCVFolds()
347    private static native int getCVFolds_0(long nativeObj);
348
349    // C++:  void cv::ml::DTrees::setCVFolds(int val)
350    private static native void setCVFolds_0(long nativeObj, int val);
351
352    // C++:  bool cv::ml::DTrees::getUseSurrogates()
353    private static native boolean getUseSurrogates_0(long nativeObj);
354
355    // C++:  void cv::ml::DTrees::setUseSurrogates(bool val)
356    private static native void setUseSurrogates_0(long nativeObj, boolean val);
357
358    // C++:  bool cv::ml::DTrees::getUse1SERule()
359    private static native boolean getUse1SERule_0(long nativeObj);
360
361    // C++:  void cv::ml::DTrees::setUse1SERule(bool val)
362    private static native void setUse1SERule_0(long nativeObj, boolean val);
363
364    // C++:  bool cv::ml::DTrees::getTruncatePrunedTree()
365    private static native boolean getTruncatePrunedTree_0(long nativeObj);
366
367    // C++:  void cv::ml::DTrees::setTruncatePrunedTree(bool val)
368    private static native void setTruncatePrunedTree_0(long nativeObj, boolean val);
369
370    // C++:  float cv::ml::DTrees::getRegressionAccuracy()
371    private static native float getRegressionAccuracy_0(long nativeObj);
372
373    // C++:  void cv::ml::DTrees::setRegressionAccuracy(float val)
374    private static native void setRegressionAccuracy_0(long nativeObj, float val);
375
376    // C++:  Mat cv::ml::DTrees::getPriors()
377    private static native long getPriors_0(long nativeObj);
378
379    // C++:  void cv::ml::DTrees::setPriors(Mat val)
380    private static native void setPriors_0(long nativeObj, long val_nativeObj);
381
382    // C++: static Ptr_DTrees cv::ml::DTrees::create()
383    private static native long create_0();
384
385    // C++: static Ptr_DTrees cv::ml::DTrees::load(String filepath, String nodeName = String())
386    private static native long load_0(String filepath, String nodeName);
387    private static native long load_1(String filepath);
388
389    // native support for java finalize()
390    private static native void delete(long nativeObj);
391
392}