www.pmetrics.com

Eigentaste Applications Library (EAL)

The EAL simplifies the process of implementing a powerful new approach to scaleable collaborative filtering. The library relies on a few key abstractions of the collaborative filtering process:

Containers from the C++ Standard Template Library (STL) are used throughout for maximum ease of integration with existing code bases.

Usage Examples

Here are some simple examples for how to use each of the primary classes.

Rating

Rating has a very simple interface. Individual rating elements are named entities and are set by adding name-value pairs to a rating object.
      string name;
      double rating_val;
      rating one_rating;
      vector< rating > my_ratings;

      // loop over all rating items and  set name and rating value
      one_rating.add( name , value );
      
      my_ratings.push_back( one_rating );  // add rating to vector
    
Ratings are fairly robust objects -- for example, ratings return a recognizable bad value if a requested rating element is not found. More on how eigenspace handles rating objects will be discussed in the Eigenspace section.

Eigenspace

Eigenspace has a lot of detailed functionality. Most users will probably use the small set of high level services provided by the library rather than the lower level technical interface. Here's an example of how the high level services are used:

     // load names of rating items used to generate 
     // the space into a list
     list< string > names;

     // construct a space with the list and the maximum 
     // magnitude of useable ratings
     eigenspace< DynamicND > space( names, 10.0 ); 

     // simple example of loading the number of clusters for each
     // dimension -- this a technical detail and can be hidden from 
     // the application if necessary
     vector< size_t > cuts( 3 );
     cuts[0] = 5; cuts[1] = 3; cuts[2] = 2;

     bool success = space.set_strategy_dimensions( 3, cuts );

     // generate the space with a vector of ratings filled earlier --
     // returns the number of actual ratings used. 
     int useable = space.generate( my_ratings );

     // example error checking
     if( useable != my_ratings.size() )
        cerr << "Found some bad ratings" << endl;

     string my_savefile = "saveme.space";
     space.save( my_savefile );

 
Eigenspace also provides some high level statistical procedures for determining the mean and variance of ratings for each rating element within each user cluster.

Profile

Profile is also very simple. When queried for the primary cluster, it returns a string with the name of the users cluster.

      // load a space object from disk
      eigenspace< DynamicND > space( my_savefile );

      rating one_rating;
      // fill in rating for a user
      
      profile my_profile = space.get_profile( one_rating );

      string my_cluster = my_profile.prime_cluster();

    
Profile can easily be extended to handle multiple clusters with differing weights for a single user. Then, a call to prime_cluster() would return the cluster id with highest weight.
Last modified: Thu Sep 14 15:02:04 PDT 2000