Math::Preference::SVD

Math::Preference::SVD is a preference/recommendation engine based on Single Value Decomposition (SVD).
Download

Math::Preference::SVD Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Scott Walters
  • Publisher web site:
  • http://search.cpan.org/~swalters/Math-Preference-SVD-0.01/lib/Math/Preference/SVD.pm

Math::Preference::SVD Tags


Math::Preference::SVD Description

Math::Preference::SVD is a preference/recommendation engine based on Single Value Decomposition (SVD). Math::Preference::SVD is a preference/recommendation engine based on Single Value Decomposition (SVD).SYNOPSIS use Math::Preference::SVD; my $x = Math::Preference::SVD->new; my @users = (0..3); my @movies = (0..3); my @ratings = ( map({ } @users), # *everyone* says item 0 is rated 4 map({ } @users), # *everyone* says item 1 is rated 5 map({ } @users), # *everyone* says item 2 is rated 1 map({ } @users), # *everyone* says item 3 is rated 2 ); $x->set_ratings( @ratings, ); for my $cust (@users) { for my $movie (@movies) { # predict_rating() takes movie_id then cust_id -- yes, # this seems backward to me too my $predicted = sprintf "%1.2f", $x->predict_rating($movie, $cust); print "cust $cust says about movie $movie: predicted: $predicted"; } }This module imples a simple "preference engine" based on one of the entries to the NetFlix Prize competition. Preference engines take user rating data for items and attempt to predict the user's rating for other items so that a system might find and suggest to them other things they're likely to purchase or enjoy.Single Value Decoposition takes a large rectangular array of data and decomposes it into two matrices, one as long as the data and one as wide, that approximates the original matrix. here and there.And then it does it again, starting with the error left off by the first set of matrices, making a second set of long and wide matrices. And then it does it again. The result is a series of matrices that can be multiplied together, and their outputs totaled up, to approximately reconstruct the original.The large input matrix might, for instance, have customers in the columns and movies in the rows, with data filled in here and there to specify that customer's rating of that movie. Each set of matrices, with a tall one (for movies) and a wide one (for customers), could be thought of as containing information about some tangible attribute of the movies being rated and how the user feels about that attribute. See the references below for an awesome example of the first three attributes extracted from the NetFlix Prize data.Extrapolation is a side-effect of this lossy compression scheme. This is where the recommendation engine bit comes into play -- you can ask the thing for ratings by a customer that that customer never made, and it'll dutifully multiply the customer's features versus the movie's features for the various features, add them up, and give you a predicted rating for that movie for that user. By iterating over all of the movies (and I say movies, but the user could be rating anything, including other users) and asking for predictions for a specific user for that movie, and sorting the results, you can come up with a list of recommendations that he or she or it might like. Requirements: · Perl


Math::Preference::SVD Related Software