Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

I'm currently trying to rank a set of data. The issue is that my initial rank comes from a search on google and the returning result set.

The spread in values is ranging from 33 all the way up to 1580000000. This makes it very hard, at least as far as my skill set goes, to apply any sort of modifiers to these numbers.

What I'm wondering is if there is a way to normalize the data into a close range. I do NOT care about the difference between the numbers as long as the original order is kept.

I have no clue what tag to post this under so I apologize for that right off the bat.

Thank you Bruce

share|improve this question
    
Raise them to some power like $1/8$ if it is the ratio that is of interest (which seems to be the most likely scenario given your circumstances). –  fedja Feb 24 '13 at 19:07
    
Or take logarithms (ratios translate into differences). What do you want to do with the data? –  vonbrand Feb 24 '13 at 19:10
    
I'm working in PHP so basically any math function. What I'm trying to do is once the data is normalized there are other modifiers that will be applied to that number which will change ranking. The dataset is going to be a few hundred thousand rows by the time all is said and done. –  TheEditor Feb 24 '13 at 19:19
    
@fedja actually that works really well. Unless there is a reason to not go that route that makes everything much more manageable. –  TheEditor Feb 24 '13 at 19:24

1 Answer 1

What tools are at your disposal, and how large is the dataset? One easy way is to simply sort the data by original rank and relabel each entry. I can show an easy way to do this in Excel, and I'll include some basic program code below that does the trick, too.

First, sort the data using the standard Excel sort menu.

Select "Sort"

Configure the sort appropriately (ascending order of rank, has headers):

Configure sort options

Use Excel's auto-complete to relabel the data entries Relabel data

Done! Done!

Pseudocode for a programmatic attempt:

structure searchStruct {
   //Keep track of original rank, search text, and your new rank.
   int GoogleRank;
   String searchText;
   int myRank;
}

main{
  //Load in data
  searchStruct[] allData = <Some method of loading in data>;

  //Sort data
  sort allData by GoogleRank;

  //Relabel (the -1 for the array index is b/c of 0-based array)
  for (int i = 1; i <= allData.length; i++) {
    allData[i-1].myRank = i;
  }
}
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.