@Namespace(value="cv::ml") public static class opencv_ml.LogisticRegression extends opencv_ml.StatModel
\sa \ref ml_intro_lr
| Modifier and Type | Field and Description |
|---|---|
static int |
BATCH
enum cv::ml::LogisticRegression::Methods
|
static int |
MINI_BATCH
enum cv::ml::LogisticRegression::Methods
|
static int |
REG_DISABLE
enum cv::ml::LogisticRegression::RegKinds
|
static int |
REG_L1
enum cv::ml::LogisticRegression::RegKinds
|
static int |
REG_L2
enum cv::ml::LogisticRegression::RegKinds
|
COMPRESSED_INPUT, PREPROCESSED_INPUT, RAW_OUTPUT, UPDATE_MODEL| Constructor and Description |
|---|
LogisticRegression(org.bytedeco.javacpp.Pointer p)
Pointer cast constructor.
|
| Modifier and Type | Method and Description |
|---|---|
static opencv_ml.LogisticRegression |
create()
\brief Creates empty model.
|
opencv_core.Mat |
get_learnt_thetas()
\brief This function returns the trained parameters arranged across rows.
|
int |
getIterations() |
double |
getLearningRate() |
int |
getMiniBatchSize() |
int |
getRegularization() |
opencv_core.TermCriteria |
getTermCriteria() |
int |
getTrainMethod() |
static opencv_ml.LogisticRegression |
load(org.bytedeco.javacpp.BytePointer filepath) |
static opencv_ml.LogisticRegression |
load(org.bytedeco.javacpp.BytePointer filepath,
org.bytedeco.javacpp.BytePointer nodeName)
\brief Loads and creates a serialized LogisticRegression from a file
Use LogisticRegression::save to serialize and store an LogisticRegression to disk.
|
static opencv_ml.LogisticRegression |
load(String filepath) |
static opencv_ml.LogisticRegression |
load(String filepath,
String nodeName) |
float |
predict(opencv_core.GpuMat samples) |
float |
predict(opencv_core.GpuMat samples,
opencv_core.GpuMat results,
int flags) |
float |
predict(opencv_core.Mat samples) |
float |
predict(opencv_core.Mat samples,
opencv_core.Mat results,
int flags)
\brief Predicts responses for input samples and returns a float type.
|
float |
predict(opencv_core.UMat samples) |
float |
predict(opencv_core.UMat samples,
opencv_core.UMat results,
int flags) |
void |
setIterations(int val)
\copybrief getIterations @see getIterations
|
void |
setLearningRate(double val)
\copybrief getLearningRate @see getLearningRate
|
void |
setMiniBatchSize(int val)
\copybrief getMiniBatchSize @see getMiniBatchSize
|
void |
setRegularization(int val)
\copybrief getRegularization @see getRegularization
|
void |
setTermCriteria(opencv_core.TermCriteria val)
\copybrief getTermCriteria @see getTermCriteria
|
void |
setTrainMethod(int val)
\copybrief getTrainMethod @see getTrainMethod
|
calcError, calcError, calcError, empty, getVarCount, isClassifier, isTrained, train, train, train, train, trainloadANN_MLP, loadANN_MLP, loadBoost, loadBoost, loadDTrees, loadDTrees, loadEM, loadEM, loadKNearest, loadKNearest, loadLogisticRegression, loadLogisticRegression, loadNormalBayesClassifier, loadNormalBayesClassifier, loadRTrees, loadRTrees, loadSVM, loadSVMclear, getDefaultName, position, read, save, save, write, write, writeaddress, asBuffer, asByteBuffer, availablePhysicalBytes, calloc, capacity, capacity, close, deallocate, deallocate, deallocateReferences, deallocator, deallocator, equals, fill, formatBytes, free, hashCode, isNull, limit, limit, malloc, maxBytes, maxPhysicalBytes, memchr, memcmp, memcpy, memmove, memset, offsetof, parseBytes, physicalBytes, position, put, realloc, setNull, sizeof, toString, totalBytes, totalPhysicalBytes, withDeallocator, zeropublic 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 LogisticRegression(org.bytedeco.javacpp.Pointer p)
Pointer.Pointer(Pointer).public double getLearningRate()
setLearningRatepublic void setLearningRate(double val)
public int getIterations()
setIterationspublic void setIterations(int val)
public int getRegularization()
setRegularizationpublic void setRegularization(int val)
public int getTrainMethod()
setTrainMethodpublic void setTrainMethod(int val)
public int getMiniBatchSize()
setMiniBatchSizepublic void setMiniBatchSize(int val)
@ByVal public opencv_core.TermCriteria getTermCriteria()
setTermCriteriapublic void setTermCriteria(@ByVal
opencv_core.TermCriteria val)
public float predict(@ByVal
opencv_core.Mat samples,
@ByVal(nullValue="cv::OutputArray(cv::noArray())")
opencv_core.Mat results,
int flags)
predict in class opencv_ml.StatModelsamples - 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(@ByVal
opencv_core.Mat samples)
predict in class opencv_ml.StatModelpublic float predict(@ByVal
opencv_core.UMat samples,
@ByVal(nullValue="cv::OutputArray(cv::noArray())")
opencv_core.UMat results,
int flags)
predict in class opencv_ml.StatModelpublic float predict(@ByVal
opencv_core.UMat samples)
predict in class opencv_ml.StatModelpublic float predict(@ByVal
opencv_core.GpuMat samples,
@ByVal(nullValue="cv::OutputArray(cv::noArray())")
opencv_core.GpuMat results,
int flags)
predict in class opencv_ml.StatModelpublic float predict(@ByVal
opencv_core.GpuMat samples)
predict in class opencv_ml.StatModel@ByVal public opencv_core.Mat get_learnt_thetas()
For a two class classifcation problem, it returns a row matrix. It returns learnt parameters of the Logistic Regression as a matrix of type CV_32F.
@opencv_core.Ptr public static opencv_ml.LogisticRegression create()
Creates Logistic Regression model with parameters given.
@opencv_core.Ptr public static opencv_ml.LogisticRegression load(@opencv_core.Str org.bytedeco.javacpp.BytePointer filepath, @opencv_core.Str org.bytedeco.javacpp.BytePointer nodeName)
filepath - path to serialized LogisticRegressionnodeName - name of node containing the classifier@opencv_core.Ptr public static opencv_ml.LogisticRegression load(@opencv_core.Str org.bytedeco.javacpp.BytePointer filepath)
@opencv_core.Ptr public static opencv_ml.LogisticRegression load(@opencv_core.Str String filepath, @opencv_core.Str String nodeName)
@opencv_core.Ptr public static opencv_ml.LogisticRegression load(@opencv_core.Str String filepath)
Copyright © 2018. All rights reserved.