I'm working on a project that needs an advertisement targeting algorithm. I don't know much about the space, so I'm here to ask how to get started.

The interesting thing about this problem is that I have no access to ad performance metrics. So the targeting algorithm will have to be rule based, not an ML algorithm that optimizes for clicks. For instance, advertisers will say 'Show this ad to iOS users from Australia'.

Let's assume I have several features (user's IP address, browser, etc) and a large number of advertisements, each with a few matching rules which evaluate to true/false for a given input of features. How can I efficiently match the advertisements to the input? I'd like to know the list of ads that match, and maybe a score based on the number of matching rules and some weight coefficient for each type of rule.

Naively, I could store all of these ads/rules in memory and evaluate all of them for each input. This seems like it would be slow, and once there are bajillions of ads, it seems like it would be impossible to hold the ads in memory on one machine.


  • $\begingroup$ It depends on what form the rules can take. What can you tell us about the form that rules can take? Can you formalize the problem? I gather that for each ad there are multiple rules, that evaluate to true/false, and you want to find the ad that has the largest number of matching rules. What can a rule look like? Is a always conjunction of clauses? What can a clause look like? $\endgroup$ – D.W. Nov 22 '17 at 1:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.