@Namespace(value="cv::ml") @Properties(inherit=opencv_ml.class) public class LogisticRegression extends StatModel
ml_intro_lr
Pointer.CustomDeallocator, Pointer.Deallocator, Pointer.NativeDeallocator, Pointer.ReferenceCounter
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(Pointer p)
Pointer cast constructor.
|
Modifier and Type | Method and Description |
---|---|
static LogisticRegression |
create()
\brief Creates empty model.
|
Mat |
get_learnt_thetas()
\brief This function returns the trained parameters arranged across rows.
|
int |
getIterations() |
double |
getLearningRate() |
int |
getMiniBatchSize() |
int |
getRegularization() |
TermCriteria |
getTermCriteria() |
int |
getTrainMethod() |
static LogisticRegression |
load(BytePointer filepath) |
static LogisticRegression |
load(BytePointer filepath,
BytePointer nodeName)
\brief 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) |
static LogisticRegression |
load(String filepath,
String nodeName) |
float |
predict(GpuMat samples) |
float |
predict(GpuMat samples,
GpuMat results,
int flags) |
float |
predict(Mat samples) |
float |
predict(Mat samples,
Mat results,
int flags)
\brief Predicts responses for input samples and returns a float type.
|
float |
predict(UMat samples) |
float |
predict(UMat samples,
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(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, train
loadANN_MLP, loadANN_MLP, loadBoost, loadBoost, loadDTrees, loadDTrees, loadEM, loadEM, loadKNearest, loadKNearest, loadLogisticRegression, loadLogisticRegression, loadNormalBayesClassifier, loadNormalBayesClassifier, loadRTrees, loadRTrees, loadSVM, loadSVM
clear, getDefaultName, position, read, save, save, write, write, write
address, asBuffer, asByteBuffer, availablePhysicalBytes, calloc, capacity, capacity, close, deallocate, deallocate, deallocateReferences, deallocator, deallocator, equals, fill, formatBytes, free, hashCode, isNull, isNull, limit, limit, malloc, maxBytes, maxPhysicalBytes, memchr, memcmp, memcpy, memmove, memset, offsetof, parseBytes, physicalBytes, position, put, realloc, referenceCount, releaseReference, retainReference, setNull, sizeof, toString, totalBytes, totalPhysicalBytes, withDeallocator, zero
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 LogisticRegression(Pointer p)
Pointer.Pointer(Pointer)
.public double getLearningRate()
setLearningRate
public void setLearningRate(double val)
public int getIterations()
setIterations
public void setIterations(int val)
public int getRegularization()
setRegularization
public void setRegularization(int val)
public int getTrainMethod()
setTrainMethod
public void setTrainMethod(int val)
public int getMiniBatchSize()
setMiniBatchSize
public void setMiniBatchSize(int val)
@ByVal public TermCriteria getTermCriteria()
setTermCriteria
public void setTermCriteria(@ByVal TermCriteria val)
public float predict(@ByVal Mat samples, @ByVal(nullValue="cv::OutputArray(cv::noArray())") 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(@ByVal UMat samples, @ByVal(nullValue="cv::OutputArray(cv::noArray())") UMat results, int flags)
public float predict(@ByVal GpuMat samples, @ByVal(nullValue="cv::OutputArray(cv::noArray())") GpuMat results, int flags)
@ByVal public Mat get_learnt_thetas()
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.
@opencv_core.Ptr public static LogisticRegression create()
Creates Logistic Regression model with parameters given.
@opencv_core.Ptr public static LogisticRegression load(@opencv_core.Str BytePointer filepath, @opencv_core.Str BytePointer nodeName)
filepath
- path to serialized LogisticRegressionnodeName
- name of node containing the classifier@opencv_core.Ptr public static LogisticRegression load(@opencv_core.Str BytePointer filepath)
@opencv_core.Ptr public static LogisticRegression load(@opencv_core.Str String filepath, @opencv_core.Str String nodeName)
@opencv_core.Ptr public static LogisticRegression load(@opencv_core.Str String filepath)
Copyright © 2020. All rights reserved.