OpenCV for Unity
2.6.3
Enox Software / Please refer to OpenCV official document ( http://docs.opencv.org/4.10.0/index.html ) for the details of the argument of the method.
|
Implements Logistic Regression classifier. More...
Public Member Functions | |
double | getLearningRate () |
void | setLearningRate (double val) |
int | getIterations () |
void | setIterations (int val) |
int | getRegularization () |
void | setRegularization (int val) |
int | getTrainMethod () |
void | setTrainMethod (int val) |
int | getMiniBatchSize () |
void | setMiniBatchSize (int val) |
TermCriteria | getTermCriteria () |
void | setTermCriteria (TermCriteria val) |
override float | predict (Mat samples, Mat results, int flags) |
Predicts responses for input samples and returns a float type. More... | |
override float | predict (Mat samples, Mat results) |
Predicts responses for input samples and returns a float type. More... | |
override float | predict (Mat samples) |
Predicts responses for input samples and returns a float type. More... | |
Mat | get_learnt_thetas () |
This function returns the trained parameters arranged across rows. More... | |
Public Member Functions inherited from OpenCVForUnity.MlModule.StatModel | |
int | getVarCount () |
Returns the number of variables in training samples. More... | |
override bool | empty () |
Returns true if the Algorithm is empty (e.g. in the very beginning or after unsuccessful read. More... | |
bool | isTrained () |
Returns true if the model is trained. More... | |
bool | isClassifier () |
Returns true if the model is classifier. More... | |
bool | train (TrainData trainData, int flags) |
Trains the statistical model. More... | |
bool | train (TrainData trainData) |
Trains the statistical model. More... | |
bool | train (Mat samples, int layout, Mat responses) |
Trains the statistical model. More... | |
float | calcError (TrainData data, bool test, Mat resp) |
Computes error on the training or test dataset. More... | |
Public Member Functions inherited from OpenCVForUnity.CoreModule.Algorithm | |
IntPtr | getNativeObjAddr () |
virtual void | clear () |
Clears the algorithm state. More... | |
void | save (string filename) |
virtual string | getDefaultName () |
Public Member Functions inherited from OpenCVForUnity.DisposableObject | |
void | Dispose () |
void | ThrowIfDisposed () |
Static Public Member Functions | |
static new LogisticRegression | __fromPtr__ (IntPtr addr) |
static LogisticRegression | create () |
Creates empty model. More... | |
static LogisticRegression | load (string filepath, string nodeName) |
Loads and creates a serialized LogisticRegression from a file. More... | |
static LogisticRegression | load (string filepath) |
Loads and creates a serialized LogisticRegression from a file. More... | |
Static Public Member Functions inherited from OpenCVForUnity.MlModule.StatModel | |
static new StatModel | __fromPtr__ (IntPtr addr) |
Static Public Member Functions inherited from OpenCVForUnity.CoreModule.Algorithm | |
static Algorithm | __fromPtr__ (IntPtr addr) |
Static Public Member Functions inherited from OpenCVForUnity.DisposableObject | |
static IntPtr | ThrowIfNullIntPtr (IntPtr ptr) |
Public Attributes | |
const int | BATCH = 0 |
const int | MINI_BATCH = 1 |
const int | REG_DISABLE = -1 |
const int | REG_L1 = 0 |
const int | REG_L2 = 1 |
Public Attributes inherited from OpenCVForUnity.MlModule.StatModel | |
const int | UPDATE_MODEL = 1 |
const int | RAW_OUTPUT = 1 |
const int | COMPRESSED_INPUT = 2 |
const int | PREPROCESSED_INPUT = 4 |
Protected Member Functions | |
override void | Dispose (bool disposing) |
Protected Member Functions inherited from OpenCVForUnity.MlModule.StatModel | |
override void | Dispose (bool disposing) |
Protected Member Functions inherited from OpenCVForUnity.DisposableOpenCVObject | |
DisposableOpenCVObject () | |
DisposableOpenCVObject (IntPtr ptr) | |
DisposableOpenCVObject (bool isEnabledDispose) | |
DisposableOpenCVObject (IntPtr ptr, bool isEnabledDispose) | |
Protected Member Functions inherited from OpenCVForUnity.DisposableObject | |
DisposableObject () | |
DisposableObject (bool isEnabledDispose) | |
Additional Inherited Members | |
Properties inherited from OpenCVForUnity.DisposableObject | |
bool | IsDisposed [get, protected set] |
bool | IsEnabledDispose [get, set] |
Implements Logistic Regression classifier.
|
static |
|
static |
Creates empty model.
Creates Logistic Regression model with parameters given.
|
protectedvirtual |
Reimplemented from OpenCVForUnity.CoreModule.Algorithm.
Mat OpenCVForUnity.MlModule.LogisticRegression.get_learnt_thetas | ( | ) |
This function returns the trained parameters arranged across rows.
For a two class classification problem, it returns a row matrix. It returns learnt parameters of the Logistic Regression as a matrix of type CV_32F.
int OpenCVForUnity.MlModule.LogisticRegression.getIterations | ( | ) |
double OpenCVForUnity.MlModule.LogisticRegression.getLearningRate | ( | ) |
int OpenCVForUnity.MlModule.LogisticRegression.getMiniBatchSize | ( | ) |
int OpenCVForUnity.MlModule.LogisticRegression.getRegularization | ( | ) |
TermCriteria OpenCVForUnity.MlModule.LogisticRegression.getTermCriteria | ( | ) |
int OpenCVForUnity.MlModule.LogisticRegression.getTrainMethod | ( | ) |
|
static |
Loads and creates a serialized LogisticRegression from a file.
Use LogisticRegression::save to serialize and store an LogisticRegression to disk. Load the LogisticRegression from this file again, by calling this function with the path to the file. Optionally specify the node for the file containing the classifier
filepath | path to serialized LogisticRegression |
nodeName | name of node containing the classifier |
|
static |
Loads and creates a serialized LogisticRegression from a file.
Use LogisticRegression::save to serialize and store an LogisticRegression to disk. Load the LogisticRegression from this file again, by calling this function with the path to the file. Optionally specify the node for the file containing the classifier
filepath | path to serialized LogisticRegression |
nodeName | name of node containing the classifier |
|
virtual |
Predicts responses for input samples and returns a float type.
samples | The input data for the prediction algorithm. Matrix [m x n], where each row contains variables (features) of one object being classified. Should have data type CV_32F. |
results | Predicted labels as a column matrix of type CV_32S. |
flags | Not used. |
Reimplemented from OpenCVForUnity.MlModule.StatModel.
|
virtual |
Predicts responses for input samples and returns a float type.
samples | The input data for the prediction algorithm. Matrix [m x n], where each row contains variables (features) of one object being classified. Should have data type CV_32F. |
results | Predicted labels as a column matrix of type CV_32S. |
flags | Not used. |
Reimplemented from OpenCVForUnity.MlModule.StatModel.
|
virtual |
Predicts responses for input samples and returns a float type.
samples | The input data for the prediction algorithm. Matrix [m x n], where each row contains variables (features) of one object being classified. Should have data type CV_32F. |
results | Predicted labels as a column matrix of type CV_32S. |
flags | Not used. |
Reimplemented from OpenCVForUnity.MlModule.StatModel.
void OpenCVForUnity.MlModule.LogisticRegression.setIterations | ( | int | val | ) |
void OpenCVForUnity.MlModule.LogisticRegression.setLearningRate | ( | double | val | ) |
void OpenCVForUnity.MlModule.LogisticRegression.setMiniBatchSize | ( | int | val | ) |
void OpenCVForUnity.MlModule.LogisticRegression.setRegularization | ( | int | val | ) |
void OpenCVForUnity.MlModule.LogisticRegression.setTermCriteria | ( | TermCriteria | val | ) |
void OpenCVForUnity.MlModule.LogisticRegression.setTrainMethod | ( | int | val | ) |
const int OpenCVForUnity.MlModule.LogisticRegression.BATCH = 0 |
const int OpenCVForUnity.MlModule.LogisticRegression.MINI_BATCH = 1 |
const int OpenCVForUnity.MlModule.LogisticRegression.REG_DISABLE = -1 |
const int OpenCVForUnity.MlModule.LogisticRegression.REG_L1 = 0 |
const int OpenCVForUnity.MlModule.LogisticRegression.REG_L2 = 1 |