3 ms·
I must have been seriously tired when I gave you the original answer, but I frantically scrambled back and rewrote it and it should be correct now. It's really
by Eliezer 17y ago
I must have been seriously tired when I gave you the original answer, but I frantically scrambled back and rewrote it and it should be correct now. It's really scary the way my ability to do elementary math deteriorates after going on a two-hour walk.
Please reply so I know you got this and that you didn't run off to use the wrong original answer.
- DanielBMarkham 17y agoGetting to one of my original questions, just to tie up the thread, yes, I will need to track totals of like-tag1, dislike-tag1, like-tag2, dislike-tag3, like-tag4, dislike-tag4 But I will not need to keep track of like-tag1-tag2, like-tag1-tag3, ... like-tag1-tagn. dislike-tag1-tag2, etc. Because I can pre-compute a couple of totals for each tag and then compute the likelihood off the totals. But if I had to track the cartesian product it would become almost impossible to precompute anything. (I want to prevent having to walk a tree or sift a list each time I make a prediction, as it needs to all happen very quickly)
- Eliezer 17y agoRight. You need the total number L and D of items each user has liked or disliked. You need the total number of liked items LT, and the total number of disliked items DT, which have the tag T. Then you just iterate through the tags and multiply the prior odds by (LT/L):(DT/D) for each tag. (To avoid zeroes, you could add 1 to all the numbers above.) This will usually give you a unrealistically extreme probability estimate at the end, but it's sometimes good at classifying positive vs. negative cases. Runtime should be linear in the number of tags. If that doesn't work - don't be too surprised if it fails! - then it's time to either find something off-the-shelf, crack a textbook or hire an expert.