0

We have a UIPickerView in our app that currently shows its list of options (about 7 of them) in an order set by the code.

I've been asked to add some "intelligent" ordering of these options so that the most commonly used work their way to the top.

My initial thought is to give each option a "score" (even just an integer) and add to it each time the user selects that option but this would not work in some cases.

For instance. Say a user is looking to find the tallest objects for an assignment. They would do lots of searches and sort them by height. This would push up the "height.score" to a high number while everything else remains on 1 or 0.

Now they start looking for things based on weight. Now each time they go into the search the sort option for "height" will be at the top until they do more searches on weight than they previously did on height.

Is there a way to have this same functionality but make it more intelligent?

I'm thinking of something along the lines of the Elo rating system but AFAIK it only works when there are two "players". Is there another rating system that allows for multiple "players"?

This might actually be better suited to programmers exchange. Let me know and I'll put it there instead.

Fogmeister
  • 76,236
  • 42
  • 207
  • 306

1 Answers1

0

You could do scoring that factors in a "recently used" component. Something like: When an option is chosen, add 3 points to that and remove a point (or even multiple by 0.5) from each other option. Also have a maximum cap on the points. In your example this would initially boost "Height" to the top of the list, but a few "Weight" selections would get it to the top, while leaving "Height" in second place for a long time. There's a range of ways to do this, you might want to look at some simulations using different calculations and see what results in sorting that feels best to you.

Endareth
  • 492
  • 3
  • 15