I want to develop a site which can compare two products based on their features.
I want to store features as attributes in database. For example, Cellphone is a product so ‘Screen Type’ and ‘Screen Resolution’ are attributes and their values could be LED/AMOLED and 800×400/340×230.
Database could be of Cellphone/Laptop/TV but database will be for one product type only.
I want to know if there are any algorithms to find out best of two depending on their attributes?
Any suggestion/pointers will be more appreciated.
Here’s a possible algorithm, but it won’t be applicable to multiple users/customers unless they share your same preferences (and disposable income!). I’ve done something roughly like this when looking for an apartment:
Step 1: For each feature, map the different options to a numerical value. I don’t know much about cell phone screens, but let’s say you consider an AMOLED screen to be worth 20% more than an LED screen. Values that are already numeric can either be mapped discretely or using an equation.
Step 2: Give each feature a weight.
Step 3: For each feature, multiply the weight by the value; add these up and you have a score for each product. Whichever product has the highest score wins.
For example, say each cell phone has these parameters:
Mapping each parameter to a value, such that something twice as valuable is twice as high:
And your relative weights are:
Compute score for cell phone #1 with an 800x400px, 3×4 inch, LED screen, weighing 40g, with 48 hours of battery life would get a score of:
Compute score for cell phone #2 with an 100x100px, 2×1.5 inch, AMOLED screen, weighing 8g, with 200 hours of battery life would get a score of:
So the second phone is “best”. Other parameters, especially cost, should probably be included in the score.
Accurate results will require accurate mapping to a numerical scale and accurate relative weights – not an easy task, even to decide for yourself. You could allow users to set their own relative weights, perhaps…