本文整理汇总了Java中org.easyrec.service.core.ItemAssocService类的典型用法代码示例。如果您正苦于以下问题:Java ItemAssocService类的具体用法?Java ItemAssocService怎么用?Java ItemAssocService使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ItemAssocService类属于org.easyrec.service.core包,在下文中一共展示了ItemAssocService类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: ClusterServiceImpl
import org.easyrec.service.core.ItemAssocService; //导入依赖的package包/类
public ClusterServiceImpl(ProfileDAO profileDAO,
ItemAssocService itemAssocService,
IDMappingDAO idMappingDAO,
TenantService tenantService,
ItemTypeDAO itemTypeDAO,
AssocTypeDAO assocTypeDAO,
SourceTypeDAO sourceTypeDAO,
ViewTypeDAO viewTypeDAO) {
this.profileDAO = profileDAO;
this.itemAssocService = itemAssocService;
this.tenantService = tenantService;
this.idMappingDAO = idMappingDAO;
this.itemTypeDAO = itemTypeDAO;
this.assocTypeDAO = assocTypeDAO;
this.sourceTypeDAO = sourceTypeDAO;
this.viewTypeDAO = viewTypeDAO;
this.clusters =
new HashMap<>();
try {
context = JAXBContext.newInstance(org.easyrec.model.core.ClusterVO.class);
} catch (Exception e) {
logger.error("Could not instantiate JAXB Context for ClusterService!", e);
}
}
示例2: ClusterServiceImpl
import org.easyrec.service.core.ItemAssocService; //导入依赖的package包/类
public ClusterServiceImpl(ProfileDAO profileDAO,
ItemAssocService itemAssocService,
IDMappingDAO idMappingDAO,
TenantService tenantService,
ItemTypeDAO itemTypeDAO,
AssocTypeDAO assocTypeDAO,
SourceTypeDAO sourceTypeDAO,
ViewTypeDAO viewTypeDAO) {
this.profileDAO = profileDAO;
this.itemAssocService = itemAssocService;
this.tenantService = tenantService;
this.idMappingDAO = idMappingDAO;
this.itemTypeDAO = itemTypeDAO;
this.assocTypeDAO = assocTypeDAO;
this.sourceTypeDAO = sourceTypeDAO;
this.viewTypeDAO = viewTypeDAO;
this.clusters =
new HashMap<Integer, DelegateTree<ClusterVO, ItemAssocVO<Integer,Integer>>>();
try {
context = JAXBContext.newInstance(org.easyrec.model.core.ClusterVO.class);
} catch (Exception e) {
logger.error("Could not instantiate JAXB Context for ClusterService!", e);
}
}
示例3: setItemAssocService
import org.easyrec.service.core.ItemAssocService; //导入依赖的package包/类
@Override
public void setItemAssocService(final ItemAssocService itemAssocService) {
this.itemAssocService = itemAssocService;
}
示例4: CosineSimilarityCalculationStrategy
import org.easyrec.service.core.ItemAssocService; //导入依赖的package包/类
public CosineSimilarityCalculationStrategy(final ActionDAO actionDao, final ItemAssocService itemAssocService) {
super(actionDao, itemAssocService);
}
示例5: AdjustedCosineSimilarityCalculationStrategy
import org.easyrec.service.core.ItemAssocService; //导入依赖的package包/类
public AdjustedCosineSimilarityCalculationStrategy(final ActionDAO actionDao,
final ItemAssocService itemAssocService) {
super(actionDao, itemAssocService);
}
示例6: AbstractSimilarityCalculationStrategy
import org.easyrec.service.core.ItemAssocService; //导入依赖的package包/类
protected AbstractSimilarityCalculationStrategy(final ActionDAO actionDao,
final ItemAssocService itemAssocService) {
this.actionDao = actionDao;
this.itemAssocService = itemAssocService;
}
示例7: setItemAssocService
import org.easyrec.service.core.ItemAssocService; //导入依赖的package包/类
public void setItemAssocService(final ItemAssocService itemAssocService) {
this.itemAssocService = itemAssocService;
}
示例8: PearsonSimilarityCalculationStrategy
import org.easyrec.service.core.ItemAssocService; //导入依赖的package包/类
public PearsonSimilarityCalculationStrategy(final ActionDAO actionDao, final ItemAssocService itemAssocService) {
super(actionDao, itemAssocService);
}
示例9: doExecute
import org.easyrec.service.core.ItemAssocService; //导入依赖的package包/类
@Override
protected void doExecute(ExecutionControl executionControl, MahoutSlopeoneGeneratorStats stats) throws Exception {
// when doExecute() is called, the generator has been initialized with the configuration we should use
Date execution = new Date();
MahoutSlopeoneGeneratorConfig config = getConfiguration();
TypeMappingService typeMappingService = (TypeMappingService) super.getTypeMappingService();
ItemAssocService itemAssocService = getItemAssocService();
EasyrecDataModel easyrecDataModel = new EasyrecDataModel(config.getTenantId(), typeMappingService.getIdOfActionType(config.getTenantId(), config.getActionType()), true, mahoutDataModelMappingDAO);
Recommender recommender = new SlopeOneRecommender(easyrecDataModel);
itemTypeDAO.insertOrUpdate(config.getTenantId(), "USER", false);
Integer assocType = typeMappingService.getIdOfAssocType(config.getTenantId(), config.getAssociationType());
Integer userType = typeMappingService.getIdOfItemType(config.getTenantId(), "USER");
Integer sourceType = typeMappingService.getIdOfSourceType(config.getTenantId(), getSourceType());
Integer viewType = typeMappingService.getIdOfViewType(config.getTenantId(), config.getViewType());
stats.setNumberOfItems(easyrecDataModel.getNumItems());
for (LongPrimitiveIterator it = easyrecDataModel.getUserIDs(); it.hasNext(); ) {
long userId = it.nextLong();
List<RecommendedItem> recommendations = recommender.recommend(userId, config.getNumberOfRecs());
if (recommendations.isEmpty()) {
logger.debug("User " + userId + " : no recommendations");
}
// print the list of recommendations for each
for (RecommendedItem recommendedItem : recommendations) {
logger.debug("User " + userId + " : " + recommendedItem);
Integer itemToId = (int) recommendedItem.getItemID();
Integer itemToType = itemDAO.getItemTypeIdOfItem(config.getTenantId(), itemToId);
ItemVO<Integer, Integer> fromItem = new ItemVO<Integer, Integer>(config.getTenantId(), (int) userId, userType);
Double recommendationStrength = (double) recommendedItem.getValue();
ItemVO<Integer, Integer> toItem = new ItemVO<Integer, Integer>(config.getTenantId(), itemToId, itemToType);
ItemAssocVO<Integer,Integer> itemAssoc = new ItemAssocVO<Integer,Integer>(
config.getTenantId(), fromItem, assocType, recommendationStrength, toItem, sourceType,
"Mahout Slopeone Generator", viewType, null, execution);
itemAssocService.insertOrUpdateItemAssoc(itemAssoc);
stats.incNumberOfRulesCreated();
}
}
}
示例10: DomainItemAssocServiceImpl
import org.easyrec.service.core.ItemAssocService; //导入依赖的package包/类
public DomainItemAssocServiceImpl(TypedItemAssocDAO typedItemAssocDAO, ItemAssocService itemAssocService,
TypeMappingService typeMappingService) {
this.typedItemAssocDAO = typedItemAssocDAO;
this.itemAssocService = itemAssocService;
this.typeMappingService = typeMappingService;
}
示例11: getItemAssocService
import org.easyrec.service.core.ItemAssocService; //导入依赖的package包/类
public ItemAssocService getItemAssocService() {
return itemAssocService;
}
示例12: setItemAssocService
import org.easyrec.service.core.ItemAssocService; //导入依赖的package包/类
public void setItemAssocService(ItemAssocService itemAssocService) {
this.itemAssocService = itemAssocService;
}
示例13: ItemAssocAICommandImpl
import org.easyrec.service.core.ItemAssocService; //导入依赖的package包/类
public ItemAssocAICommandImpl(ItemAssocService itemAssocService) {
this.itemAssocService = itemAssocService;
}