org.apache.mahout.cf.taste.impl.similarity.jdbc
Class AbstractJDBCItemSimilarity
java.lang.Object
org.apache.mahout.cf.taste.impl.common.jdbc.AbstractJDBCComponent
org.apache.mahout.cf.taste.impl.similarity.jdbc.AbstractJDBCItemSimilarity
- All Implemented Interfaces:
- Refreshable, ItemSimilarity
- Direct Known Subclasses:
- SQL92JDBCItemSimilarity
public abstract class AbstractJDBCItemSimilarity
- extends AbstractJDBCComponent
- implements ItemSimilarity
An ItemSimilarity
which draws pre-computed item-item similarities from a database table via JDBC.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AbstractJDBCItemSimilarity
protected AbstractJDBCItemSimilarity(DataSource dataSource,
String getItemItemSimilaritySQL,
String getAllSimilarItemIDsSQL)
AbstractJDBCItemSimilarity
protected AbstractJDBCItemSimilarity(DataSource dataSource,
String similarityTable,
String itemAIDColumn,
String itemBIDColumn,
String similarityColumn,
String getItemItemSimilaritySQL,
String getAllSimilarItemIDsSQL)
getSimilarityTable
protected String getSimilarityTable()
getItemAIDColumn
protected String getItemAIDColumn()
getItemBIDColumn
protected String getItemBIDColumn()
getSimilarityColumn
protected String getSimilarityColumn()
itemSimilarity
public double itemSimilarity(long itemID1,
long itemID2)
throws TasteException
- Specified by:
itemSimilarity
in interface ItemSimilarity
- Throws:
TasteException
itemSimilarities
public double[] itemSimilarities(long itemID1,
long[] itemID2s)
throws TasteException
- Specified by:
itemSimilarities
in interface ItemSimilarity
- Throws:
TasteException
allSimilarItemIDs
public long[] allSimilarItemIDs(long itemID)
throws TasteException
- Specified by:
allSimilarItemIDs
in interface ItemSimilarity
- Throws:
TasteException
refresh
public void refresh(Collection<Refreshable> alreadyRefreshed)
- Specified by:
refresh
in interface Refreshable
Copyright © 2008–2014 The Apache Software Foundation. All rights reserved.