Oracle9iAS Personalization Recommendation Engine API Programmer's Guide
Release 9.0.1

Part Number A87536-01
Go To Documentation Library
Library
Go To Product List
Solution Area
Go To Table Of Contents
Contents

Go to previous page Go to next page

3
Using the Recommendation Engine Proxy

This chapter consists of an overview of the methods that are used to manage the recommendation engine proxy, to collect data, and to obtain recommendations, followed by the individual methods listed in alphabetical order. The supporting classes for these methods are described in Chapter 2.

For examples of how to uses these classes and methods, see Appendix A and the complete example in Appendix B.

All of these methods return results in real time. Usually they return recommendations for a single user.

All methods described in this chapter are public.

Overview

The recommendation proxy (REProxyRT) methods can be divided according to function, as follows:

Location of Classes

To use the REProxyRT (and its exceptions), you must include the following statements in your Java program:

import oracle.dmt.op.re.reapi.rt.*;
import oracle.dmt.op.re.reexception.*;

All of these classes reside on the system where Oracle9iAS is installed.

Proxy Creation and Management

REProxyManager handles a pool of REProxyRT instances. Using multiple REProxyRT instances within a JServ provides the following benefits:

Multiple proxy instances can result in the following issues:

The REProxyManager class also includes a caching mechanism that supports data collection in the recommendation engine.

RE Data Collection

The REProxyRT class includes the DataCollection Cache, which supports data collection in the RE. Every time you create an REProxyRT object, the cache is built as a subcomponent of the proxy object. When data is collected using the REAPI calls addItem() and addItems(), the data is stored in the cache (in the memory) and is periodically flushed to RE schema. This "batch save" improves RE performance. The cache is created when a new REProxyRT object is created. The refresh rate is defined by an input parameter to REProxyManager.createProxy().

Currently, only item and user ID data in the classes DataItem and IdentificationData are cached, and they are cached as current session data.

REProxyManager Class

REProxyManager is a singleton implementation, that is, only one instance of the REProxyManager class is created in a particular JVM instance, and the class is loaded automatically.

The REProxyManager class is used to create and manage the instances of REProxyRT. REProxyManager has only static public methods. REProxyManager does not have a public constructor and hence cannot be created by the user. REProxyManager maintains an REProxyRT pool and uses proxy names to reference to individual REProxyRT objects.

The following methods manage REProxyRT objects:

For examples of how to use the proxy manager, see Appendix A and the complete example in Appendix B.

Session Management

The following methods manage sessions:

Data Collection and Management

The following methods collect, preprocess, and store data in RE tables. The collected data can be persisted by setting appropriate configuration parameters:

Recommendations

The following methods obtain and manage recommendations:

Communicating the returned recommendations to the end user is the responsibility of the calling Web application. The calling Web application must also decide which recommendations to pass to the user. For example, the Web application may want to check that an item is in stock before recommending the item.

Ratings in OP

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.

Meaning of Returned Value for Recommendations

The meaning of the value returned for recommendation instances where ItemDetailData.attribute is equal to Enum.RecommendationAttribute.PREDICTION depends on the value of interestDimension as follows:

Rules and Recommendations

OP uses rule tables stored in the RE to generate the recommendations requested by the recommendation methods. The rule tables are created when a package is built and stored in the RE, that is, when the package is deployed. The specific rule table used depends upon the REAPI call made. In general, the antecedents of the rules are matched against the data in cache (both historical and current session 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.

Method Details

The rest of this chapter contains detailed descriptions of the methods, which are listed in alphabetical order.


addItem

A data collection method that adds the specified item to the profile of the user or the session specified by idData. item specifies the data source type, item type, item ID, and value of the item.

Syntax

addItem(IdentificationData idData, DataItem item)

Arguments

idData

Identifies a user or a session. item is added to this user's profile or this session.

item

Item, of type DataItem, to be added to the specified user's profile.

Exception

BufferIsFullException

Usage Notes

Items are cached locally at the REAPI and synchronously written to the RE; the frequency of the writes is specified as a configuration parameter when OP is installed. It is important that the data synchronization interval is frequent enough to support the Web applications' requirements. For more information about data synchronization, see the administration guide.

When an application needs to add several items at a time, it can either use several addItem calls or one addItems call. When using addItems, the application must maintain the details of the items to be added until the call is made; in other words, the application needs to keep the state. It may be simpler to issue several addItem calls.

addItem and addItems are asynchronous, so the calling application does not need to wait until either call saves the data to the database.


addItems

A data collection method that adds one or more items to the profile of the user or the session specified by idData. item[i] specifies the data source type, item type, item ID, and value of the ith item. The items are stored in an array.

Syntax

addItems(IdentificationData idData, DataItem[] items)

Arguments

idData

Identifies a user or a session. The items specified by items are added to this user's profile or this session.

items

The items, an array of type DataItem, to be added to the specified user's profile or the specified session.

Exceptions

BufferIsFullException

Usage Notes

Items are cached locally first and synchronously written to the RE; the frequency of the writes is specified as a configuration parameter when OP is installed. It is important that the data synchronization interval is frequent enough to support the Web applications' requirements. For more information about data synchronization, see the administration guide.

When an application needs to add several items at a time, it can either use several addItem calls on one addItems call. When using addItems, the application must maintain the details of the items to be added until the call is made; in other words, the application needs to keep the state. It may be simpler to issue several addItem calls.

addItem and addItems are asynchronous, so the calling application does not need to wait until either call saves the data to the database.


closeSession

Closes a session and marks the session as closed. Session data corresponding to closed sessions is either purged or archived by a data synchronization process that runs periodically. Archiving or purging and the frequency of synchronization are specified as configuration parameters of the recommendation engine schema (RE schema). For more information about data synchronization, see the administration guide.

If the calling Web application does not call this method explicitly, the session times out after a specified time interval. The time-out interval is specified as a configuration parameter of the RE schema.

The application can also configure the RE to not time out any sessions. In this case, the calling Web application must close all sessions explicitly using this method. If sessions are not closed (and do not time out), the RE tables may fill up rapidly. When the tables are large, recommendation performance is poor; furthermore, disk space may be exhausted.

See the administration guide for information about setting configuration parameters.

Syntax

closeSession(IdentificationData idData);

Arguments

idData

Identifies the session to close.

Exceptions

REProxyInitException is raised if the session corresponding to the idData does not exist.

BadDBConnectionException

ConnectionPoolIsFullException

InvalidIDException

ErrorExecutingRE

Usage Notes

This method is used by sessionful Web applications only.


createCustomerSession

Creates a new session for the specified customer (registered user). This method is used by sessionful applications that keep track of session state for existing customers.

OP maintains the mapping between appSessionID and customerID. In subsequent calls, the calling application uses appSessionID to identify the customer session.

Syntax

createCustomerSession(String customerID, String appSessionID);

Arguments

customerID

Type String, assigned by the calling Web application

appSessionID

Type String, session ID assigned by the calling Web application or null if unknown

Exceptions

Throws InvalidIDException if customerID or appSessionID is null.

BadDBConnectionException

ErrorExecutingRE

REProxyInitException

StringTooLargeException

ConnectionPoolIsFullException

Example

createCustomerSession("100", "Session1");

Usage Notes

This method is used by sessionful Web applications only.

The calling Web application must provide session IDs that are unique among currently active sessions. If this method is invoked with a session ID that is currently active at the RE, an exception is thrown. However, a session ID can be reused as long as that session ID is not already active at the RE. appSessionID is synchronized to the MTR by OP. (For more information about data synchronization, see the administration guide.) If the calling application requires session IDs to be unique, its the responsibility of the calling Web application to ensure that appSessionID values are also unique.

OP has no way to tell if customerID and appSessionID are valid values; it is the responsibility of the calling Web application to verify that these values are valid.


createProxy

Creates an object of type REProxyRT. A proxy connects to a specific RE database and logs in to the database.

The proxy object includes a DataCollection Cache, which caches data collected by addItem() and addItems() methods; collected data is periodically written to the recommendation engine (RE) at the interval specified in the interval argument.

Syntax

REProxyManager.createProxy(String proxyName,
String dbURL,
String userName,
String passWord,
int cacheSize,
int interval);

Arguments

proxyName

Type String, the unique name of the object being created

dbURL

Type String, the JDBC database URL, in the format jdbcdriver:@hostname:portnumber:SID, where jdbcdriver is either jdbc:oracle:thin or jdbc:oracle:oci8; hostname is the name of the database host machine (as specified by the DBA); portnumber is the port number of the database instance (see your DBA for this); SID is the service ID of the database instance (see your DBA for this). For example, "jdbc:oralce:thin:@dbserver1.mycompany.com:1521:MYDB1"

userName

Type String, the database login name

passWord

Type String, the database password


Note:

dbURL, userName, and passWord combine to specify the RE schema that you plan to use. In other words, you must specify the user name and password for the RE schema. 


cacheSize

Integer specifying the cache size used by the recommendation engine, in kilobytes; see "Usage Notes" for information about how to determine an appropriate cache size.

interval

Integer, specifying the cache archive interval, in milliseconds; if interval is set to 10000, data is archived every 10 seconds. See "Usage Notes" for information about how to determine an appropriate interval.

Return Value

An REProxyRT object named proxyName or null, if the call fails

Exceptions

REProxyInitException

StringTooLargeException

Usage Notes

Cache Size:

There are several factors to consider when determining the cache size.

  1. System resources: Since cache takes memory space, you must make sure that you have enough memory to do what you want

  2. Archive interval: the longer the interval, the larger the cache size

  3. Maximum VArray size: The PL/SQL procedure that performs the archive uses VArrays and the maximum size is currently set at 5000. The archive can handle more than 5000 items, but the performance is much worse. Therefore, it is not recommended to have the cache buffer larger than 5000. Each data item stored in the cache takes up about 340 bytes; so the maximum VArray size translates to 3.3 MBytes (the actual cache buffer size is half of that since the cache has two buffers)

  4. Data collection rate, the most important factor: If the data collection rate is no more than 100 items per second and the archive interval is 20 seconds, then a reasonable cache size is 100 * 340 * 1.5 * 20, which is approximately 2000 Kilobytes. (This calculation assumes a safety factor of 1.5 to ensure that no data is dropped.)

It takes experimentation to determine an optimum interval coupled with an appropriate cache size.

Interval:

The interval determines how often the collected data is archived (flushed from the memory to RE schema). There are several factors to consider when determining the setting:

  1. Data collection volume and speed: The more frequent the data collection and the larger the volume of data collected, the shorter interval should be

  2. Cache size: The smaller the cache, the shorter the interval.

  3. Use of current session data: if you want to use the current session data to improve the recommendation accuracy, the data should not be held in the cache for too long. If the volume and speed of the data collection is not a problem, an interval of 10 - 30 seconds may be fine.

It takes experimentation to determine an optimum interval coupled with an appropriate cache size.

Example

See Appendix A for examples of use.


createVisitorSession

Creates a new session for a visitor. A visitor is an end user unknown to this site or application (that is, a visitor is not a registered user of the site). The calling Web application may assign specific temporary IDs to these unregistered users in order to track them. This method is used by sessionful applications that keep track of session state for visitors. It is not required for sessionless Web applications.

OP maintains the mapping between appSessionID and visitorID. In subsequent calls, the calling application uses appSessionID to identify the visitor session.

Syntax

createVisitorSession(String visitorID, String appSessionID)

Arguments

visitorID

Type String, the ID assigned by the calling Web application

appSessionID

Type String, the session ID assigned by the calling Web application

Exceptions

Throws an InvalidIDException if visitorID or appSessionID is null.

BadDBConnectionException

ErrorExecutingRE

REProxyInitException

StringTooLargeException

ConnectionPoolsIsFullException

Example

createVisitorSession("101", "Session2");

Usage Notes

OP has no way to tell if visitorID and appSessionID are valid values; it is the responsibility of the calling Web application to verify that these values are valid.

The calling Web application must provide session IDs that are unique among currently active sessions. If this method is invoked with a session ID that is currently active at the RE, an exception is thrown. However, a session ID can be reused as long as that session ID is not already active at the RE. appSessionID is synchronized to the MTR by OP. (For more information about data synchronization, see the administration guide.) If the calling application requires session IDs to be unique, it should check that they are unique at the MTR.


crossSellForItemFromHotPicks

Returns cross-sell recommendations for a specified item from the items in the specified hot picks groups. It answers questions such as: Which N items from the specified hot picks groups are the user most likely to buy, assuming that the user buys the specified item?

Syntax

crossSellForItemFromHotPicks (IdentificationData idData,
Item: item,
int numOfItems,
long[] hotPickGroups,
TuningSettings tunings,
FilteringSettings filters,
RecommendationContent recContent);

Arguments

item

The item for which cross-sell recommendations are required

numberOfItems

Type int, the number of items from the hot picks group to be returned. This number represents the maximum number of items to be returned; the actual number returned may be less.

hotPickGroups

Type long[], an array specifying the hot pick group IDs which identify the hot pick groups used to make recommendations

tuningSettings

Specifies tuning parameters for recommendation, including data source type, personalization index, profile data balance, and interest dimension. Note that interest dimension must be the same as the data source type of the input item. For more information, see "TuningSettings" in Chapter 2.

filters

Specifies filtering parameters for the recommendations, including taxonomy ID, category filtering, category list (optional) and category membership. You can use of You can use one of the following public methods to set these values: setItemFiltering(), setItemExclusion(), or setItemSubTreeFiltering(). For more information, see "FilteringSettings" in Chapter 2.

recContent

Specifies recommendation attributes and sorting; for details, see "RecommendationContent" in Chapter 2.

Return Value

The list of cross-sell recommendations (type RecommendationList).

Interpreting the recommendations depends on the value of personalization index:

For more information, see "Meaning of Returned Value for Recommendations", earlier in this chapter.

Exceptions

NullParameterException

BadDBConnectionException

ClassNotFoundException

ArrayTooLargeException

ConnectionPoolIsFullException

ErrorExecutingRE

ReProxyInitException

Usage Notes

Interest dimension must be the same as that of the data source type of the input item.

Data source type must be either navigational or purchasing. No other types are supported.

The following filtering setting cannot be used with this method:


crossSellForItemsFromHotPicks

Returns cross-sell recommendations for specified items from the items in a specified hot picks group. It answers questions such as: Which are the N items from the specified hot picks group is the user is likely to buy, assuming that the user buys at least one of the specified items?

Syntax

crossSellForItemsFromHotPicks (IdentificationData idData,
Item:[] items,
int numOfItems,
long[] hotPickGroups,
TuningSettings tunings,
FilteringSettings filters,
RecommendationContent recContent);

Arguments

items

The items for which cross-sell recommendations are required

numberOfItems

Type int, the number of items from the hot picks group to be returned. This number represents the maximum number of items to be returned; the actual number returned may be less.

hotPickGroups

Type long[], an array specifying the hot pick groups from which to make recommendations

tunings

Specifies tuning parameters for recommendation, including data source type, personalization index, profile data balance, and interest dimension. Note that interest dimension must be the same as the data source type of the input item. For more information, see "TuningSettings" in Chapter 2.

filters

Specifies filtering parameters for the recommendations, including taxonomy ID, category filtering, category list (optional) and category membership. You can use of You can use one of the following public methods to set these values: setItemFiltering(), setItemExclusion(), or setItemSubTreeFiltering(). For more information, see "FilteringSettings" in Chapter 2.

recContent

Specifies recommendation attributes and sorting; for details, see "RecommendationContent" in Chapter 2.

Return Value

The list of cross-sell recommendations (type RecommendationList).

Interpreting the recommendations depends on the value of personalization index:

For more information, see "Meaning of Returned Value for Recommendations", earlier in this chapter.

Exceptions

NullParameterException

ArrayTooLargeException

ConnectionPoolIsFullException

InvalidIDException

BadDBConnectionException

ClassNotFoundException

ErrorExecutingRE

ReProxyInitException

Usage Notes

Interest dimension must be the same as that of the data source type of the input item.

Data source type must be either navigational or purchasing. No other types are supported.

The following filtering setting cannot be used with this method:


destroyAllProxies

Destroy all REProxyRT objects in the pool of REProxyRT objects.

Syntax

REProxyManager.destroyAllProxies();

Arguments

None.

Return Value

None.

Exceptions

None.

Example

SeeAppendix A and the complete example in Appendix B for examples of use.

Usage Note

This method destroys all proxies in the pool. If you want to destroy one or more specific proxies, use destroyProxy().


destroyProxy

Destroy the specified REProxyRT object in the pool of REProxyRT objects.

Syntax

REProxyManager.destroyProxy(String proxyName);

Arguments

proxyName

Type String, the name of the REProxyRT object to be destroyed from the pool of REProxyRT objects

Return Value

None.

Exceptions

None.

Usage Note

If you want to destroy all proxies in the pool, use destroyAllProxy().


getProxy

Get an instance of the specified REProxyRT object.

Syntax

REProxyManager.getProxy(String proxyName);

Arguments

proxyName

Type String, the name of the REProxyRT object instance

Return Value

An instance of the named REProxyRT object or null if the specified object does not exist

Exceptions

REProxyInitException

Example

See Appendix A and the complete example in Appendix B for examples of use.


rateItem

Returns the degree of interest, computed along an interest dimension, for an item. The degree of interest could indicate, for example, the likelihood that customer X will buy item Y.

Syntax

rateItem(IdentificationData idData,
Item item,
int taxonomyID,
TuningSettings tunings,
RecommendationContent recContent);

Arguments

idData

Type IdentificationData, identifies user or session

item

Type Item, identifies the item to be rated

tunings

Specifies settings to be applied when computing a recommendation; for details, see "TuningSettings" in Chapter 2

recContent

Specifies recommendation attributes and sorting; for details, see "RecommendationContent" in Chapter 2.

Return Value

The degree of interest (type Float).

Exceptions

NullParameterException

InvalidIDException

BadDBConnectionException

ConnectionPoolIsFullException

ErrorExecutingRE

ReProxyInitException


rateItems

Returns the degrees of interest, computed along an interest dimension, for an array of items. The ith degree of interest could indicate, for example, the likelihood that customer X will buy the ith item.

Syntax

rateItems(IdentificationData idData,
Item[] items
int taxonomyID,
TuningSettings tunings,
RecommendationContent recContent);

Arguments

idData

Type IdentificationData, identifies user or session

items

The items to be rated, an array of Item

tunings
Specifies settings to be applied when computing a recommendation; for details, see "TuningSettings" in Chapter 2
recContent

Specifies recommendation attributes and sorting; for details, see "RecommendationContent" in Chapter 2.

Return Value

The degrees of interest, an array of values of type Float.

Exceptions

NullParameterException

InvalidIDException

BadDBConnectionException

ConnectionPoolIsFullException

ErrorExecutingRE

ReProxyInitException

ClassNotFoundException


recommendBottomItems

Returns the degree of interest and other relevant item information for the numberOfItems items with the lowest degree of interest along the specified interest dimension. It answers questions such as: Which are the N items that person X is least likely to buy or like?

Syntax

recommendBottomItems(IdentificationData idData,
int numberOfItems,
TuningSettings: tunings,
FilteringSettings: filters,
RecommendationContent recContent);

Arguments

idData

Type IdentificationData, identifies user or session.

numberOfItems

Type int, the number of cross-sell recommendations to be returned. This number represents the maximum number of recommendations to be returned; the actual number returned may be less.

tunings

Specifies tuning parameters for recommendation, including data source type, personalization index, profile data balance, and interest dimension. Note that interest dimension must be the same as the data source type of the input item. For more information, see "TuningSettings" in Chapter 2.

filters

Specifies filtering parameters for the recommendations, including taxonomy ID, category filtering, category list (optional) and category membership. You can use of You can use any of the "set" methods to set these values. For more information, see "FilteringSettings" in Chapter 2.

recContent

Specifies recommendation attributes and sorting; for details, see "RecommendationContent" in Chapter 2.

Return Value

List of recommended items (type RecommendationList).

See "Meaning of Returned Value for Recommendations", earlier in this chapter.

Exceptions

NullParameterException

InvalidIDException

BadDBConnectionException

ConnectionPoolIsFullException

ErrorExecutingRE

ReProxyInitException

ClassNotFoundException


recommendCrossSellForItem

Returns the degree of interest and other relevant item information for the specified number of items most strongly associated with the target item in the argument list. It answers questions such as: Which are the N items a person is most likely to buy or be interested in, given that he bought or is interested in item Y?

Syntax

recommendCrossSellForItem (IdentifactionData idData,
Item item,
int numberOfItems,,
TuningSettings tunings,
FilteringSettings filters,
RecommendationContent recContent);

Arguments

idData

Type IdentificationData, identifies user or session

item

The item for which cross-sell recommendations are required

numberOfItems

Type int, the number of cross-sell recommendations to be returned. This number represents the maximum number of recommendations to be returned; the actual number returned may be less.

tunings

Specifies tuning parameters for recommendation, including data source type, personalization index, profile data balance, and interest dimension. Note that interest dimension must be the same as the data source type of the input item. For more information, see "TuningSettings" in Chapter 2.

filters

Specifies filtering parameters for the recommendations, including taxonomy ID, category filtering, category list (optional) and category membership. You can use of You can use one of the following public methods to set these values: setItemFiltering(), setItemExclusion(), or setItemSubTreeFiltering(). For more information, see "FilteringSettings" in Chapter 2.

recContent

Specifies recommendation attributes and sorting; for details, see "RecommendationContent" in Chapter 2.

Return Value

The list of cross-sell recommendations (type RecommendationList ).

Interpreting the recommendations depends on the value of personalization index:

For more information, see "Meaning of Returned Value for Recommendations", earlier in this chapter.

Usage Notes

Interest dimension must be that same as that of the data source type.

Data source type must be either navigational or purchasing. No other types are supported.

The following filtering setting cannot be used with this method:

Exceptions

NullParameterException

InvalidIDException

BadDBConnectionException

ConnectionPoolIsFullException

ErrorExecutingRE

ReProxyInitException

ClassNotFoundException


recommendCrossSellForItems

Returns the degree of interest and other relevant item information for the N items most strongly associated with the specified items. It answers questions such as: Which are the N items a person is most likely to buy or be interested in, given that he bought or is interested in items Y1, Y2,..., Yn?

Syntax

recommendCrossSellForItems (IdentifactionData idData,
Item [] items,
int numberOfItems,,
TuningSettings tunings,
FilteringSettings filters,
RecommendationContent recContent);

Arguments

idData

Type IdentificationData, identifies user or session

items

The array of items for which cross-sell recommendations are required

numberOfItems

The number of cross-sell recommendations to be returned. This number represents the maximum number of recommendations to be returned; the actual number returned may be less

tunings

Specifies tuning parameters for recommendation, including data source type, personalization index, profile data balance, and interest dimension. Note that interest dimension must be the same as the data source type of the input item. For more information, see "TuningSettings" in Chapter 2.

filters

Specifies filtering parameters for the recommendations, including taxonomy ID, category filtering, category list (optional) and category membership. You can use one of the following public methods to set these values: setItemFiltering(), setItemExclusion(), or setItemSubTreeFiltering(). For more information, see "FilteringSettings" in Chapter 2.

recContent

Specifies recommendation attributes and sorting; for details, see "RecommendationContent" in Chapter 2.

Return Value

The list of cross-sell recommendations (type RecommendationList).

Interpreting the recommendations depends on the value of personalization index:

For more information, see "Meaning of Returned Value for Recommendations", earlier in this chapter.

Exceptions

NullParameterException

InvalidIDException

BadDBConnectionException

ConnectionPoolIsFullException

ErrorExecutingRE

ArrayTooLargeException

ReProxyInitException

ClassNotFoundException

Usage Notes

Interest dimension must be that same as that of the data source type.

Data source type must be either navigational or purchasing. No other types are supported.

The following filtering setting cannot be used with this method:


recommendFromHotPicks

Returns the degree of interest and other relevant item information for the N items with the highest degree of interest along the specified interest dimension. Items are selected from the hot picks table. It answers questions such as: Which are the N items from a particular set of Hot Picks group is the specified user most likely to buy or like?

Syntax

recommendFromHotPicks(IdentificationData idData,
int numberOfItems,
long[} hotPickGroups,
TuningSettings: tunings,
FilteringSettings filters,
RecommendationContent recContent);

Arguments

idData

Type IdentificationData, identifies user or session

numberOfItems

Type int, the number of items to be returned. This number represents the maximum number of items to be returned; the actual number returned may be less

hotPickGroups

Type long[], an array of hot pick group ID specifying the hot pick groups from which to make recommendations

tunings

Specifies tuning parameters for recommendation, including data source type, personalization index, profile data balance, and interest dimension. Note that interest dimension must be the same as the data source type of the input item. For more information, see "TuningSettings" in Chapter 2.

filters

Specifies filtering parameters for the recommendations, including taxonomy ID, category filtering, category list (optional) and category membership. You can use of You can use one of the following public methods to set these values: setItemFiltering(), setItemExclusion(), or setItemSubTreeFiltering(). For more information, see "FilteringSettings" in Chapter 2.

recContent

Specifies the type of information that a recommendation request should return; for details, see "RecommendationContent" in Chapter 2

Return Value

The list of recommended items (type RecommendationList).

Interpreting the recommendations depends on the value of personalization index:

For more information, see "Meaning of Returned Value for Recommendations", earlier in this chapter.

Exceptions

NullParameterException

InvalidIDException

BadDBConnectionException

ConnectionPoolIsFullException

ErrorExecutingRE

ReProxyInitException

ClassNotFoundException


recommendTopItems

Returns the degree of interest and other relevant item information for the numberOfItems items with the highest degree of interest along the specified interest dimension. It answers questions such as: Which are the N items that person X is most likely to buy/like?

Syntax

recommendTopItems(IdentificationData, idData
int numberOfItems,
TuningSettings: tunings,
FilteringSettings: filters,
RecommendationContent recContent);

Arguments

idData

Type IdentificationData, identifies user or session

numberOfItems

Type int, the number of items to be returned. This number represents the maximum number of items to be returned; the actual number returned may be less

tunings

Specifies tuning parameters for recommendation, including data source type, personalization index, profile data balance, and interest dimension. Note that interest dimension must be the same as the data source type of the input item. For more information, see "TuningSettings" in Chapter 2.

filters

Specifies filtering parameters for the recommendations, including taxonomy ID, category filtering, category list (optional) and category membership. You can use of You can use any of the "set" methods to specify the values. For more information, see "FilteringSettings" in Chapter 2.

recContent

Specifies the type of information that a recommendation request should return; for details, see RecommendationContent in Chapter 2

Return Value

The list of recommended items (type RecommendationList).

Interpreting the recommendations depends on the value of personalization index:

For more information, see "Meaning of Returned Value for Recommendations", earlier in this chapter.

Exceptions

NullParameterException

InvalidIDException

BadDBConnectionException

ConnectionPoolIsFullException

ErrorExecutingRE

ReProxyInitException

ClassNotFoundException

StringTooLargeException


removeItem

Removes the item from the specified session or from the profile of the specified user. This method removes an item that has not been written to the MTR (permanent storage). Data is written to the MTR after the session is closed or times out.

Syntax

removeItem(IdentificationData idData, DataItem item);

Arguments

idData

Identifies a user or a session; the specified item is removed from this user's profile or from this session

item

The item to be removed, of type DataItem

Exceptions

InvalidIDException

BadDBConnectionException

ConnectionPoolIsFullException

ErrorExecutingRE

ReProxyInitException

Usage Notes

This method cannot be used to remove items from a user profile that has been written to permanent storage.

If a specified item is not in the user's profile, OP does nothing.


removeItems

Removes the items from the specified session or from the profile of the specified user. This method removes items that have not been written to the MTR (permanent storage). Data is written to the MTR after the session is closed or times out.

Syntax

removeItems(IdentificationData idData, DataItem[] items);

Arguments

idData

Identifies a user or session; the items specified by items are removed from this session or from this user's profile

items

The items to be removed, an array of type DataItem.

Exceptions

InvalidIDException

BadDBConnectionException

ConnectionPoolIsFullException

ErrorExecutingRE

ReProxyInitException

Usage Notes

This method cannot be used to remove items from a user profile that has been written to permanent storage.

If a specified item is not in the user's profile, OP does nothing.

Example

See Appendix A and the complete example in Appendix B for examples of use.


selectFromHotPicks

Selects the specified number of items from a specified set of hot picks group.

Syntax

selectFromHotPicks (IdentificationData idData,
int numberOfItems ,
long[] hotPickGroups,
TuningSettings tunings,
FilteringSettings filters,
RecommendationContent recContent);

Arguments

idData

Identifies a user or session; the items specified by items are removed from this session or from this user's profile

numberOfItems

Type int, the number of items to be returned. This number represents the maximum number of items to be returned; the actual number returned may be less

hotPickGroups

Type long[], an array specifying the hot pick groups from which to make recommendations

tunings

For release 1 of OP, an empty object must be passed here.

filters

Specifies filtering parameters for the recommendations, including taxonomy ID, category filtering, category list (optional) and category membership. You can use of You can use any the "set" methods to set these values. For more information, see "FilteringSettings" in Chapter 2.

recContent

Specifies recommendation attributes and sorting; for details, see "RecommendationContent" in Chapter 2.

Return Value

The list of selected items (type RecommendationList).

For more information, see "Meaning of Returned Value for Recommendations", earlier in this chapter.

Exceptions

NullParameterException

InvalidIDException

BadDBConnectionException

ConnectionPoolIsFullException

ErrorExecutingRE

ReProxyInitException

ClassNotFoundException

ArrayTooLargeException


setVisitorToCustomer

Changes a visitor to a customer. This method is called when a visitor (unregistered user) registers during a session. This call associates the user ID with the customer ID generated by the Web application when the visitor becomes a registered customer. OP creates a new internal session for the customer. The session data for the visitor is transferred to the customer session. The historical data for the customer is also loaded to the customer session RE cache from permanent storage (MTR).

Syntax

setVisitorToCustomer (IdentificationData idData, String customerID);

Arguments

idData

Identifies the visitor or the session

customerID

The string that the calling Web application uses to identify the registered user; this is the ID created when the visitor registers with the Web application

Exceptions

BadDBConnectionException

ConnectionPoolIsFullException

ErrorExecutingRE

ReProxyInitException

Usage Notes

idData and customerID cannot be null.


Go to previous page Go to next page
Oracle
Copyright © 2001 Oracle Corporation.

All Rights Reserved.
Go To Documentation Library
Library
Go To Product List
Solution Area
Go To Table Of Contents
Contents