# Use matrix feature for machine learning or cluster analysis

I have a bunch of features that I would like to use for classification/machine learning and cluster analysis. Normally I use single point values or transformations of values for features and everything is fine

Now I would like to use a matrix as a feature. The matrix is probably going to be a fairly big (say 50x50) but will only be filled with 1's and 0's. It is pretty much an 'image' matrix. It is the shape/pattern of the matrix entries which is important.

Is there anyway I can easily use the matrix as a feature for machine learning? I know I could use each matrix entry, say Row1Column1 as a feature and then give it a value, but then I would have 2500 features from my 50x50 matrix, which is what I am trying to get away from.

Any ideas would be greatly appreciated.

• Whether you interpret it as a vector or a matrix doesn't really change anything. I would not worry about 2500 features, that's not big by current standards. – Marc Claesen Oct 21 '13 at 13:11
• thanks marc, I guess its fair enough to use the 2500 points as individual features, I just want to make sure that the machine learning captures the 'shape/relationship of matrix elements' of the matrix vs just concentrating on which features are important and weighting them. But perhaps that is the same thing – AbeeCrombie Oct 21 '13 at 13:38
• @user1449677 What does "pretty much an image" mean? There are a lot of different features you can compute from images, SIFT, HOG, or see the Wikipedia page Feature (computer_vision) as a jump off point. – alto Oct 21 '13 at 15:29

not sure whether the matrix is the only input to your machine learning problem or not but here are a few tips-

Incase you are going for supervised learning you can use convolutional neural networks to solve the problem and feed the matrix as input much like an image ..

Incase you are going for unsupervised learning you can use sparse encoding to represent you matrix as a sum of many many sparse matrix with different coefficients. Just take the ones having high coefficients( it's up to you how many you want to chose )

Read more on sparse encoding for clarity .. Hope this gets you started .

## protected by SycoraxApr 18 at 21:08

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).