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

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

Introduction

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

Prototype

float getMaxPreference();

Source Link

Usage

From source file:de.unima.dws.webmining.rs.recommender.AvgUserPrefAdaptedUserBasedRecommender.java

License:Apache License

private EstimatedPreferenceCapper buildCapper() {
    DataModel dataModel = getDataModel();
    if (Float.isNaN(dataModel.getMinPreference()) && Float.isNaN(dataModel.getMaxPreference())) {
        return null;
    } else {//w  w w . j a v a 2s  .  c  om
        return new EstimatedPreferenceCapper(dataModel);
    }
}

From source file:norbert.mynemo.core.evaluation.PersonnalRecommenderEvaluator.java

License:Apache License

private static float capEstimatedPreference(float estimate, DataModel dataModel) {
    if (dataModel.getMaxPreference() < estimate) {
        return dataModel.getMaxPreference();
    }/*from  w w w. jav a  2s  . co m*/
    if (estimate < dataModel.getMinPreference()) {
        return dataModel.getMinPreference();
    }
    return estimate;
}

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

License:Open Source License

@Test
public void testEasyrecDataModel_getMaxPreference() throws TasteException {
    DataModel easyrecDataModel = new EasyrecDataModel(TENANT_ID, RATE_ACTION_TYPE_ID, HAS_RATING_VALUES,
            mahoutDataModelMappingDAO);/*from w ww  .ja  va2  s .  com*/
    easyrecDataModel = new EasyrecInMemoryDataModel(easyrecDataModel);
    Float maxPreference = easyrecDataModel.getMaxPreference();

    assertEquals(new Float(10), maxPreference);
}