Class LogisticRegression
Implements Logistic Regression classifier.
Inheritance
Implements
Inherited Members
Namespace: OpenCvSharp.ML
Assembly: OpenCvSharp.dll
Syntax
public class LogisticRegression : StatModel, ICvPtrHolder
Constructors
| Improve this Doc View SourceLogisticRegression(IntPtr)
Creates instance by raw pointer cv::ml::LogisticRegression*
Declaration
protected LogisticRegression(IntPtr p)
Parameters
Type | Name | Description |
---|---|---|
IntPtr | p |
Properties
| Improve this Doc View SourceIterations
Number of iterations.
Declaration
public int Iterations { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
LearningRate
Learning rate
Declaration
public double LearningRate { get; set; }
Property Value
Type | Description |
---|---|
System.Double |
MiniBatchSize
Specifies the number of training samples taken in each step of Mini-Batch Gradient. Descent. Will only be used if using LogisticRegression::MINI_BATCH training algorithm. It has to take values less than the total number of training samples.
Declaration
public int MiniBatchSize { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
Regularization
Kind of regularization to be applied. See LogisticRegression::RegKinds.
Declaration
public LogisticRegression.RegKinds Regularization { get; set; }
Property Value
Type | Description |
---|---|
LogisticRegression.RegKinds |
TermCriteria
Termination criteria of the training algorithm.
Declaration
public TermCriteria TermCriteria { get; set; }
Property Value
Type | Description |
---|---|
OpenCvSharp.TermCriteria |
TrainMethod
Kind of training method used. See LogisticRegression::Methods.
Declaration
public LogisticRegression.Methods TrainMethod { get; set; }
Property Value
Type | Description |
---|---|
LogisticRegression.Methods |
Methods
| Improve this Doc View SourceCreate()
Creates the empty model.
Declaration
public static LogisticRegression Create()
Returns
Type | Description |
---|---|
LogisticRegression |
DisposeManaged()
Releases managed resources
Declaration
protected override void DisposeManaged()
Overrides
| Improve this Doc View SourceGetLearntThetas()
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.
Declaration
public Mat GetLearntThetas()
Returns
Type | Description |
---|---|
Mat |
Load(String)
Loads and creates a serialized model from a file.
Declaration
public static LogisticRegression Load(string filePath)
Parameters
Type | Name | Description |
---|---|---|
System.String | filePath |
Returns
Type | Description |
---|---|
LogisticRegression |
LoadFromString(String)
Loads algorithm from a String.
Declaration
public static LogisticRegression LoadFromString(string strModel)
Parameters
Type | Name | Description |
---|---|---|
System.String | strModel | he string variable containing the model you want to load. |
Returns
Type | Description |
---|---|
LogisticRegression |
Predict(InputArray, OutputArray, Int32)
Predicts responses for input samples and returns a float type.
Declaration
public float Predict(InputArray samples, OutputArray results = null, int flags = 0)
Parameters
Type | Name | Description |
---|---|---|
InputArray | 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. |
OutputArray | results | Predicted labels as a column matrix of type CV_32S. |
System.Int32 | flags | Not used. |
Returns
Type | Description |
---|---|
System.Single |