Class LambdaMARTJForestsRecommender<U>

java.lang.Object
es.uam.eps.ir.ranksys.rec.AbstractRecommender<U,​I>
es.uam.eps.ir.ranksys.rec.fast.AbstractFastRecommender<U,​I>
es.uam.eps.ir.ranksys.rec.fast.FastRankingRecommender<U,​U>
es.uam.eps.ir.relison.links.recommendation.UserFastRankingRecommender<U>
es.uam.eps.ir.relison.links.recommendation.algorithms.supervised.LambdaMARTJForestsRecommender<U>
Type Parameters:
U - type of the users.
All Implemented Interfaces:
es.uam.eps.ir.ranksys.core.index.ItemIndex<U>, es.uam.eps.ir.ranksys.core.index.UserIndex<U>, es.uam.eps.ir.ranksys.fast.index.FastItemIndex<U>, es.uam.eps.ir.ranksys.fast.index.FastUserIndex<U>, es.uam.eps.ir.ranksys.rec.fast.FastRecommender<U,​U>, es.uam.eps.ir.ranksys.rec.Recommender<U,​U>

public class LambdaMARTJForestsRecommender<U>
extends UserFastRankingRecommender<U>
Class for applying the LambdaMART algorithm. This uses the implementation by Yasser Ganjisaffar, Rich Caruana and Cristina Lopes in https://github.com/yasserg/jforests.

Reference: Y. Ganjisaffar, R. Caruana, C. Lopes. Bagging Gradient-Boosted Trees for High Precision, Low Variance Ranking Models. 34th Annual International ACM SIGIR conference on Research and development in Information Retrieval (SIGIR 2011), 85-94 (2011)

  • Field Summary

    Fields 
    Modifier and Type Field Description
    private it.unimi.dsi.fastutil.ints.Int2ObjectMap<it.unimi.dsi.fastutil.ints.Int2DoubleMap> scoresMaps
    The final recommendation scores.

    Fields inherited from class es.uam.eps.ir.relison.links.recommendation.UserFastRankingRecommender

    graph

    Fields inherited from class es.uam.eps.ir.ranksys.rec.fast.AbstractFastRecommender

    iIndex, uIndex
  • Constructor Summary

    Constructors 
    Constructor Description
    LambdaMARTJForestsRecommender​(FastGraph<U> graph, java.lang.String trainLETOR, java.lang.String validLETOR, java.lang.String testLETOR, java.lang.String config, java.lang.String tmp, org.ranksys.formats.parsing.Parser<U> uParser)
    Constructor.
  • Method Summary

    Modifier and Type Method Description
    static boolean deleteDirectory​(java.io.File dir)
    Recursively deletes the contents of a folder.
    it.unimi.dsi.fastutil.ints.Int2DoubleMap getScoresMap​(int uidx)  

    Methods inherited from class es.uam.eps.ir.relison.links.recommendation.UserFastRankingRecommender

    getFreq, getFreq, getGraph

    Methods inherited from class es.uam.eps.ir.ranksys.rec.fast.FastRankingRecommender

    getRecommendation

    Methods inherited from class es.uam.eps.ir.ranksys.rec.fast.AbstractFastRecommender

    getRecommendation, getRecommendation, getRecommendation, getRecommendation, getRecommendation, getRecommendation, getRecommendation, iidx2item, item2iidx, numItems, numUsers, uidx2user, user2uidx

    Methods inherited from class es.uam.eps.ir.ranksys.rec.AbstractRecommender

    getRecommendation, getRecommendation

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface es.uam.eps.ir.ranksys.fast.index.FastItemIndex

    containsItem, getAllIidx, getAllItems, iidx2item, iidx2item, item2iidx, item2iidx

    Methods inherited from interface es.uam.eps.ir.ranksys.fast.index.FastUserIndex

    containsUser, getAllUidx, getAllUsers, uidx2user, uidx2user, user2uidx, user2uidx

    Methods inherited from interface es.uam.eps.ir.ranksys.rec.Recommender

    getRecommendation, getRecommendation
  • Field Details

    • scoresMaps

      private final it.unimi.dsi.fastutil.ints.Int2ObjectMap<it.unimi.dsi.fastutil.ints.Int2DoubleMap> scoresMaps
      The final recommendation scores.
  • Constructor Details

    • LambdaMARTJForestsRecommender

      public LambdaMARTJForestsRecommender​(FastGraph<U> graph, java.lang.String trainLETOR, java.lang.String validLETOR, java.lang.String testLETOR, java.lang.String config, java.lang.String tmp, org.ranksys.formats.parsing.Parser<U> uParser) throws java.lang.Exception
      Constructor.
      Parameters:
      graph - the training network.
      trainLETOR - a file containing the training patterns (in the LETOR format).
      validLETOR - a file containing the validation patterns (in the LETOR format).
      testLETOR - a file containing the test patterns (in the LETOR format).
      config - a file containing the configuration for the LambdaMART algorithm.
      tmp - a temporary directory in which to store intermediate files.
      uParser - a user parser.
      Throws:
      java.lang.Exception - if something fails while applying the LambdaMART algorithm.
  • Method Details

    • getScoresMap

      public it.unimi.dsi.fastutil.ints.Int2DoubleMap getScoresMap​(int uidx)
      Specified by:
      getScoresMap in class es.uam.eps.ir.ranksys.rec.fast.FastRankingRecommender<U,​U>
    • deleteDirectory

      public static boolean deleteDirectory​(java.io.File dir)
      Recursively deletes the contents of a folder.
      Parameters:
      dir - the directory.
      Returns:
      true if everything went OK, false otherwise.