## org.apache.mahout.cf.taste.impl.recommender
Class GenericBooleanPrefItemBasedRecommender

    java.lang.Object
      org.apache.mahout.cf.taste.impl.recommender.AbstractRecommender
          org.apache.mahout.cf.taste.impl.recommender.GenericItemBasedRecommender
              org.apache.mahout.cf.taste.impl.recommender.GenericBooleanPrefItemBasedRecommender

All Implemented Interfaces:
  Refreshable, ItemBasedRecommender, Recommender

    public final class GenericBooleanPrefItemBasedRecommender

extends GenericItemBasedRecommender

A variant on `GenericItemBasedRecommender` which is appropriate for use when no notion of preference value exists in the data.

See Also:
  `GenericBooleanPrefUserBasedRecommender`

Nested Class Summary

Nested classes/interfaces inherited from class org.apache.mahout.cf.taste.impl.recommender.GenericItemBasedRecommender
`GenericItemBasedRecommender.MostSimilarEstimator`

Constructor Summary
`GenericBooleanPrefItemBasedRecommender(DataModel dataModel, ItemSimilarity similarity)`
`GenericBooleanPrefItemBasedRecommender(DataModel dataModel, ItemSimilarity similarity, CandidateItemsStrategy candidateItemsStrategy, MostSimilarItemsCandidateItemsStrategy mostSimilarItemsCandidateItemsStrategy)`

Method Summary
`protected float` `doEstimatePreference(long userID, PreferenceArray preferencesFromUser, long itemID)` This computation is in a technical sense, wrong, since in the domain of "boolean preference users" where all preference values are 1, this method should only ever return 1.0 or NaN.
`String` `toString()`

Methods inherited from class org.apache.mahout.cf.taste.impl.recommender.GenericItemBasedRecommender
`estimatePreference, getDefaultMostSimilarItemsCandidateItemsStrategy, getSimilarity, mostSimilarItems, mostSimilarItems, mostSimilarItems, mostSimilarItems, mostSimilarItems, mostSimilarItems, recommend, recommendedBecause, refresh`

Methods inherited from class org.apache.mahout.cf.taste.impl.recommender.AbstractRecommender
`getAllOtherItems, getDataModel, getDefaultCandidateItemsStrategy, recommend, removePreference, setPreference`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Methods inherited from interface org.apache.mahout.cf.taste.recommender.Recommender
`getDataModel, recommend, removePreference, setPreference`

Constructor Detail

### GenericBooleanPrefItemBasedRecommender

    public GenericBooleanPrefItemBasedRecommender(DataModel dataModel,
                                                  ItemSimilarity similarity)

### GenericBooleanPrefItemBasedRecommender

    public GenericBooleanPrefItemBasedRecommender(DataModel dataModel,
                                                  ItemSimilarity similarity,
                                                  CandidateItemsStrategy candidateItemsStrategy,
                                                  MostSimilarItemsCandidateItemsStrategy mostSimilarItemsCandidateItemsStrategy)

Method Detail

### doEstimatePreference

    protected float doEstimatePreference(long userID,
                                         PreferenceArray preferencesFromUser,
                                         long itemID)
                                  throws TasteException

  This computation is in a technical sense, wrong, since in the domain of "boolean preference users" where all preference values are 1, this method should only ever return 1.0 or NaN. This isn't terribly useful however since it means results can't be ranked by preference value (all are 1). So instead this returns a sum of similarities.

  Overrides:
    `doEstimatePreference` in class `GenericItemBasedRecommender`
  Throws:
    `TasteException`

### toString

    public String toString()

  Overrides:
    `toString` in class `GenericItemBasedRecommender`

Copyright © 2008–2014 The Apache Software Foundation. All rights reserved.