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 SummaryFields Modifier and Type Field Description static intASGDstatic intHARD_MARGINstatic intSGDstatic intSOFT_MARGIN- 
Fields inherited from class org.opencv.ml.StatModelCOMPRESSED_INPUT, PREPROCESSED_INPUT, RAW_OUTPUT, UPDATE_MODEL
 
- 
 - 
Constructor SummaryConstructors Modifier Constructor Description protectedSVMSGD(long addr)
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static SVMSGD__fromPtr__(long addr)static SVMSGDcreate()Creates empty model.protected voidfinalize()floatgetInitialStepSize()SEE: setInitialStepSizefloatgetMarginRegularization()SEE: setMarginRegularizationintgetMarginType()SEE: setMarginTypefloatgetShift()floatgetStepDecreasingPower()SEE: setStepDecreasingPowerintgetSvmsgdType()SEE: setSvmsgdTypeTermCriteriagetTermCriteria()SEE: setTermCriteriaMatgetWeights()static SVMSGDload(java.lang.String filepath)Loads and creates a serialized SVMSGD from a file Use SVMSGD::save to serialize and store an SVMSGD to disk.static SVMSGDload(java.lang.String filepath, java.lang.String nodeName)Loads 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: getMarginTypevoidsetOptimalParameters()Function 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: getSvmsgdTypevoidsetTermCriteria(TermCriteria val)getTermCriteria SEE: getTermCriteria- 
Methods inherited from class org.opencv.ml.StatModelcalcError, empty, getVarCount, isClassifier, isTrained, predict, predict, predict, train, train, train
 - 
Methods inherited from class org.opencv.core.Algorithmclear, getDefaultName, getNativeObjAddr, save
 
- 
 
- 
- 
- 
Field Detail- 
SOFT_MARGINpublic static final int SOFT_MARGIN - See Also:
- Constant Field Values
 
 - 
HARD_MARGINpublic static final int HARD_MARGIN - See Also:
- Constant Field Values
 
 - 
SGDpublic static final int SGD - See Also:
- Constant Field Values
 
 - 
ASGDpublic static final int ASGD - See Also:
- Constant Field Values
 
 
- 
 - 
Method Detail- 
__fromPtr__public static SVMSGD __fromPtr__(long addr) 
 - 
getWeightspublic Mat getWeights() - Returns:
- the weights of the trained model (decision function f(x) = weights * x + shift).
 
 - 
getShiftpublic float getShift() - Returns:
- the shift of the trained model (decision function f(x) = weights * x + shift).
 
 - 
createpublic static SVMSGD 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
 
 - 
loadpublic static SVMSGD load(java.lang.String filepath, java.lang.String nodeName) 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
- nodeName- name of node containing the classifier
- Returns:
- automatically generated
 
 - 
loadpublic static SVMSGD load(java.lang.String filepath) 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
 
 - 
setOptimalParameterspublic 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.
 
 - 
setOptimalParameterspublic void setOptimalParameters(int svmsgdType) Function sets optimal parameters values for chosen SVM SGD model.- Parameters:
- svmsgdType- is the type of SVMSGD classifier.
 
 - 
setOptimalParameterspublic void setOptimalParameters() Function sets optimal parameters values for chosen SVM SGD model.
 - 
getSvmsgdTypepublic int getSvmsgdType() SEE: setSvmsgdType- Returns:
- automatically generated
 
 - 
setSvmsgdTypepublic void setSvmsgdType(int svmsgdType) getSvmsgdType SEE: getSvmsgdType- Parameters:
- svmsgdType- automatically generated
 
 - 
getMarginTypepublic int getMarginType() SEE: setMarginType- Returns:
- automatically generated
 
 - 
setMarginTypepublic void setMarginType(int marginType) getMarginType SEE: getMarginType- Parameters:
- marginType- automatically generated
 
 - 
getMarginRegularizationpublic float getMarginRegularization() SEE: setMarginRegularization- Returns:
- automatically generated
 
 - 
setMarginRegularizationpublic void setMarginRegularization(float marginRegularization) getMarginRegularization SEE: getMarginRegularization- Parameters:
- marginRegularization- automatically generated
 
 - 
getInitialStepSizepublic float getInitialStepSize() SEE: setInitialStepSize- Returns:
- automatically generated
 
 - 
setInitialStepSizepublic void setInitialStepSize(float InitialStepSize) getInitialStepSize SEE: getInitialStepSize- Parameters:
- InitialStepSize- automatically generated
 
 - 
getStepDecreasingPowerpublic float getStepDecreasingPower() SEE: setStepDecreasingPower- Returns:
- automatically generated
 
 - 
setStepDecreasingPowerpublic void setStepDecreasingPower(float stepDecreasingPower) getStepDecreasingPower SEE: getStepDecreasingPower- Parameters:
- stepDecreasingPower- automatically generated
 
 - 
getTermCriteriapublic TermCriteria getTermCriteria() SEE: setTermCriteria- Returns:
- automatically generated
 
 - 
setTermCriteriapublic void setTermCriteria(TermCriteria val) getTermCriteria SEE: getTermCriteria- Parameters:
- val- automatically generated
 
 
- 
 
-