@Inject public PackedRatingMatrixProvider(@Transient RatingVectorPDAO dao, Random random) { this.dao = dao; this.random = random; }
/** * Construct a new provider. * @param sim The item similarity function to use. */ @Inject public DefaultNeighborIterationStrategyProvider(@Transient ItemSimilarity sim) { similarity = sim; }
@Inject public GlobalAverageRatingBiasModelProvider(@Transient DataAccessObject dao) { this.dao = dao; }
@Inject public RatingSummaryProvider(@Transient DataAccessObject dao) { this.dao = dao; }
/** * Construct a normalizing item-item model builder. * * @param sim The item similarity function. * @param context The item-item build context. * @param rowNorm The normalizer for item neighborhood vectors. * @param trunc The truncator for truncating neighborhood vectors. Bind this to the provider * {@link StandardVectorTruncatorProvider} to get the same threshold and model * size configuration behavior as {@link ItemItemModelProvider}. * @param iterStrat The neighbor iteration strategy. */ @Inject public NormalizingItemItemModelProvider(@Transient ItemSimilarity sim, @Transient ItemItemBuildContext context, @Transient ItemVectorNormalizer rowNorm, @Transient VectorTruncator trunc, @Transient NeighborIterationStrategy iterStrat) { similarity = sim; buildContext = context; rowNormalizer = rowNorm; truncator = trunc; iterationStrategy = iterStrat; }
/** * Construct an item-item build context provider. * * @param rvd The rating vector DAO. * @param normalizer The user vector normalizer. */ @Inject public ItemItemBuildContextProvider(@Transient RatingVectorPDAO rvd, @Transient UserVectorNormalizer normalizer, @MinCommonUsers int minCU) { rvDAO = rvd; this.normalizer = normalizer; minCommonUsers = minCU; }
@Inject public ItemItemModelProvider(@Transient ItemSimilarity similarity, @Transient ItemItemBuildContext context, @Transient @ItemSimilarityThreshold Threshold thresh, @Transient NeighborIterationStrategy nbrStrat, @MinCommonUsers int minCU, @ModelSize int size) { itemSimilarity = similarity; buildContext = context; threshold = thresh; neighborStrategy = nbrStrat; minCommonUsers = minCU; modelSize = size; }
@Inject public UserAverageRatingBiasModelProvider(@Transient RatingVectorPDAO dao, @BiasDamping double damp) { this.dao = dao; damping = damp; }
/** * Construct the provider. * @param type The entity type. It should have {@link CommonAttributes#ITEM_ID} attributes. * @param dao The data access object. */ @Inject public ISProvider(@InteractionEntityType EntityType type, @Transient DataAccessObject dao) { entityType = type; this.dao = dao; }
/** * Construct the provider. * @param type The entity type. It should have {@link CommonAttributes#ITEM_ID} attributes. * @param dao The data access object. */ @Inject public CountSumISProvider(@InteractionEntityType EntityType type, @Transient DataAccessObject dao) { entityType = type; this.dao = dao; }
@Inject public GlobalMeanRatingItemScorer(@Transient RatingSummary summary) { super(summary.getGlobalMean()); } }
@Inject public UserItemAverageRatingBiasModelProvider(ItemBiasModel ib, @Transient RatingVectorPDAO dao, @BiasDamping double damp) { itemBiases = ib; this.dao = dao; damping = damp; }
@Inject public FunkSVDModelProvider(@Transient @Nonnull RatingMatrix snapshot, @Transient @Nonnull FunkSVDUpdateRule rule, @FeatureCount int featureCount, @InitialFeatureValue double initVal) { this.featureCount = featureCount; this.initialValue = initVal; this.snapshot = snapshot; this.rule = rule; }
/** * Construct random data split configuration * @param snapshot a snapshot of ratings * @param rnd random generator * @param seed seed of {@code rnd} * @param proportion proportion of validation data */ @Inject public RandomDataSplitStrategyProvider(@Transient @Nonnull RatingMatrix snapshot, Random rnd, @RandomSeed int seed, @SplitProportion double proportion) { this.snapshot = snapshot; rnd.setSeed((long)seed); random = rnd; this.proportion = proportion; }
@Inject public SlopeOneModelProvider(@Transient ItemItemBuildContext context, @DeviationDamping double damping) { buildContext = context; accumulator = new SlopeOneModelDataAccumulator(damping, context.getItems()); }
/** * Create a new builder. * * @param regFactor The regularization term * @param lrate The learning rate * @param data The preference data * @param maxIters The maximum iteration count */ @Inject public Builder(@RegularizationTerm double regFactor, @LearningRate double lrate, @Transient RatingMatrix data, @IterationCount int maxIters) { regularizationFactor = regFactor; learningRate = lrate; snapshot = data; maxIterations = maxIters; }
@Inject public HPFModelProvider(@Transient DataSplitStrategy rndRatings, PFHyperParameters hyperParams, @ConvergenceCheckFrequency int iterFreq, @RandomSeed int seed, @MaxRandomOffsetForShape double maxOffS, @MaxRandomOffsetForRate double maxOffR, @IsProbabilityPrediction boolean probPred, @StoppingThreshold double threshld, @IterationCount int maxIter) { ratings = rndRatings; hyperParameters = hyperParams; iterationFrequency = iterFreq; rndSeed = seed; maxOffsetShp = maxOffS; maxOffsetRte = maxOffR; isProbPredition = probPred; threshold = threshld; maxIterCount = maxIter; }
@Inject public HPFModelParallelProvider(@Transient DataSplitStrategy rndRatings, PFHyperParameters hyperParams, @ConvergenceCheckFrequency int iterFreq, @RandomSeed int seed, @MaxRandomOffsetForShape double maxOffS, @MaxRandomOffsetForRate double maxOffR, @IsProbabilityPrediction boolean probPred, @StoppingThreshold double threshld, @IterationCount int maxIter) { ratings = rndRatings; hyperParameters = hyperParams; iterationFrequency = iterFreq; rndSeed = seed; maxOffsetShp = maxOffS; maxOffsetRte = maxOffR; isProbPrediction = probPred; threshold = threshld; maxIterCount = maxIter; }