Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Do any algorithms exist to weight various factors?

Tags:

algorithm

Sorry in advance if I'm not explaining this correctly. I want to know if there are algorithms to weight various factors in a decision process.

I was reading programming collective intelligence and there's a chapter where you build a search engine and use various factors to rank webpages(pagerank, frequency of words, distance of words, words in title, etc..). Basically in their example code they have all the factors as functions in a class and then use this command to score them:

weights=[(1.0,self.locationscore(rows)), 
                 (1.0,self.frequencyscore(rows)), 
                 (1.0,self.distancescore(rows)),
                 (1.0,self.pagerankscore(rows)),
                 (1.0,self.linktextscore(rows, wordids))]  

Each factor is ranked equally(1.0), but I was wondering if there was a way to dynamically make different factors weight differently without manually setting the weights? In the book, they go on to use neural networks to study users clicks but the above weights remain the same.

I get a feeling there's a non-static way to do this, but not sure what. Any suggestions of how to approach this would be great.

Thanks in advance

Note: if you would like the example code from the book, its http://examples.oreilly.com/9780596529321/ and the chapter I'm referring to is chapter 4. Also if I'm not explaining anything correctly please let me know and I'll update my question.

like image 853
Lostsoul Avatar asked Jan 25 '12 06:01

Lostsoul


People also ask

Can algorithms be biased?

Since both human and algorithmic decisionmakers introduce the possibility of bias, removing algorithms entirely isn't always the best approach. In fact, in some cases, biased algorithms may be easier to fix than biased humans.

How does algorithm affect us?

In a world filled with more content than we could ever possibly consume, algorithms are a necessary part of the internet. But algorithms can also have unintended consequences, like creating filter bubbles, perpetuating bias, and undermining our creativity, choices, and opportunities.

How do algorithms work?

An algorithm is a coded formula written into software that, when triggered, prompts the tech to take relevant action to solve a problem. Computer algorithms work via input and output. When data is entered, the system analyses the information given and executes the correct commands to produce the desired result.


1 Answers

First define your utility function: How to estimate if one solution in better then the other. One common utility for the problem you described is recall and precision and the F measure.

Also, create an evaluation set: Build a set of queries, and a set of expected answers for these queries.

Now, you can tune your weighting functions with any AI optimizing algorithm, such as hill climbing or genetic algorithms. In these optimization algorithms, your variables are the weights for each algorithm, and you try to optimize your utility functions.

Note: If your search engine API allows some explicit feedback, you might also use the same method to keep tuning on the fly: after enough users had indicated what is the "correct" answers for queries, you can add it to your evaluation set, and run your tuning algorithm again.

like image 106
amit Avatar answered Oct 26 '22 00:10

amit