|
On May 12, 10:37 am, "Slawomir " <SlawomirBab...@gmail.com> wrote:
> Hello!
>
> Assume, that I have this database INPUT.txt., which is the breast cancer database.http://www.2shared.com/document/l5DYVIVR/INPUT.html
>
> Example of the INPUT.txt
>
> 1189286,10,10,8,6,4,5,8,10,1,4
> 1190394,4,1,1,1,2,3,1,1,1,2
> 1190485,1,1,1,1,2,1,1,1,1,2
> 1192325,5,5,5,6,3,10,3,1,1,4
> 1193091,1,2,2,1,2,1,2,1,1,2
> 1193210,2,1,1,1,2,1,3,1,1,2
> 1193683,1,1,2,1,3,1,1,1,1,2
>
> 4 - stands for malignant
> 2 - stands for benign
> 1193210 - number of sample, irrelevant
>
> There are two values 2 and 4, and I want to classify those classes using neural network.
>
> If I want to classify that classes I need to have 2 outputs eg. T=[T;T];
> My idea was to code that target values 4 and 2 into 0 0 and 1 1.
> And a few questions:
> 1. What is the best way to code that target values?
> 2. What if I will have more than 4 and 2? Lets say that 10 values. How to code it? I guess for 10 values sth like T=[T;T;T;T;T;T;T;T;T;T] will be totally inefficient, because it is easier to calculate weight values for numbers from range 0 - 1 instead of 2 - 4 in this case or even bigger.
> I probably need to create class from combination 0 and 1,
> 1-st: 0 0 0
> 2-nd: 0 1 0
> 3-th: 0 1 1
> 4-th: 1 1 1
> 5-th: 1 0 0
> 6-th: 1 0 1
> 7-th: 0 0 1
> 8-th: 1 1 0
> and so on.
>
> My code:
>
> dane = load('INPUT.txt');
> P = dane(:, 2:10)';
> T = dane(:, 11)'; % Targets
> T = [T;T];
> net = newff(P, T, [4 4], {'logsig' 'logsig'});
> [net, tr] = train(net, P, T);
> S = sim(net, P);
> MSE = mse(T - S)
> figure, plotconfusion(T,S)
>
> I coded 4 and 2 into 0 and 1 by using this code instead T = [T;T];
>
> c = T./2 - 1; % Creates 0 and 1
> T = [c;c];
>
> Any ideas?
> Thanks for help!
|