Clean scraping API
(2013-04-05, 09:58)natethomas Wrote: That part could be tricky for very specific British dramas. I think there are a few shows that run a good hour and half that would technically be considered TV shows, like Sherlock and probably various Dr. Who Christmas Specials (Never watch Dr. Who, so I can't say for certain on that one).

I think the solution's quite clear, we're looking for a yes-or-no oracle function simply that doesn't exist. It's a good example of what I said above, "you can't add a rule that says "If it's a banana, then it's yellow" because it might be green". I'll be surprised if we ever see a rule where time is a major deciding factor in the movie vs. tv show decision.

HOWEVER, if we're considering this, we would need to be relatively certain of our assertion. The way to do this requires knowing P(move|time), the probability that our file is a movie given the runtime. That's hard to calculate, but with bayes' theorem, this isn't:
Code:
```.          P(time|movie) * P(movie) --------------------------------------------- [ P(time|movie)*P(movie) + P(time|tv)*P(tv) ]```
where P(movie) and P(tv) are the percentage of movies and TV shows in XBMC libraries (I'd use 50/50 to be safe), and P(time|movie) and P(time|tv) are the file runtime fit to a distribution of average movie/tv show times.

For example, assuming 1000 movies from tmdb and tv shows from tvdb were sampled, and we decided a normal distribution was appropriate with movies averaging 120 minutes with σ = 40 mins, and tv shows averaging 30 minutes with σ = 10 mins. If the runtime was 30 minutes, then P(time|tv) = 1.0 and P(time|movie) = 1 - erf(|t - µ| / (σ * sqrt(2))) = 1 - erf(|30m - 120m| / (40m * sqrt(2))) ~= 2.44%. P(move) and P(tv) are both 0.5, so the probability that it's a movie given a 30 minute runtime is 0.0244 * 0.5 / (0.0244 * 0.5 + 1.0 * 0.5) = 2.38%.

So, runtime-based movie/tv show detection is still on the table, we just have to agree on a safe degree of belief. And like I said earlier, "dont throw away data" - like inference rules, bayes' theorem lets us chain together rules that build a degree of belief on a base of evidence. Being able to propagate these calculations forward alongside inference rules would allow for some powerful combinations of conditional probability.

 Messages In This Thread Clean scraping API - by topfs2 - 2012-06-14, 19:33 RE: Clean scraping API - by olympia - 2012-06-14, 22:38 RE: Clean scraping API - by DonJ - 2012-06-15, 01:36 RE: Clean scraping API - by da-anda - 2012-06-15, 10:27 RE: Clean scraping API - by topfs2 - 2012-06-16, 11:30 RE: Clean scraping API - by da-anda - 2012-06-18, 22:19 RE: Clean scraping API - by DonJ - 2012-06-27, 12:59 RE: Clean scraping API - by lboregard - 2012-07-01, 04:57 RE: Clean scraping API - by topfs2 - 2012-07-04, 10:34 RE: Clean scraping API - by lboregard - 2012-07-04, 12:09 RE: Clean scraping API - by olympia - 2012-06-16, 12:02 RE: Clean scraping API - by topfs2 - 2012-06-16, 17:05 RE: Clean scraping API - by Maxoo - 2012-06-17, 01:19 RE: Clean scraping API - by RockerC - 2012-06-20, 15:38 RE: Clean scraping API - by NEOhidra - 2012-06-19, 16:25 RE: Clean scraping API - by solidsatras - 2012-06-20, 09:40 RE: Clean scraping API - by Hitcher - 2012-06-20, 10:08 RE: Clean scraping API - by Martijn - 2012-06-20, 10:16 RE: Clean scraping API - by Montellese - 2012-06-20, 10:13 Re: Clean scraping API - by Martijn - 2012-06-20, 16:34 RE: Clean scraping API - by Martijn - 2012-06-20, 21:04 RE: Clean scraping API - by jmarshall - 2012-06-20, 23:46 RE: Clean scraping API - by solidsatras - 2012-06-30, 16:09 RE: Clean scraping API - by Thorbear - 2012-06-30, 13:53 RE: Clean scraping API - by TheAstronaut - 2012-07-02, 16:39 RE: Clean scraping API - by spiff - 2012-07-03, 18:53 RE: Clean scraping API - by TheAstronaut - 2012-07-03, 21:03 RE: Clean scraping API - by Martijn - 2012-07-04, 11:37 RE: Clean scraping API - by topfs2 - 2012-07-07, 12:43 RE: Clean scraping API - by kimp93 - 2012-08-22, 03:28 RE: Clean scraping API - by topfs2 - 2012-08-22, 11:37 RE: Clean scraping API - by aptalca - 2012-07-24, 21:37 RE: Clean scraping API - by kimp93 - 2012-08-23, 05:26 RE: Clean scraping API - by topfs2 - 2012-08-23, 11:53 RE: Clean scraping API - by malte - 2013-03-03, 10:10 RE: Clean scraping API - by topfs2 - 2013-03-06, 09:19 RE: Clean scraping API - by garbear - 2013-03-06, 08:09 RE: Clean scraping API - by garbear - 2013-03-06, 10:11 RE: Clean scraping API - by malte - 2013-03-06, 18:01 RE: Clean scraping API - by topfs2 - 2013-03-11, 15:11 RE: Clean scraping API - by garbear - 2013-03-30, 16:09 RE: Clean scraping API - by topfs2 - 2013-03-31, 20:00 RE: Clean scraping API - by garbear - 2013-04-01, 07:35 RE: Clean scraping API - by malte - 2013-04-02, 14:25 RE: Clean scraping API - by topfs2 - 2013-04-02, 15:03 RE: Clean scraping API - by garbear - 2013-04-02, 16:56 RE: Clean scraping API - by N3MIS15 - 2013-04-03, 07:12 RE: Clean scraping API - by garbear - 2013-04-03, 11:27 RE: Clean scraping API - by topfs2 - 2013-04-04, 08:59 RE: Clean scraping API - by malte - 2013-04-03, 12:56 RE: Clean scraping API - by garbear - 2013-04-04, 08:38 RE: Clean scraping API - by natethomas - 2013-04-04, 10:23 RE: Clean scraping API - by topfs2 - 2013-04-04, 10:56 RE: Clean scraping API - by natethomas - 2013-04-05, 09:58 RE: Clean scraping API - by da-anda - 2013-04-05, 11:25 RE: Clean scraping API - by Bstrdsmkr - 2013-04-05, 16:05 RE: Clean scraping API - by topfs2 - 2013-04-05, 12:27 RE: Clean scraping API - by garbear - 2013-04-05, 16:27 RE: Clean scraping API - by jmarshall - 2013-04-06, 07:36 RE: Clean scraping API - by topfs2 - 2013-04-10, 08:38 RE: Clean scraping API - by natethomas - 2013-04-10, 09:28 RE: Clean scraping API - by garbear - 2013-04-10, 09:42 RE: Clean scraping API - by N3MIS15 - 2013-04-10, 10:40 RE: Clean scraping API - by garbear - 2013-04-10, 09:34 RE: Clean scraping API - by topfs2 - 2013-04-10, 13:29 RE: Clean scraping API - by garbear - 2013-04-10, 13:43 RE: Clean scraping API - by topfs2 - 2013-04-10, 13:58 RE: Clean scraping API - by jmarshall - 2013-04-10, 10:05 RE: Clean scraping API - by garbear - 2013-04-10, 12:08 RE: Clean scraping API - by topfs2 - 2013-04-11, 11:07 RE: Clean scraping API - by N3MIS15 - 2013-04-11, 11:32 RE: Clean scraping API - by topfs2 - 2013-04-11, 11:42 RE: Clean scraping API - by jmarshall - 2013-04-11, 09:00 RE: Clean scraping API - by topfs2 - 2013-04-11, 11:04 RE: Clean scraping API - by garbear - 2013-04-11, 12:05 Re: Clean scraping API - by queeup - 2013-04-11, 16:58 RE: Clean scraping API - by topfs2 - 2013-04-11, 18:04 Re: Clean scraping API - by queeup - 2013-04-11, 19:44 RE: Clean scraping API - by garbear - 2013-04-11, 21:41 Re: Clean scraping API - by queeup - 2013-04-11, 22:05 RE: Clean scraping API - by garbear - 2013-04-11, 22:51 RE: Clean scraping API - by topfs2 - 2013-04-17, 10:50 RE: Clean scraping API - by garbear - 2013-05-09, 23:05 RE: Clean scraping API - by TheMonkeyKing - 2013-10-18, 22:31

This forum uses Lukasz Tkacz MyBB addons.