C# ENCOG SVM classification with my own dataset -
I want to make a multiclass taxonomy application in C #. I decided to use Encog to do this. Now I'm stuck at a point. I got a XOR example, which I think. But when I'm going to use my dataset, the app is computing with one feature as an example. Here's my code:
Namespace console application 1 {public static class load {public static double load} [] from file (string path) {var rows = new list & lt; Double [] & gt; (); Forward (Farn. ReedLine (Path) in the file (lines.add (line Sample (new)} Return lines .OARRA ();}} Public class program {Static Zero Main (string [] ARG) {// Loading my Your data string cestain = @ "E: \ vstup.txt"; double [] [] innput = load.FromFile (cestain); // training INPUTS string cestaout = @ "e: \ vystup.txt"; double [] [ ] Ooutput = load.from (cestaout); // desired output string cestatest = @ "E: \ te1.txt"; double [] [] teest = load.FromFile (cestatest); // test example // a nerve Make workplace svm = new supportmaker Machin (10, false); // inputting incorrect / training data for categorization; IMLDataSet trainingSet = new BasicMLDataSet (innput, ooutput); // Train Neural Networks IMLTrain Train = New SVMS Stretrain (SVM, TrainingSat); Int Eg = 1; To do {train.Iteration (); Console.WrightLine (@ "Epoch #" + Epoch + @ "Error:" + train.Error); Eug ++;} While (Train.Error & gt; 0.01); // Test the Nervous Network Console WrightLine (@ "SVM results:"); Foreign exchange (IMLDataPair pair for training) {IMLData output = svm.Compute (pair.Input); Console.lightline (pair.input [0] + @ ", actual =" + output [0] + @ ", ideal =" + pair. command [0]); } Console.light line ("finished"); Console.ReadKey (); }}}
INPUTS looks like this (this is just a sample):
166 163 180 228
165 162 160 226 < /
166 163 180 228
166 164 180 228
Defined object looks like this (this is just a sample):
1
2
1
1
Examination example looks like this:
152 151 98 21 9
When I run my app, it is computing the error, but it only shows values from the first column of my INPUTS (so I'm not sure that this whole example is equivalent to -4 values. Computing). I am also not sure how to pass my test example in the SYM instead of that pair. Input.
Or is there a more efficient way to do this than the ANCog? Thank you
If you are doing and are executing operator, you only need a pair of digits ... but in your sample input, you have four, which I do not understand.
I do not know how to use SupportVectorMachine so that I can use it:
Basic Network Network = New BasicNetwork (); Networks Adler (new basic layer (2)); // Input Layer Network Adler (new basic layer (2)); // Hidden layer network Adler (new basic layer (1)); // output back network Structure Finilization (); Network.Reset ();
This helps me.
Comments
Post a Comment