orngSVM
orngSVM provides accsess to orange Support Vector Machine functionality.
Important!!! On some datasets this learner can perform very badly. It is a known fact that SVM's can be very sensitive to the proper choice of the parameters. If you are having problems with
learner's accuracy try scaling the data and using diffrent parameters or choose an easier approach and use the SVMLearnerEasy class whitch does this automatically.
SVMLearner
Arguments
- svm_type
- Defines the type of SVM (can be SVMLearner.C_SVC, SVMLearner.Nu_SVC (default), SVMLearner.OneClass, SVMLearner.Epsilon_SVR, SVMLearner.Nu_SVR)
- kernel_type
- Defines the type of a kernel to use for learning (can be SVMLearner.RBF (default), SVMLearner.Linear, SVMLearner.Polynomial, SVMLearner.Sigmoid, SVMLearner.Custom)
- degree
- Kernel parameter (Polynomial) (default 3)
- gamma
- Kernel parameter (Polynomial/RBF/Sigmoid) (default 1/number_of_examples)
- coef0
- Kernel parameter (Polynomial/Sigmoid) (default 0)
- kernelFunc
- Function that will be called if
kernel_typeis SVMLearner.Custom. It must accept two orange.Example arguments and return a float. - C
- C parameter for C_SVC, Epsilon_SVR, Nu_SVR
- nu
- Nu parameter for Nu_SVC, Nu_SVR and OneClass (default 0.5)
- p
- Epsilon in loss-function for Epsilon_SVR
- cache_size
- Cache memory size in MB (default 100)
- eps
- Tolerance of termination criterion (default 0.001)
- shrinking
- Determines whether to use shrinking heuristics (default True)
- probability
- Determines if a probability model should be build (default False)
SVMLearnerSparse
SVMLearner except that it learns from the examples mata attributes. Note that meta attributes dont need to be registerd with the dataset domain, or present in all the examples.
Use this if you are using large sparse datasets.
SVMLearnerEasy
parameter_selection similar to the easy.py script
in libSVM package. Use this if the SVMLearner performs badly.
SVMLearnerSparseEasy
SVMLearnerEasy except that it learns from the examples mata attributes. Note that meta attributes dont need to be registerd with the dataset domain, or present in all the examples.
Use this if you are using large sparse datasets (and have absolutely no respect for the fourth dimension commonly named as time).
getLinearSVMWeights
Returns a list of weights of linear class vs. class classifiers for the linear multiclass svm classifier. The list is in the order of 1vs2, 1vs3 ... 1vsN, 2vs3 ...
KernelWrapper (DualKernelWrapper)
Methods
- __call__(example1, example2)
- Computes the kernel function for the two examples
RBFKernelWrapper
Takes one kernel function (K1) in initialization and uses it to compute a new kernel function: K(x,y)=exp(K1(x,y)^2/gamma)
Attributes
- gamma
- gamma to use in the kernel function
PolyKernelWrapper
Takes one kernel function (K1) in initialization and uses it to compute a new kernel function: K(x,y)=K1(x,y)^degree
Attributes
- degree
- degree to use in the kernel function
AdditionKernelWrapper
Takes two kernel functions (K1 and K2) in initialization and uses them to compute a new kernel function: K(x,y)=K1(x,y)+K2(x,y)
MultiplicationKernelWrapper
Takes two kernel functions (K1 and K2) in initialization and uses them to compute a new kernel function: K(x,y)=K1(x,y)*K2(x,y)
CompositeKernelWrapper
Takes two kernel functions (K1 and K2) in initialization and uses them to compute a new kernel function: K(x,y)=&lambda*K1(x,y)+(1-&lambda)*K2(x,y)
Attributes
- _lambda
- lambda to use in the kernel function
SparseLinKernel
A linear kernel function that uses the examples meta attributes (must be floats) that need not be present in all examples
Examples
part of svm-custom-kernel.py (uses iris.tab)
LinearLearner
A wrapper around orange.LinearLearner with a default solver_type == L2Loss_SVM_Dual (the default in orange.LinearLearner is L2_LR).
