Oracle9iAS Personalization Programmer's Guide Release 2 (v9.0.2) Part Number A95245-02 |
|
The OP (Oracle9iAS Personalization) RE Batch API (Recommendation Engine Batch Application Programming Interface) enables an application written in Java to request Oracle9iAS Personalization-style recommendations in bulk mode.
RE Batch API was designed to be extensible, to minimize the number of API functions, to be uniform, and to keep the number of arguments to a minimum.
Chapter 9 contains examples of how to perform common tasks using RE Batch API.
Appendix B contains a complete example of RE Batch API usage.
RE Batch API classes and methods are described in detail in the Javadoc in the OP section of the Oracle9i Application Server Documentation Library
Before you can use RE Batch API methods, OP must be installed and the appropriate tables must be created and populated. Your database tables must be converted to the OP schemas. It is important that the OP MTR is populated with customer profiles. You should also create tables or views containing the customer IDs for which you want recommendations.
If you are using one or more taxonomies, they must be properly specified.
At least one OP package must have been built and deployed. Use the OP administrative interface to do this. For an example of how to create and deploy a package, see Oracle9iAS Personalizaton User's Guide.
Note: Do not deploy a package while an RE Batch call is in progress; do not start an RE Batch call while a deployment is in progress. Either of these activities causes an exception. |
This section describes the collections of methods that make up the RE Batch API and concepts and terms used in the description of the API.
End users (users of a Web site that uses OP for recommendations) are divided into two groups: customers and visitors. A customer is a registered user, who can be identified by a unique customer ID assigned by the Web application. The RE Batch API makes recommendations for customers only.
Recommendations are based on historical data, which is stored in the database and retrieved when the customer profiles are loaded.
Before you execute an RE Batch program, you must
Before you can execute RE Batch API methods, the following must be true:
The OP administrator's guide and the online help for the OP administrative GUI explain how to perform these steps.
Customer profile data resides in the MTR.
You cannot get recommendations until there is an existing deployed package, which is created using the OP administrative interface. You must build a package before you deploy it. You cannot build a package until there is some data available; data is converted from existing data collected by your Web application and stored in an Oracle database.
When you design an OP application, you must decide if there should be more than one RE and, if there are several REs, how to use them. We recommend that the REs used for bulk recommendations not be used for any other purpose. For a discussion of the design considerations, see "Recommendation Engine Usage" in Chapter 9.
Recommendations may want to take income level (salary) into consideration; for example, you may want to recommend items that the user can afford to buy. If the items that are recommended have prices in several currencies (for example, items are sold in Japan and India), see "Handling Multiple Currencies" in Chapter 9.
OP includes a sample Java program that illustrates the use of many of the RE Batch API methods; the program is in Appendix B. There are also some examples of how to perform typical tasks in Chapter 9.
Before you can use any of the RE Batch API methods, you must create at least one REBatchProxy
object; see Chapter 9 for details. The object establishes a JDBC connection to a specified database and schema. The connection exists until it is explicitly destroyed.
To use the API, you must create instances of the objects used by the API method signatures. Use the RE Batch API supporting classes, described in Chapter 8, to create these instances. It is always necessary, for example to create filtering settings and tuning sessions. For examples, see Chapter 9.
OP generates recommendations based on data describing past user behavior.
User data stored in an Oracle table must be transformed and stored in the Mining Table Repository (MTR) before it can be used to generate recommendations.
OP stores customer profiles in the Mining Table Repository (MTR). The profiles to be used must be loaded into an RE before any recommendation requests are made. The following methods manage load and unload customer profiles from an RE:
Before you load a set of customer profiles, you must create a table or a view containing a list of the customer IDs that identify the profiles that you wish to load, that is, a list of the customer IDs for which you want a recommendation.
To get a recommendation, the application calls one of the following recommendation methods:
These methods are used for getting recommendations for customers (registered users).
Ratings in OP are in "ascending order of goodness", that is, the higher the rating, the more the user prefers the item. Low-rated items are items that the user does not prefer. OP algorithms use these assumptions, so it is important that ratings are in ascending order of goodness.
OP uses rule tables stored in the RE to calculate the recommendations requested by the methods listed above. The specific rule table used depends upon the RE Batch API method used. In general, the antecedents of the rules are matched against the historical data and the probabilities of the various consequents are computed. These items are then ordered by probability, and numberOfItems
(an API argument) items are returned. The recommendations are written to a database table.
If there is enough memory in the RE database, the RE caches all rules associated with a particular package deployed from the MTR to the RE, not just the most recent rules.
For scoring, all available historical data is used.
The OP Mining Table Repository (MTR) contains historical rating, transactional data, and navigational data stored in both detailed and aggregated formats. The MTR also contains demographic data. When scoring for customers, the RE retrieves the demographic data and the aggregated version of the other data source types.
RE Batch API methods that make recommendations write the recommendations to a database table. The schema used for the output depends on the method used. You can extract the recommendations in many ways, for example, with an appropriate SQL query, and then decide which recommendations to pass to the user.
Before you exit the application, you should destroy any proxy objects that you no longer need.
|
Copyright © 2001, 2002 Oracle Corporation. All Rights Reserved. |
|