|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.encog.ml.BasicML
org.encog.ml.svm.SVM
public class SVM
This is a network that is backed by one or more Support Vector Machines (SVM). It is designed to function very similarly to an Encog neural network, and is largely interchangeable with an Encog neural network. The support vector machine supports several types. Regression is used when you want the network to predict a value, given the input. Function approximation is a good example of regression. Classification is used when you want the SVM to group the input data into one or more classes. Support Vector Machines typically have a single output. Neural networks can have multiple output neurons. To get around this issue, this class will create multiple SVM's if there is more than one output specified. Because a SVM is trained quite differently from a neural network, none of the neural network training classes will work. This class must be trained using SVMTrain.
| Field Summary | |
|---|---|
static int |
DEFAULT_C
The default C. |
static int |
DEFAULT_CACHE_SIZE
The default cache size. |
static int |
DEFAULT_COEF0
The default COEF0. |
static int |
DEFAULT_DEGREE
The default degree. |
static double |
DEFAULT_EPS
The default EPS. |
static double |
DEFAULT_NU
The default NU. |
static double |
DEFAULT_P
The default P. |
| Constructor Summary | |
|---|---|
SVM()
Construct the SVM. |
|
SVM(int theInputCount,
boolean regression)
Construct an SVM network. |
|
SVM(int theInputCount,
SVMType svmType,
KernelType kernelType)
Construct a SVM network. |
|
SVM(svm_model theModel)
Construct a SVM from a model. |
|
| Method Summary | |
|---|---|
double |
calculateError(MLDataSet data)
Calculate the error for this SVM. |
int |
classify(MLData input)
Classify the input into a group. |
MLData |
compute(MLData input)
Compute the output for the given input. |
int |
getInputCount()
|
KernelType |
getKernelType()
|
svm_model |
getModel()
|
int |
getOutputCount()
|
svm_parameter |
getParams()
|
SVMType |
getSVMType()
|
svm_node[] |
makeSparse(MLData data)
Convert regular Encog MLData into the "sparse" data needed by an SVM. |
void |
setInputCount(int i)
Set the input count. |
void |
setModel(svm_model theModel)
Set the model. |
void |
updateProperties()
Not needed, no properties to update. |
| Methods inherited from class org.encog.ml.BasicML |
|---|
getProperties, getPropertyDouble, getPropertyLong, getPropertyString, setProperty, setProperty, setProperty |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int DEFAULT_DEGREE
public static final int DEFAULT_COEF0
public static final double DEFAULT_NU
public static final int DEFAULT_CACHE_SIZE
public static final int DEFAULT_C
public static final double DEFAULT_EPS
public static final double DEFAULT_P
| Constructor Detail |
|---|
public SVM()
public SVM(int theInputCount,
boolean regression)
theInputCount - The input count.regression - True if this network is used for regression.
public SVM(int theInputCount,
SVMType svmType,
KernelType kernelType)
theInputCount - The input count.svmType - The type of SVM.kernelType - The SVM kernal type.public SVM(svm_model theModel)
theModel - The model.| Method Detail |
|---|
public double calculateError(MLDataSet data)
calculateError in interface MLErrordata - The training set.
public int classify(MLData input)
classify in interface MLClassificationinput - The input data to classify.
public MLData compute(MLData input)
compute in interface MLRegressioninput - The input to the SVM.
public int getInputCount()
getInputCount in interface MLInputpublic KernelType getKernelType()
public svm_model getModel()
public int getOutputCount()
getOutputCount in interface MLOutputpublic final svm_parameter getParams()
public SVMType getSVMType()
public svm_node[] makeSparse(MLData data)
data - The data to convert.
public void setInputCount(int i)
i - The new input count.public void setModel(svm_model theModel)
theModel - The model.public void updateProperties()
updateProperties in interface MLPropertiesupdateProperties in class BasicML
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||