Package org.opencv.ml
Class SVMSGD
java.lang.Object
org.opencv.core.Algorithm
org.opencv.ml.StatModel
org.opencv.ml.SVMSGD
*************************************************************************************\
Stochastic Gradient Descent SVM Classifier *
\***************************************************************************************
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final intFields inherited from class org.opencv.ml.StatModel
COMPRESSED_INPUT, PREPROCESSED_INPUT, RAW_OUTPUT, UPDATE_MODEL -
Method Summary
Modifier and TypeMethodDescriptionstatic SVMSGD__fromPtr__(long addr) static SVMSGDcreate()Creates empty model.floatSEE: setInitialStepSizefloatSEE: setMarginRegularizationintSEE: setMarginTypefloatgetShift()floatSEE: setStepDecreasingPowerintSEE: setSvmsgdTypeSEE: setTermCriteriastatic SVMSGDLoads and creates a serialized SVMSGD from a file Use SVMSGD::save to serialize and store an SVMSGD to disk.static SVMSGDLoads and creates a serialized SVMSGD from a file Use SVMSGD::save to serialize and store an SVMSGD to disk.voidsetInitialStepSize(float InitialStepSize) getInitialStepSize SEE: getInitialStepSizevoidsetMarginRegularization(float marginRegularization) getMarginRegularization SEE: getMarginRegularizationvoidsetMarginType(int marginType) getMarginType SEE: getMarginTypevoidFunction sets optimal parameters values for chosen SVM SGD model.voidsetOptimalParameters(int svmsgdType) Function sets optimal parameters values for chosen SVM SGD model.voidsetOptimalParameters(int svmsgdType, int marginType) Function sets optimal parameters values for chosen SVM SGD model.voidsetStepDecreasingPower(float stepDecreasingPower) getStepDecreasingPower SEE: getStepDecreasingPowervoidsetSvmsgdType(int svmsgdType) getSvmsgdType SEE: getSvmsgdTypevoidgetTermCriteria SEE: getTermCriteriaMethods inherited from class org.opencv.ml.StatModel
calcError, empty, getVarCount, isClassifier, isTrained, predict, predict, predict, train, train, trainMethods inherited from class org.opencv.core.Algorithm
clear, getDefaultName, getNativeObjAddr, save
-
Field Details
-
SOFT_MARGIN
public static final int SOFT_MARGIN- See Also:
-
HARD_MARGIN
public static final int HARD_MARGIN- See Also:
-
SGD
public static final int SGD- See Also:
-
ASGD
public static final int ASGD- See Also:
-
-
Method Details
-
__fromPtr__
-
getWeights
- Returns:
- the weights of the trained model (decision function f(x) = weights * x + shift).
-
getShift
public float 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
public void setOptimalParameters(int svmsgdType, int marginType) 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
public void setOptimalParameters(int svmsgdType) Function sets optimal parameters values for chosen SVM SGD model.- Parameters:
svmsgdType- is the type of SVMSGD classifier.
-
setOptimalParameters
public void setOptimalParameters()Function sets optimal parameters values for chosen SVM SGD model. -
getSvmsgdType
public int getSvmsgdType()SEE: setSvmsgdType- Returns:
- automatically generated
-
setSvmsgdType
public void setSvmsgdType(int svmsgdType) getSvmsgdType SEE: getSvmsgdType- Parameters:
svmsgdType- automatically generated
-
getMarginType
public int getMarginType()SEE: setMarginType- Returns:
- automatically generated
-
setMarginType
public void setMarginType(int marginType) getMarginType SEE: getMarginType- Parameters:
marginType- automatically generated
-
getMarginRegularization
public float getMarginRegularization()SEE: setMarginRegularization- Returns:
- automatically generated
-
setMarginRegularization
public void setMarginRegularization(float marginRegularization) getMarginRegularization SEE: getMarginRegularization- Parameters:
marginRegularization- automatically generated
-
getInitialStepSize
public float getInitialStepSize()SEE: setInitialStepSize- Returns:
- automatically generated
-
setInitialStepSize
public void setInitialStepSize(float InitialStepSize) getInitialStepSize SEE: getInitialStepSize- Parameters:
InitialStepSize- automatically generated
-
getStepDecreasingPower
public float getStepDecreasingPower()SEE: setStepDecreasingPower- Returns:
- automatically generated
-
setStepDecreasingPower
public void setStepDecreasingPower(float stepDecreasingPower) getStepDecreasingPower SEE: getStepDecreasingPower- Parameters:
stepDecreasingPower- automatically generated
-
getTermCriteria
SEE: setTermCriteria- Returns:
- automatically generated
-
setTermCriteria
getTermCriteria SEE: getTermCriteria- Parameters:
val- automatically generated
-