Class SVMSGD
- Namespace
- OpenCvSharp.ML
- Assembly
- OpenCvSharp.dll
Stochastic Gradient Descent SVM classifier
public class SVMSGD : StatModel, IDisposable
- Inheritance
-
SVMSGD
- Implements
- Inherited Members
Properties
InitialStepSize
Parameter initialStepSize of a %SVMSGD optimization problem.
public float InitialStepSize { get; set; }
Property Value
MarginRegularization
Parameter marginRegularization of a %SVMSGD optimization problem.
public float MarginRegularization { get; set; }
Property Value
MarginType
Margin type, one of SVMSGD::MarginType.
public SVMSGD.MarginTypes MarginType { get; set; }
Property Value
StepDecreasingPower
Parameter stepDecreasingPower of a %SVMSGD optimization problem.
public float StepDecreasingPower { get; set; }
Property Value
SvmsgdType
Algorithm type, one of SVMSGD::SvmsgdType.
public SVMSGD.SvmsgdTypes SvmsgdType { get; set; }
Property Value
TermCriteria
Termination criteria of the training algorithm. You can specify the maximum number of iterations (maxCount) and/or how much the error could change between the iterations to make the algorithm continue (epsilon).
public TermCriteria TermCriteria { get; set; }
Property Value
Methods
Create()
Creates empty model. Use StatModel::Train to train the model. Since %SVMSGD has several parameters, you may want to find the best parameters for your problem or use SetOptimalParameters to set some default parameters.
public static SVMSGD Create()
Returns
GetShift()
Returns the shift of the trained model (decision function f(x) = weights * x + shift).
public float GetShift()
Returns
GetWeights()
Returns the weights of the trained model (decision function f(x) = weights * x + shift).
public Mat GetWeights()
Returns
Load(string)
Loads and creates a serialized SVMSGD from a file. Use SVMSGD::save to serialize and store an SVMSGD to disk. Load the SVMSGD from this file again, by calling this function with the path to the file.
public static SVMSGD Load(string filePath)
Parameters
filePathstring
Returns
LoadFromString(string)
Loads algorithm from a String.
public static SVMSGD LoadFromString(string strModel)
Parameters
strModelstringThe string variable containing the model you want to load.
Returns
SetOptimalParameters(SvmsgdTypes, MarginTypes)
Function sets optimal parameters values for chosen SVM SGD model.
public void SetOptimalParameters(SVMSGD.SvmsgdTypes svmsgdType = SvmsgdTypes.Asgd, SVMSGD.MarginTypes marginType = MarginTypes.SoftMargin)
Parameters
svmsgdTypeSVMSGD.SvmsgdTypesis the type of SVMSGD classifier.
marginTypeSVMSGD.MarginTypesis the type of margin constraint.