當前位置: 首頁>>代碼示例>>Java>>正文


Java ItemDAO類代碼示例

本文整理匯總了Java中org.grouplens.lenskit.data.dao.ItemDAO的典型用法代碼示例。如果您正苦於以下問題:Java ItemDAO類的具體用法?Java ItemDAO怎麽用?Java ItemDAO使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


ItemDAO類屬於org.grouplens.lenskit.data.dao包,在下文中一共展示了ItemDAO類的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: configureRecommender

import org.grouplens.lenskit.data.dao.ItemDAO; //導入依賴的package包/類
/**
 * Create the LensKit recommender configuration.
 * @return The LensKit recommender configuration.
 */
// LensKit configuration API generates some unchecked warnings, turn them off
@SuppressWarnings("unchecked")
private static LenskitConfiguration configureRecommender() {
    LenskitConfiguration config = new LenskitConfiguration();
    // configure the rating data source
    config.bind(EventDAO.class)
          .to(MOOCRatingDAO.class);
    config.set(RatingFile.class)
          .to(new File("data/ratings.csv"));

    // use custom item and user DAOs
    // specify item DAO implementation with tags
    config.bind(ItemDAO.class)
          .to(CSVItemTagDAO.class);
    // specify tag file
    config.set(TagFile.class)
          .to(new File("data/movie-tags.csv"));
    // and title file
    config.set(TitleFile.class)
          .to(new File("data/movie-titles.csv"));

    // our user DAO can look up by user name
    config.bind(UserDAO.class)
          .to(MOOCUserDAO.class);
    config.set(UserFile.class)
          .to(new File("data/users.csv"));

    // use the TF-IDF scorer you will implement to score items
    config.bind(ItemScorer.class)
          .to(TFIDFItemScorer.class);
    return config;
}
 
開發者ID:4DD8A19D69F5324F9D49D17EF78BBBCC,項目名稱:Introd_uction_to_Recom_mander_S_ystem,代碼行數:37,代碼來源:CBFMain.java

示例2: configureRecommender

import org.grouplens.lenskit.data.dao.ItemDAO; //導入依賴的package包/類
/**
 * Create the LensKit recommender configuration.
 * @return The LensKit recommender configuration.
 */
// LensKit configuration API generates some unchecked warnings, turn them off
@SuppressWarnings("unchecked")
private static LenskitConfiguration configureRecommender() {
    LenskitConfiguration config = new LenskitConfiguration();
    // configure the rating data source
    config.bind(EventDAO.class)
          .to(MOOCRatingDAO.class);
    config.set(RatingFile.class)
          .to(new File("data/ratings.csv"));

    // use custom item and user DAOs
    // our item DAO has title information
    config.bind(ItemDAO.class)
          .to(MOOCItemDAO.class);
    config.addRoot(UserDAO.class);
    // and title file
    config.set(TitleFile.class)
          .to(new File("data/movie-titles.csv"));

    // our user DAO can look up by user name
    config.bind(UserDAO.class)
          .to(MOOCUserDAO.class);
    config.addRoot(UserDAO.class);
    config.set(UserFile.class)
          .to(new File("data/users.csv"));

    // use the item-item scorer you will implement to score items
    config.bind(ItemScorer.class)
          .to(SimpleItemItemScorer.class);
    config.bind(GlobalItemScorer.class).to(SimpleGlobalItemScorer.class);
    config.set(NeighborhoodSize.class)
          .to(20);
    return config;
}
 
開發者ID:4DD8A19D69F5324F9D49D17EF78BBBCC,項目名稱:Introd_uction_to_Recom_mander_S_ystem,代碼行數:39,代碼來源:IIMain.java

示例3: configureRecommender

import org.grouplens.lenskit.data.dao.ItemDAO; //導入依賴的package包/類
/**
 * Create the LensKit recommender configuration.
 * @return The LensKit recommender configuration.
 */
// LensKit configuration API generates some unchecked warnings, turn them off
@SuppressWarnings("unchecked")
private static LenskitConfiguration configureRecommender() {
    LenskitConfiguration config = new LenskitConfiguration();
    // configure the rating data source
    config.bind(EventDAO.class)
          .to(MOOCRatingDAO.class);
    config.set(RatingFile.class)
          .to(new File("data/ratings.csv"));

    // use custom item and user DAOs
    // our item DAO has title information
    config.bind(ItemDAO.class)
          .to(MOOCItemDAO.class);
    // and title file
    config.set(TitleFile.class)
          .to(new File("data/movie-titles.csv"));

    // our user DAO can look up by user name
    config.bind(UserDAO.class)
          .to(MOOCUserDAO.class);
    config.set(UserFile.class)
          .to(new File("data/users.csv"));

    // use the TF-IDF scorer you will implement to score items
    config.bind(ItemScorer.class)
          .to(SimpleUserUserItemScorer.class);
    return config;
}
 
開發者ID:4DD8A19D69F5324F9D49D17EF78BBBCC,項目名稱:Introd_uction_to_Recom_mander_S_ystem,代碼行數:34,代碼來源:UUMain.java

示例4: SVDModelBuilder

import org.grouplens.lenskit.data.dao.ItemDAO; //導入依賴的package包/類
/**
 * Construct the model builder.
 * @param uedao The user event DAO.
 * @param udao The user DAO.
 * @param idao The item DAO.
 * @param baseline The baseline scorer (this will be used to compute means).
 * @param nfeatures The number of latent features to train.
 */
@Inject
public SVDModelBuilder(@Transient UserEventDAO uedao,
                       @Transient UserDAO udao,
                       @Transient ItemDAO idao,
                       @Transient @BaselineScorer ItemScorer baseline,
                       @LatentFeatureCount int nfeatures) {
    logger.debug("user DAO: {}", udao);
    userEventDAO = uedao;
    userDAO = udao;
    itemDAO = idao;
    baselineScorer = baseline;
    featureCount = nfeatures;
}
 
開發者ID:paolobarbaglia,項目名稱:coursera_recommender_systems,代碼行數:22,代碼來源:SVDModelBuilder.java

示例5: configureRecommender

import org.grouplens.lenskit.data.dao.ItemDAO; //導入依賴的package包/類
/**
 * Create the LensKit recommender configuration.
 * @return The LensKit recommender configuration.
 */
// LensKit configuration API generates some unchecked warnings, turn them off
@SuppressWarnings("unchecked")
private LenskitConfiguration configureRecommender() {
    LenskitConfiguration config = new LenskitConfiguration();
    // configure the rating data source
    config.bind(EventDAO.class)
          .to(MOOCRatingDAO.class);
    config.set(RatingFile.class)
          .to(new File("data/ratings.csv"));

    // use custom item and user DAOs
    // our item DAO has title information
    config.bind(ItemDAO.class)
          .to(MOOCItemDAO.class);
    config.addRoot(UserDAO.class);
    // and title file
    config.set(TitleFile.class)
          .to(new File("data/movie-titles.csv"));

    // our user DAO can look up by user name
    config.bind(UserDAO.class)
          .to(MOOCUserDAO.class);
    config.addRoot(UserDAO.class);
    config.set(UserFile.class)
          .to(new File("data/users.csv"));

    // use the item-item scorer you will implement to score items
    config.bind(ItemScorer.class)
          .to(SVDItemScorer.class);
    baselineMode.configure(config);
    config.set(LatentFeatureCount.class)
          .to(10);
    return config;
}
 
開發者ID:paolobarbaglia,項目名稱:coursera_recommender_systems,代碼行數:39,代碼來源:SVDMain.java

示例6: LuceneItemItemModel

import org.grouplens.lenskit.data.dao.ItemDAO; //導入依賴的package包/類
LuceneItemItemModel(Directory dir, ItemDAO idao, @ModelSize int nnbrs) {
    luceneDir = dir;
    itemDAO = idao;
    toFetch = nnbrs;
    logger.debug("initializing indexed model with size {}", nnbrs);
    cache = CacheBuilder.newBuilder()
                        .build(new LuceneCacheLoader());
}
 
開發者ID:paolobarbaglia,項目名稱:coursera_recommender_systems,代碼行數:9,代碼來源:LuceneItemItemModel.java

示例7: SimpleItemItemModelBuilder

import org.grouplens.lenskit.data.dao.ItemDAO; //導入依賴的package包/類
@Inject
public SimpleItemItemModelBuilder(@Transient ItemDAO idao,
                                  @Transient UserEventDAO uedao) {
    itemDao = idao;
    userEventDao = uedao;
}
 
開發者ID:4DD8A19D69F5324F9D49D17EF78BBBCC,項目名稱:Introd_uction_to_Recom_mander_S_ystem,代碼行數:7,代碼來源:SimpleItemItemModelBuilder.java

示例8: SimpleItemItemModelBuilder

import org.grouplens.lenskit.data.dao.ItemDAO; //導入依賴的package包/類
@Inject
public SimpleItemItemModelBuilder(@Transient ItemDAO idao,
		@Transient UserEventDAO uedao) {
	itemDao = idao;
	userEventDao = uedao;
}
 
開發者ID:paolobarbaglia,項目名稱:coursera_recommender_systems,代碼行數:7,代碼來源:SimpleItemItemModelBuilder.java

示例9: Builder

import org.grouplens.lenskit.data.dao.ItemDAO; //導入依賴的package包/類
@Inject
public Builder(@Transient EventDAO edao, @Transient ItemDAO idao) {
    eventDAO = edao;
    itemDAO = idao;
}
 
開發者ID:paolobarbaglia,項目名稱:coursera_recommender_systems,代碼行數:6,代碼來源:PopularityItemScorer.java


注:本文中的org.grouplens.lenskit.data.dao.ItemDAO類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。