# MATLAB: ABout LVQ neural network in matlab

lvqnet neural network matlaburgent

I'm using a Learning Vector Quantization network (LVQ) to classify data collected for deep brain stimulation.
The training data set size is 70X69 and target size 2X68.
my code body is : net = newlvq(minmax(ptr),10,[.5 .5]);
 net.trainParam.epochs=50;net = train(net,ptr, ttr);
trout = sim(net,ptr); perftrain = perform(net,trout,ttr); etrain=ttr-trout; msetrain= mse(etrain);
Now the problem is , I could not get accuracy error more than 60% . I am using 100 repeated 10 fold cross validation. Also, Is there anything wrong with the code?
 How do you know how many neurons to use in the competitive layer?  How many epochs should you use?
How do you know that the LVQ is trained well? Please respond. I need it urgently. Thanks

#### Best Answer

• > I'm using a Learning Vector Quantization network (LVQ) to classify data collected for deep brain stimulation.
Why are you using LVQ instead of a universal approximator (e.g., patternnet or newpr?)
> The training data set size is 70X69 and target size 2X68. my code body is :
70X69? Did you investigate input dimensionality reduction?
 >net = newlvq(minmax(ptr),10,[.5 .5]); >net.trainParam.epochs=50;
newlvq is doubly obsolete. What NNTBX version do you have? What is the reason for overwriting the defaults of numhidden = 20 and maxepochs = 1000?
 >net = train(net,ptr, ttr); >trout = sim(net,ptr);  >perftrain = perform(net,trout,ttr); >etrain=ttr-trout;  >msetrain= mse(etrain);
Isn't msetrain == perftrain?
> Now the problem is , I could not get accuracy error more than 60% .
How did you calculate "accuracy error???
> I am using 100 repeated 10 fold cross validation. Also, Is there anything wrong with the code?
The choice of parameter values may be the problem.
>How do you know how many neurons to use in the competitive layer? > How many epochs should you use?
Trial and error after using defaults.
>How do you know that the LVQ is trained well?
Low error rates on nontraining data.