Class SVMParameters<T extends Output<T>>
java.lang.Object
org.tribuo.common.libsvm.SVMParameters<T>
- All Implemented Interfaces:
Serializable
A container for SVM parameters and the kernel.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final KernelTypeThe kernel.protected final libsvm.svm_parameterThe libSVM format parameters.The type of the SVM. -
Constructor Summary
ConstructorsConstructorDescriptionSVMParameters(SVMType<T> svmType, KernelType kernelType) Constructs the default SVMParameters using the specified SVMType and KernelType. -
Method Summary
Modifier and TypeMethodDescriptionstatic libsvm.svm_parametercopyParameters(libsvm.svm_parameter input) Deep copy of the svm_parameters including the arrays.doublegetGamma()Gets the gamma value.Gets the kernel type.libsvm.svm_parameterGets the underlying SVM parameter object.Gets the SVM type.voidsetCacheSize(double cacheMB) Sets the cache size.voidsetCoeff(double coeff) Sets the coefficient.voidsetCost(double c) Sets the cost for C_SVC.voidsetDegree(int degree) Sets the degree of the polynomial kernel.voidsetEpsilon(double epsilon) Sets the termination closeness.voidsetGamma(double gamma) Sets gamma in the RBF kernel.voidsetNu(double nu) Sets the value of nu for NU_SVM.voidMakes the model that is built provide probability estimates.static StringsvmParamsToString(libsvm.svm_parameter param) A sensible toString for svm_parameter.toString()
-
Field Details
-
svmType
-
kernelType
The kernel. -
parameters
The libSVM format parameters.
-
-
Constructor Details
-
SVMParameters
Constructs the default SVMParameters using the specified SVMType and KernelType.- Parameters:
svmType- The SVM algorithm.kernelType- The kernel.
-
-
Method Details
-
getSvmType
-
getKernelType
-
getParameters
Gets the underlying SVM parameter object.- Returns:
- The SVM parameters.
-
toString
-
setProbability
Makes the model that is built provide probability estimates. -
setCost
-
setNu
-
setCoeff
-
setEpsilon
Sets the termination closeness.- Parameters:
epsilon- The termination criterion.
-
setDegree
Sets the degree of the polynomial kernel.- Parameters:
degree- The polynomial degree.
-
setGamma
-
getGamma
-
setCacheSize
-
copyParameters
Deep copy of the svm_parameters including the arrays.- Parameters:
input- The parameters to copy.- Returns:
- A copy of the svm_parameters.
-
svmParamsToString
A sensible toString for svm_parameter.- Parameters:
param- The parameters.- Returns:
- A String describing the parameters.
-