I want to use NN toolbox in matlab
my input is a 42*3 and my target is 42*1
i Have 42 samples with 3 features
but I cant load the target and it hasn't any error but it doesn't load
can anyone help me
Try to load an example dataset first. Matlab provides six example data sets, you can choose in the GUI. If you have no problems with those, the problem is with your data.
Related
I need some help. I got *.mat Matlab file after extract the features from 2D static image. The extraction process was used 2D Haar Wavelet in Matlab Apps.
The problems are: 1. How I want to use the *.mat Matlab file as an input to the SVM program in Matlab?
Addition information: i. The image is the iris image.
ii. Link for the screen capture image of the example output after the extraction process
Based on the image, what is suitable/relevant data to be used in SVM in order to classify the image into 2 classes such as class 1 = Healthy Iris or class 2 = unhealthy iris. Or maybe somebody already got the sample Matlab code that similar with this case study, hope you willing to share the code.
TQ in advanced for the help.
I have just tried out Neural Network fitting tool in Matlab, however, I am not able to generate a function which relates all the input variables to the output, can anybody help me out on this? Is there a post-processor available to do that?
cheers,
Gaurav
If You are using nftool at the last page there are saving options.
You can generate script that will allow You to solve similar problem but with new fitting data and (what I think You want) You can save object with Your net that You can use with Your input to get output.
The trained NN object itself can be used as the input-output function. It is an object that contains an "evaluate" method. See the example from mathworks for details:
http://www.mathworks.com/help/nnet/ref/fitnet.html
In the matlab workspace the output/results can be easily saved. But when I train the network with some data to see the performance of the training (In Neural Network Toolbox), the regression plots along with the histograms and performance plots can not be saved as a figure file.currently i am using snipping tools to capture them.
My Question is how to do that? Is there any options to save those plots(generated in Maltab Neural Network toolbox)?
I would be grateful to have any codes/ answers regarding my inquiry. Many thanks.
I am adding to snapshot of plots which i want to save by commanding codes in matlab.
currently i am using snipping tools but when i put then in word, their property/image quality shrinks.
First of all you need to identify the gfx object you want to snap-shoot (its handle). This may come from identifiable properties. Then you'd want to use print to save it to a file; you need to provide the file name, eventually the type; see the help for more details.
For example, if you want to save the figure with the tag 'my.awesome.fig', you may try:
h = findobj('Type', 'figure', 'tag', 'my.awesome.fig');
for k = 1:numel(h)
print(h(k), sprintf('Pic%d.ps',k));
end;
The training figures other than nntraintool itself are genuine matlab figures. The tags are for example TRAINING_PLOTERRHIST TRAINING_PLOTPERFORM TRAINING_PLOTRESPONSE . the nntraintool figure is java--you can access it with nnjava.tools('nntraintool'). See Undocumented Matlab for how to manipulate java figures in Matlab.
Richard
If you mention about the quality of figures only, you can do it by clicking EDIT/COPY in the figure menu.
I want to prepare training and testing set for Automatic Speech Recognition by using a Matlab toolbox. I already have the sample set containing several recorded audio (.wav). I am new to Matlab. In order to use the toolbox I need to create training ad testing set save in .mat file. The question is how to create single .mat file containing all the audio? Thanks a million.
To create disjoint training and testing set, the best method is to use crossvalind command. So it performs cross-validation of k-fold where k is the parameter given as input. If k=5 then 1/5th data is used for testing and 4/5th data is used for training. The code is as follows:
data=randi(20,[500 20]); %creating random data with 500 rows and 20 columns.
indices=crossvalid('Kfold',size(data,1),5);
test = (indices == 2); %you can put any number between 1 to 5
train = ~test;
trainData=data(train,:);
testData=data(test,:);
savefile='dataFile.mat'
save(savefile,'trainData','testData');
If you change the number 2 to other number, you will get train-test data with a same distribution and it will be random each time. You can also put it in a for loop but then for saving, you will need to use some tricks or do it manually by placing a breakpoint each point to avoid data getting overwritten. This a general technique to create train-test sets. I hope you will be able to apply this for your problem.
I'm doing some preliminary testing with 2 classes of vectors, trying to separate them with libsvm. I get a 78.2% correct ID rate in Matlab and at the cmd line (using libsvm), but in Weka I get around 95%.
No cross-validation was done in Weka; just trained model and then read in test dataset and classified it.
Can anyone offer an explanation? Thanks in advance.
If you didn't provide a separate Test Data , the validation Folds should be set, 10 or desired value. however, be sure that the same SVMType and kerneltype are being used in both program. by default Weka uses C-SVC with radial basis function.