Package org.opencv.ml
Class SVMSGD
java.lang.Object
org.opencv.core.Algorithm
org.opencv.ml.StatModel
org.opencv.ml.SVMSGD
public class SVMSGD extends StatModel
*************************************************************************************\
Stochastic Gradient Descent SVM Classifier *
\***************************************************************************************
-
Field Summary
Fields Modifier and Type Field Description static int
ASGD
static int
HARD_MARGIN
static int
SGD
static int
SOFT_MARGIN
Fields inherited from class org.opencv.ml.StatModel
COMPRESSED_INPUT, PREPROCESSED_INPUT, RAW_OUTPUT, UPDATE_MODEL
-
Constructor Summary
Constructors Modifier Constructor Description protected
SVMSGD(long addr)
-
Method Summary
Modifier and Type Method Description static SVMSGD
__fromPtr__(long addr)
static SVMSGD
create()
Creates empty model.protected void
finalize()
float
getInitialStepSize()
SEE: setInitialStepSizefloat
getMarginRegularization()
SEE: setMarginRegularizationint
getMarginType()
SEE: setMarginTypefloat
getShift()
float
getStepDecreasingPower()
SEE: setStepDecreasingPowerint
getSvmsgdType()
SEE: setSvmsgdTypeTermCriteria
getTermCriteria()
SEE: setTermCriteriaMat
getWeights()
static SVMSGD
load(String filepath)
Loads and creates a serialized SVMSGD from a file Use SVMSGD::save to serialize and store an SVMSGD to disk.static SVMSGD
load(String filepath, String nodeName)
Loads and creates a serialized SVMSGD from a file Use SVMSGD::save to serialize and store an SVMSGD to disk.void
setInitialStepSize(float InitialStepSize)
getInitialStepSize SEE: getInitialStepSizevoid
setMarginRegularization(float marginRegularization)
getMarginRegularization SEE: getMarginRegularizationvoid
setMarginType(int marginType)
getMarginType SEE: getMarginTypevoid
setOptimalParameters()
Function sets optimal parameters values for chosen SVM SGD model.void
setOptimalParameters(int svmsgdType)
Function sets optimal parameters values for chosen SVM SGD model.void
setOptimalParameters(int svmsgdType, int marginType)
Function sets optimal parameters values for chosen SVM SGD model.void
setStepDecreasingPower(float stepDecreasingPower)
getStepDecreasingPower SEE: getStepDecreasingPowervoid
setSvmsgdType(int svmsgdType)
getSvmsgdType SEE: getSvmsgdTypevoid
setTermCriteria(TermCriteria val)
getTermCriteria SEE: getTermCriteriaMethods inherited from class org.opencv.ml.StatModel
calcError, empty, getVarCount, isClassifier, isTrained, predict, predict, predict, train, train, train
Methods inherited from class org.opencv.core.Algorithm
clear, getDefaultName, getNativeObjAddr, save
-
Field Details
-
SOFT_MARGIN
- See Also:
- Constant Field Values
-
HARD_MARGIN
- See Also:
- Constant Field Values
-
SGD
- See Also:
- Constant Field Values
-
ASGD
- See Also:
- Constant Field Values
-
-
Constructor Details
-
Method Details
-
__fromPtr__
-
getWeights
- Returns:
- the weights of the trained model (decision function f(x) = weights * x + shift).
-
getShift
- Returns:
- the shift of the trained model (decision function f(x) = weights * x + shift).
-
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.- Returns:
- automatically generated
-
load
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. Optionally specify the node for the file containing the classifier- Parameters:
filepath
- path to serialized SVMSGDnodeName
- name of node containing the classifier- Returns:
- automatically generated
-
load
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. Optionally specify the node for the file containing the classifier- Parameters:
filepath
- path to serialized SVMSGD- Returns:
- automatically generated
-
setOptimalParameters
Function sets optimal parameters values for chosen SVM SGD model.- Parameters:
svmsgdType
- is the type of SVMSGD classifier.marginType
- is the type of margin constraint.
-
setOptimalParameters
Function sets optimal parameters values for chosen SVM SGD model.- Parameters:
svmsgdType
- is the type of SVMSGD classifier.
-
setOptimalParameters
Function sets optimal parameters values for chosen SVM SGD model. -
getSvmsgdType
SEE: setSvmsgdType- Returns:
- automatically generated
-
setSvmsgdType
getSvmsgdType SEE: getSvmsgdType- Parameters:
svmsgdType
- automatically generated
-
getMarginType
SEE: setMarginType- Returns:
- automatically generated
-
setMarginType
getMarginType SEE: getMarginType- Parameters:
marginType
- automatically generated
-
getMarginRegularization
SEE: setMarginRegularization- Returns:
- automatically generated
-
setMarginRegularization
getMarginRegularization SEE: getMarginRegularization- Parameters:
marginRegularization
- automatically generated
-
getInitialStepSize
SEE: setInitialStepSize- Returns:
- automatically generated
-
setInitialStepSize
getInitialStepSize SEE: getInitialStepSize- Parameters:
InitialStepSize
- automatically generated
-
getStepDecreasingPower
SEE: setStepDecreasingPower- Returns:
- automatically generated
-
setStepDecreasingPower
getStepDecreasingPower SEE: getStepDecreasingPower- Parameters:
stepDecreasingPower
- automatically generated
-
getTermCriteria
SEE: setTermCriteria- Returns:
- automatically generated
-
setTermCriteria
getTermCriteria SEE: getTermCriteria- Parameters:
val
- automatically generated
-
finalize
-