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
protected final libsvm.svm_parameter parametersThe 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
public libsvm.svm_parameter getParameters()Gets the underlying SVM parameter object.- Returns:
- The SVM parameters.
-
toString
-
setProbability
public void setProbability()Makes the model that is built provide probability estimates. -
setCost
public void setCost(double c) Sets the cost for C_SVC.- Parameters:
c- The cost.
-
setNu
public void setNu(double nu) Sets the value of nu for NU_SVM.- Parameters:
nu- The nu.
-
setCoeff
public void setCoeff(double coeff) Sets the coefficient.- Parameters:
coeff- The coefficient.
-
setEpsilon
public void setEpsilon(double epsilon) Sets the termination closeness.- Parameters:
epsilon- The termination criterion.
-
setDegree
public void setDegree(int degree) Sets the degree of the polynomial kernel.- Parameters:
degree- The polynomial degree.
-
setGamma
public void setGamma(double gamma) Sets gamma in the RBF kernel.- Parameters:
gamma- The gamma.
-
getGamma
public double getGamma()Gets the gamma value.- Returns:
- The gamma value.
-
setCacheSize
public void setCacheSize(double cacheMB) Sets the cache size.- Parameters:
cacheMB- The cache size.
-
copyParameters
public static libsvm.svm_parameter copyParameters(libsvm.svm_parameter input) 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.
-