OpenCV 2.4.8

org.opencv.ml
Class CvStatModel

java.lang.Object
  extended by org.opencv.ml.CvStatModel
Direct Known Subclasses:
CvANN_MLP, CvBoost, CvDTree, CvGBTrees, CvKNearest, CvNormalBayesClassifier, CvRTrees, CvSVM

public class CvStatModel
extends java.lang.Object

Base class for statistical models in ML.

class CvStatModel

// C++ code:

public:

/ * CvStatModel(); * /

/ * CvStatModel(const Mat& train_data...); * /

virtual ~CvStatModel();

virtual void clear()=0;

/ * virtual bool train(const Mat& train_data, [int tflag,]..., const

Mat& responses,...,

[const Mat& var_idx,]..., [const Mat& sample_idx,]...

[const Mat& var_type,]..., [const Mat& missing_mask,]

...)=0;

/ * virtual float predict(const Mat& sample...) const=0; * /

virtual void save(const char* filename, const char* name=0)=0;

virtual void load(const char* filename, const char* name=0)=0;

virtual void write(CvFileStorage* storage, const char* name)=0;

virtual void read(CvFileStorage* storage, CvFileNode* node)=0;

};

In this declaration, some methods are commented off. These are methods for which there is no unified API (with the exception of the default constructor). However, there are many similarities in the syntax and semantics that are briefly described below in this section, as if they are part of the base class.

See Also:
org.opencv.ml.CvStatModel

Method Summary
 void load(java.lang.String filename)
          Loads the model from a file.
 void load(java.lang.String filename, java.lang.String name)
          Loads the model from a file.
 void save(java.lang.String filename)
          Saves the model to a file.
 void save(java.lang.String filename, java.lang.String name)
          Saves the model to a file.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

load

public void load(java.lang.String filename)

Loads the model from a file.

The method load loads the complete model state with the specified name (or default model-dependent name) from the specified XML or YAML file. The previous model state is cleared by "CvStatModel.clear".

Parameters:
filename - a filename
See Also:
org.opencv.ml.CvStatModel.load

load

public void load(java.lang.String filename,
                 java.lang.String name)

Loads the model from a file.

The method load loads the complete model state with the specified name (or default model-dependent name) from the specified XML or YAML file. The previous model state is cleared by "CvStatModel.clear".

Parameters:
filename - a filename
name - a name
See Also:
org.opencv.ml.CvStatModel.load

save

public void save(java.lang.String filename)

Saves the model to a file.

The method save saves the complete model state to the specified XML or YAML file with the specified name or default name (which depends on a particular class). *Data persistence* functionality from CxCore is used.

Parameters:
filename - a filename
See Also:
org.opencv.ml.CvStatModel.save

save

public void save(java.lang.String filename,
                 java.lang.String name)

Saves the model to a file.

The method save saves the complete model state to the specified XML or YAML file with the specified name or default name (which depends on a particular class). *Data persistence* functionality from CxCore is used.

Parameters:
filename - a filename
name - a name
See Also:
org.opencv.ml.CvStatModel.save

OpenCV 2.4.8 Documentation