@Override
    public Set<Long> getCandidateItemsToRank(final Long user) {
        final Set<Long> allItems = getModelTrainingDifference(getTraining(), user);
        allItems.addAll(getModelTrainingDifference(getTest(), user));
        // return only N not relevant items
        List<Long> shuffledItems = new ArrayList<Long>(allItems);
        Collections.shuffle(shuffledItems, rnd);
        shuffledItems = shuffledItems.subList(0, Math.min(shuffledItems.size(), n));
        final Set<Long> items = new HashSet<Long>(shuffledItems);
        // add relevant ones
        for (Long i : getTest().getUserItems(user)) {
            if (getTest().getUserItemPreference(user, i) >= getThreshold()) {
                items.add(i);
            }
        }
        return items;
    }
@ Override public Set < Long > getCandidateItemsToRank ( final Long user ) { final Set < Long > allItems = getModelTrainingDifference ( getTraining ( ) , user ) ; allItems . addAll ( getModelTrainingDifference ( getTest ( ) , user ) ) ; List < Long > shuffledItems = new ArrayList < Long > ( allItems ) ; Collections . shuffle ( shuffledItems , rnd ) ; shuffledItems = shuffledItems . subList ( 0 , Math . min ( shuffledItems . size ( ) , n ) ) ; final Set < Long > items = new HashSet < Long > ( shuffledItems ) ; for ( Long i : getTest ( ) . getUserItems ( user ) ) { if ( getTest ( ) . getUserItemPreference ( user , i ) >= getThreshold ( ) ) { items . add ( i ) ; } } return items ; }
{@inheritDoc}