public class LogisticRegression extends StatModel
Modifier and Type | Field and Description |
---|---|
static int |
BATCH |
static int |
MINI_BATCH |
static int |
REG_DISABLE |
static int |
REG_L1 |
static int |
REG_L2 |
COMPRESSED_INPUT, PREPROCESSED_INPUT, RAW_OUTPUT, UPDATE_MODEL
Modifier | Constructor and Description |
---|---|
protected |
LogisticRegression(long addr) |
Modifier and Type | Method and Description |
---|---|
static LogisticRegression |
__fromPtr__(long addr) |
static LogisticRegression |
create()
Creates empty model.
|
protected void |
finalize() |
Mat |
get_learnt_thetas()
This function returns the trained parameters arranged across rows.
|
int |
getIterations()
SEE: setIterations
|
double |
getLearningRate()
SEE: setLearningRate
|
int |
getMiniBatchSize()
SEE: setMiniBatchSize
|
int |
getRegularization()
SEE: setRegularization
|
TermCriteria |
getTermCriteria()
SEE: setTermCriteria
|
int |
getTrainMethod()
SEE: setTrainMethod
|
static LogisticRegression |
load(String filepath)
Loads and creates a serialized LogisticRegression from a file
Use LogisticRegression::save to serialize and store an LogisticRegression to disk.
|
static LogisticRegression |
load(String filepath,
String nodeName)
Loads and creates a serialized LogisticRegression from a file
Use LogisticRegression::save to serialize and store an LogisticRegression to disk.
|
float |
predict(Mat samples)
Predicts responses for input samples and returns a float type.
|
float |
predict(Mat samples,
Mat results)
Predicts responses for input samples and returns a float type.
|
float |
predict(Mat samples,
Mat results,
int flags)
Predicts responses for input samples and returns a float type.
|
void |
setIterations(int val)
getIterations SEE: getIterations
|
void |
setLearningRate(double val)
getLearningRate SEE: getLearningRate
|
void |
setMiniBatchSize(int val)
getMiniBatchSize SEE: getMiniBatchSize
|
void |
setRegularization(int val)
getRegularization SEE: getRegularization
|
void |
setTermCriteria(TermCriteria val)
getTermCriteria SEE: getTermCriteria
|
void |
setTrainMethod(int val)
getTrainMethod SEE: getTrainMethod
|
calcError, empty, getVarCount, isClassifier, isTrained, train, train, train
clear, getDefaultName, getNativeObjAddr, save
public static final int REG_DISABLE
public static final int REG_L1
public static final int REG_L2
public static final int BATCH
public static final int MINI_BATCH
public static LogisticRegression __fromPtr__(long addr)
public Mat get_learnt_thetas()
public static LogisticRegression create()
public static LogisticRegression load(String filepath, String nodeName)
filepath
- path to serialized LogisticRegressionnodeName
- name of node containing the classifierpublic static LogisticRegression load(String filepath)
filepath
- path to serialized LogisticRegressionpublic TermCriteria getTermCriteria()
public double getLearningRate()
public float predict(Mat samples, Mat results, int flags)
predict
in class StatModel
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.public float predict(Mat samples, Mat results)
predict
in class StatModel
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.public float predict(Mat samples)
public int getIterations()
public int getMiniBatchSize()
public int getRegularization()
public int getTrainMethod()
public void setIterations(int val)
val
- automatically generatedpublic void setLearningRate(double val)
val
- automatically generatedpublic void setMiniBatchSize(int val)
val
- automatically generatedpublic void setRegularization(int val)
val
- automatically generatedpublic void setTermCriteria(TermCriteria val)
val
- automatically generatedpublic void setTrainMethod(int val)
val
- automatically generatedCopyright © 2020. All rights reserved.