|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectedu.udo.cs.yale.operator.Operator
edu.udo.cs.yale.operator.learner.AbstractLearner
edu.udo.cs.yale.operator.learner.kernel.LibSVMLearner
public class LibSVMLearner
Applies the libsvm
learner by Chih-Chung Chang and Chih-Jen Lin. The SVM is a powerful method
for both classification and regression. This operator supports the SVM types
C-SVC and nu-SVC for classification tasks and
epsilon-SVR and nu-SVR for regression tasks.
Supports also multiclass learning and probability estimation based on Platt
scaling for proper confidence values after applying the learned model on a
classification data set.
| Field Summary | |
|---|---|
static java.lang.String[] |
KERNEL_TYPES
The different kernel types implemented by the LibSVM package. |
private double |
lastFitness
The fitness of the last learned model. |
private int |
lastNumberSV
The number of SVs for the last learned model. |
static java.lang.String[] |
SVM_TYPES
The different SVM types implemented by the LibSVM package. |
| Constructor Summary | |
|---|---|
LibSVMLearner(OperatorDescription description)
|
|
| Method Summary | |
|---|---|
private double |
getFitness(double[] alphas,
double[] ys,
libsvm.Kernel kernel)
|
PerformanceVector |
getOptimizationPerformance()
Returns the optimization performance of the best result. |
private libsvm.svm_parameter |
getParameters(ExampleSet exampleSet)
Creates a LibSVM parameter object based on the user defined parameters. |
java.util.List<ParameterType> |
getParameterTypes()
Returns a list of ParameterTypes describing the parameters of this operator. |
private libsvm.svm_problem |
getProblem(ExampleSet exampleSet)
Creates a support vector problem for the LibSVM. |
Model |
learn(ExampleSet exampleSet)
Learns a new SVM model with the LibSVM package. |
protected static libsvm.svm_node[] |
makeNodes(Example e,
FastExample2SparseTransform ripper)
Creates a data node row for the LibSVM (sparse format, i.e. each node keeps the index and the value if not default). |
boolean |
shouldDeliverOptimizationPerformance()
Returns the value of the corresponding parameter. |
boolean |
supportsCapability(LearnerCapability lc)
Checks for Learner capabilities. |
| Methods inherited from class edu.udo.cs.yale.operator.learner.AbstractLearner |
|---|
apply, checkLearnerCapabilities, getEstimatedPerformance, getInputClasses, getInputDescription, getOutputClasses, getWeights, shouldCalculateWeights, shouldEstimatePerformance |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface edu.udo.cs.yale.operator.learner.Learner |
|---|
getName |
| Field Detail |
|---|
public static final java.lang.String[] SVM_TYPES
public static final java.lang.String[] KERNEL_TYPES
private double lastFitness
private int lastNumberSV
| Constructor Detail |
|---|
public LibSVMLearner(OperatorDescription description)
| Method Detail |
|---|
public boolean shouldDeliverOptimizationPerformance()
shouldDeliverOptimizationPerformance in class AbstractLearner
public PerformanceVector getOptimizationPerformance()
throws OperatorException
getOptimizationPerformance in class AbstractLearnerOperatorException
private double getFitness(double[] alphas,
double[] ys,
libsvm.Kernel kernel)
public boolean supportsCapability(LearnerCapability lc)
Learner
protected static libsvm.svm_node[] makeNodes(Example e,
FastExample2SparseTransform ripper)
private libsvm.svm_problem getProblem(ExampleSet exampleSet)
private libsvm.svm_parameter getParameters(ExampleSet exampleSet)
throws UndefinedParameterError
UndefinedParameterError
public Model learn(ExampleSet exampleSet)
throws OperatorException
OperatorExceptionpublic java.util.List<ParameterType> getParameterTypes()
Operator
getParameterTypes in class Operator
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||