|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.mahout.cf.taste.impl.common.jdbc.AbstractJDBCComponent
org.apache.mahout.cf.taste.impl.similarity.jdbc.AbstractJDBCItemSimilarity
public abstract class AbstractJDBCItemSimilarity
An ItemSimilarity
which draws pre-computed item-item similarities from a database table via JDBC.
Field Summary |
---|
Fields inherited from class org.apache.mahout.cf.taste.impl.common.jdbc.AbstractJDBCComponent |
---|
DEFAULT_DATASOURCE_NAME |
Constructor Summary | |
---|---|
protected |
AbstractJDBCItemSimilarity(DataSource dataSource,
String getItemItemSimilaritySQL,
String getAllSimilarItemIDsSQL)
|
protected |
AbstractJDBCItemSimilarity(DataSource dataSource,
String similarityTable,
String itemAIDColumn,
String itemBIDColumn,
String similarityColumn,
String getItemItemSimilaritySQL,
String getAllSimilarItemIDsSQL)
|
Method Summary | |
---|---|
long[] |
allSimilarItemIDs(long itemID)
|
protected String |
getItemAIDColumn()
|
protected String |
getItemBIDColumn()
|
protected String |
getSimilarityColumn()
|
protected String |
getSimilarityTable()
|
double[] |
itemSimilarities(long itemID1,
long[] itemID2s)
A bulk-get version of ItemSimilarity.itemSimilarity(long, long) . |
double |
itemSimilarity(long itemID1,
long itemID2)
Returns the degree of similarity, of two items, based on the preferences that users have expressed for the items. |
void |
refresh(Collection<Refreshable> alreadyRefreshed)
Triggers "refresh" -- whatever that means -- of the implementation. |
Methods inherited from class org.apache.mahout.cf.taste.impl.common.jdbc.AbstractJDBCComponent |
---|
checkNotNullAndLog, checkNotNullAndLog, getFetchSize, lookupDataSource |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected AbstractJDBCItemSimilarity(DataSource dataSource, String getItemItemSimilaritySQL, String getAllSimilarItemIDsSQL)
protected AbstractJDBCItemSimilarity(DataSource dataSource, String similarityTable, String itemAIDColumn, String itemBIDColumn, String similarityColumn, String getItemItemSimilaritySQL, String getAllSimilarItemIDsSQL)
Method Detail |
---|
protected String getSimilarityTable()
protected String getItemAIDColumn()
protected String getItemBIDColumn()
protected String getSimilarityColumn()
public double itemSimilarity(long itemID1, long itemID2) throws TasteException
ItemSimilarity
Returns the degree of similarity, of two items, based on the preferences that users have expressed for the items.
itemSimilarity
in interface ItemSimilarity
itemID1
- first item IDitemID2
- second item ID
Double.NaN
similarity is unknown
NoSuchItemException
- if either item is known to be non-existent in the data
TasteException
- if an error occurs while accessing the datapublic double[] itemSimilarities(long itemID1, long[] itemID2s) throws TasteException
ItemSimilarity
A bulk-get version of ItemSimilarity.itemSimilarity(long, long)
.
itemSimilarities
in interface ItemSimilarity
itemID1
- first item IDitemID2s
- second item IDs to compute similarity with
NoSuchItemException
- if any item is known to be non-existent in the data
TasteException
- if an error occurs while accessing the datapublic long[] allSimilarItemIDs(long itemID) throws TasteException
allSimilarItemIDs
in interface ItemSimilarity
TasteException
public void refresh(Collection<Refreshable> alreadyRefreshed)
Refreshable
Triggers "refresh" -- whatever that means -- of the implementation. The general contract is that any should always leave itself in a consistent, operational state, and that the refresh atomically updates internal state from old to new.
refresh
in interface Refreshable
alreadyRefreshed
- s that are known to have already been
refreshed as a result of an initial call to a method on some
object. This ensure that objects in a refresh dependency graph aren't refreshed twice
needlessly.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |