I have two array of vectors (each row contain 20 vector of numbers). One for the train and the other for the test. How can I apply classification on them using Matlab?
You can have a try by using the SVM (support vector machine) method. The recent version of MATLAB should include the related function. Or otherwise, you can find the open codes in the net. I am sure the SVM is useful for your problem.
You should have got the labels of the classification task as well as the data arrays.
Decide the classification method (SVM, ARN...), use one array for training (calling the training function of the method) and evaluate the classifier with the other array (calling the 'sim' function of the method).
In Matlab, you should first create a matrix for training and a matrix for the test. Each row in the matrix is considered an instance (training or test vector). We call each element of the vector feature.. So, the matrix is n*m where n is the number of instances that you have and m is the number of features. However, in matlab you should use the transpose of the matrix. Suppose that your matrix is named A. In matlab you should use the transpose of A like this A'.
I recommend you to use PRTools, It is the best for classification problems and it is very simple and intuitive to use. Additional the documentation is great and there is a book on pattern recognition using it. You can find all that in the link below
I have problem in construct matrix for train or test, because i used cell matrix to create matrix of vectors which make matlab give the following error
Error using NaiveBayes.fit (line 11) TRAINING must be numeric..
For two class SVM there are two function for train and test: "svmtrain" and "svmpredict".
For LDA: cls = ClassificationDiscriminant.fit(...), [label,score,cost] = predict(cls,...);
there also decision there and Bayesian classifier available in Matlab. You need only search classification in the help search bar and it shows you several examples in this regard.
Another approach to classifying arrays of vectors is to define a tolerance relation, which makes it possible to assign each vector to a tolerance class. For example, a vector x belongs to a class A, provided x close enough to each vector in the class A.
still your question is unclear, because you said "elements of matrix was column vector" that contains numbers. Each element of a matrix should be a number and not another vector. I think this was the cause of your problem. If the matrix is n*m then you will have n instances and each instance will have m features. The value of each feature is a number.
Do you mean by BOW "Bag of words"? . No matter what representation you are using, the most important issue is to respect the form of representation used by the machine learning tool that you are using. As i said before, if you use matlab each element of the matrix should have a numerical value. So, if you use Bag of words representation then first you should define the dictionary which is the list of features (with size m) of your machine learning model. Then, you will construct the training data (n training instance) where each instance have the same size as the dictionary (size=m). For the test matrix you do the same.