Closed PetrToman closed 10 years ago
I cannot understand how the ideal output can be built for SVM to work. In a standard classification code the Ideal is one value per Input.
public static double[][] ClassificationIdeal = { new[] {0.0}, new[] {0.0}, new[] {0.0}, new[] {0.0}, new[] {1.0}, new[] {1.0}, new[] {2.0}, new[] {2.0}, new[] {3.0}, new[] {3.0} };
But in my domain I have a close relationship between the Input and the Ideal, so the Input is in the same structure as the Ideal like this:
INPUT_ARRAY[][] = { { 0.1111111111111111, 0.14285714285714285, 4.0 }, { 0.125, 0.125, 4.0 }, { 1.0, 1.0, 0.25 }, { 8.0, 4.0, 0.16666666666666666 } }; IDEAL_ARRAY[][] = { { 0.1111111111111111, 0.16666666666666666, 4.0 }, { 0.125, 0.5, 3.0 }, { 1.0, 0.5, 0.25 }, { 8.0, 4.0, 0.2 } };
The data above is normalized (1/9 - 9 to 0 - 1 ) before the training. There must be a workaround to make it work like in BPN. I'm new in the SVM field
There is an FAQ on this here: http://www.heatonresearch.com/faq/5/2
I am closing this enhancement. I don't think it is useful to make a single output emulate the way a neural network operates. Neural networks have multiple outputs, SVM's have a single. Many other models have a single output as well. If I kludge the SVM to make it look like a neural network, I will be getting questions on that for a long time. I am really trying to keep Encog as standard/true as possible to the original intents of the models.
NN uses several output neurons in case of a multiclass classification, for example 5 classes requires 5 output neurons (unless using equilateral normalization) and therefore the data should contain 5 binary fields (0/1) for output. However, SVM requires only 1 output field - containing max. 5 different values, in this example.
With a simple enhancement, the data could be transformed for SVM: from X fields containing 0/1 into 1 field containing a range of values (1-X), so that NN and SVM could use the same data with no modifications.