当前位置: 首页>>代码示例>>Java>>正文


Java ItemAssocService类代码示例

本文整理汇总了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);
    }
}
 
开发者ID:major2015,项目名称:easyrec_major,代码行数:25,代码来源:ClusterServiceImpl.java

示例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);
    }
}
 
开发者ID:customertimes,项目名称:easyrec-PoC,代码行数:25,代码来源:ClusterServiceImpl.java

示例3: setItemAssocService

import org.easyrec.service.core.ItemAssocService; //导入依赖的package包/类
@Override
public void setItemAssocService(final ItemAssocService itemAssocService) {
    this.itemAssocService = itemAssocService;
}
 
开发者ID:major2015,项目名称:easyrec_major,代码行数:5,代码来源:ItemItemGenerator.java

示例4: CosineSimilarityCalculationStrategy

import org.easyrec.service.core.ItemAssocService; //导入依赖的package包/类
public CosineSimilarityCalculationStrategy(final ActionDAO actionDao, final ItemAssocService itemAssocService) {
    super(actionDao, itemAssocService);
}
 
开发者ID:major2015,项目名称:easyrec_major,代码行数:4,代码来源:CosineSimilarityCalculationStrategy.java

示例5: AdjustedCosineSimilarityCalculationStrategy

import org.easyrec.service.core.ItemAssocService; //导入依赖的package包/类
public AdjustedCosineSimilarityCalculationStrategy(final ActionDAO actionDao,
                                                   final ItemAssocService itemAssocService) {
    super(actionDao, itemAssocService);
}
 
开发者ID:major2015,项目名称:easyrec_major,代码行数:5,代码来源:AdjustedCosineSimilarityCalculationStrategy.java

示例6: AbstractSimilarityCalculationStrategy

import org.easyrec.service.core.ItemAssocService; //导入依赖的package包/类
protected AbstractSimilarityCalculationStrategy(final ActionDAO actionDao,
                                                final ItemAssocService itemAssocService) {
    this.actionDao = actionDao;
    this.itemAssocService = itemAssocService;
}
 
开发者ID:major2015,项目名称:easyrec_major,代码行数:6,代码来源:AbstractSimilarityCalculationStrategy.java

示例7: setItemAssocService

import org.easyrec.service.core.ItemAssocService; //导入依赖的package包/类
public void setItemAssocService(final ItemAssocService itemAssocService) {
    this.itemAssocService = itemAssocService;
}
 
开发者ID:major2015,项目名称:easyrec_major,代码行数:4,代码来源:AbstractSimilarityCalculationStrategy.java

示例8: PearsonSimilarityCalculationStrategy

import org.easyrec.service.core.ItemAssocService; //导入依赖的package包/类
public PearsonSimilarityCalculationStrategy(final ActionDAO actionDao, final ItemAssocService itemAssocService) {
    super(actionDao, itemAssocService);
}
 
开发者ID:major2015,项目名称:easyrec_major,代码行数:4,代码来源:PearsonSimilarityCalculationStrategy.java

示例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();
        }
    }

}
 
开发者ID:major2015,项目名称:easyrec_major,代码行数:54,代码来源:MahoutSlopeoneGenerator.java

示例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;
}
 
开发者ID:major2015,项目名称:easyrec_major,代码行数:7,代码来源:DomainItemAssocServiceImpl.java

示例11: getItemAssocService

import org.easyrec.service.core.ItemAssocService; //导入依赖的package包/类
public ItemAssocService getItemAssocService() {
    return itemAssocService;
}
 
开发者ID:major2015,项目名称:easyrec_major,代码行数:4,代码来源:BestClusterStrategyImpl.java

示例12: setItemAssocService

import org.easyrec.service.core.ItemAssocService; //导入依赖的package包/类
public void setItemAssocService(ItemAssocService itemAssocService) {
    this.itemAssocService = itemAssocService;
}
 
开发者ID:major2015,项目名称:easyrec_major,代码行数:4,代码来源:BestClusterStrategyImpl.java

示例13: ItemAssocAICommandImpl

import org.easyrec.service.core.ItemAssocService; //导入依赖的package包/类
public ItemAssocAICommandImpl(ItemAssocService itemAssocService) {
    this.itemAssocService = itemAssocService;
}
 
开发者ID:major2015,项目名称:easyrec_major,代码行数:4,代码来源:ItemAssocAICommandImpl.java


注:本文中的org.easyrec.service.core.ItemAssocService类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。