[R] How to rank vectors based on their elements?
savicky at cs.cas.cz
Sun Apr 15 11:25:20 CEST 2012
On Sat, Apr 14, 2012 at 07:10:48PM -0700, Manish Gupta wrote:
> I am working on ranking algo? I have data which is in the form of vectors
> (feature) for each class and i need to rank them based on feature vector.
> I need to rank class1, class2, class3, class4 & class5. How can i implement
I am not sure, whether i understand, what you mean. How many examples
of each class do you have? Do you have one example for each class
consisting of 5 features or you have 5 examples for each class,
where each example is represented by a single number?
The usual format for a classification task is a matrix or data frame
with one column for each feature and one column for the class. The first
interpretation would be represented by the matrix
1 3 4 -2 0 class1
2 0 0 -3 0 class2
2 3 1 4 5 class3
-4 -5 1 0 0 class4
and the other interpretation would be represented by
Is some of this meaningful in your application?
What do you mean by ranking? Do you mean to estimate to which class
belongs a new example not contained in the data above? Another
understanding may be that you want to order the four classes by
some type of average of the numbers assigned to each of them.
More information about the R-help