|
Compare Ratings, and Return Similar Tastes
Description
Lets say you have 5 books... and 5 people rate each of those books. Now you want to find out who's interests, based on each users 5 ratings, are similar to who?
That's what this algorithm calculates.
Technical
Similar to the Euclidean algorithm, or as though i have been told.
Source Code
|
|
More PHP (Hypertext Preprocessor) Source Codes By VBAssassin
|
|
Please login to post comments. |
|
Hi ya gunni,
It's nice to get a comment saying "Very nice code! Very readable." after 4 months of not writing much advanced code (taking it easy cus of my hands problem). So hey, not lost the ability to code... yet!!! lol
I actually didn't know about the abs function... not so sure why i didn't use array_slice though, sure there was a reason at the time :-S fortunately can't remember now though.
Thanks for taking the time to comment.
Kind regards,
Scott
|
|
Very nice code! Very readable.
Your function get_matches should have used array_slice ( [url]http://www.php.net/manual/de/function.array-slice.php[/url] ), though.
And get_difference should have used abs() as discussed in the forum ;)
|
|
 |
Scott Thompson (24) United Kingdom, Lincolnshire |
|
VBAssassin has 32 fans
become a fan |
|
 |
|
 |
|