Example usage for org.apache.mahout.cf.taste.model DataModel hasPreferenceValues

List of usage examples for org.apache.mahout.cf.taste.model DataModel hasPreferenceValues

Introduction

In this page you can find the example usage for org.apache.mahout.cf.taste.model DataModel hasPreferenceValues.

Prototype

boolean hasPreferenceValues();

Source Link

Usage

From source file:org.easyrec.mahout.EasyrecInMemoryDataModelTest.java

License:Open Source License

@Test
public void testEasyrecDataModel_hasPreferenceValues() throws TasteException {
    DataModel easyrecDataModel = new EasyrecDataModel(TENANT_ID, RATE_ACTION_TYPE_ID, HAS_RATING_VALUES,
            mahoutDataModelMappingDAO);//from  www. j  a  v  a 2 s .co  m
    easyrecDataModel = new EasyrecInMemoryDataModel(easyrecDataModel);

    boolean hasPreferenceValues = easyrecDataModel.hasPreferenceValues();

    assertEquals(true, hasPreferenceValues);
}

From source file:recsys.similarity.TrueEuclideanDistanceSimilarity.java

License:Apache License

/**
 * @throws IllegalArgumentException/* www . jav  a 2s.c om*/
 *             if {@link DataModel} does not have preference values
 */
public TrueEuclideanDistanceSimilarity(DataModel dataModel, Weighting weighting) throws TasteException {
    super(dataModel, weighting, false);
    Preconditions.checkArgument(dataModel.hasPreferenceValues(), "DataModel doesn't have preference values");
}