Package org.apache.mahout.cf.taste.eval

Examples of org.apache.mahout.cf.taste.eval.IRStatistics


    assertEquals(0.666666666, stats.getNormalizedDiscountedCumulativeGain(), EPSILON);
  }

  @Test
  public void testIRStats() {
    IRStatistics stats = new IRStatisticsImpl(0.3, 0.1, 0.2, 0.05, 0.15);
    assertEquals(0.3, stats.getPrecision(), EPSILON);
    assertEquals(0.1, stats.getRecall(), EPSILON);
    assertEquals(0.15, stats.getF1Measure(), EPSILON);
    assertEquals(0.11538461538462, stats.getFNMeasure(2.0), EPSILON);
    assertEquals(0.05, stats.getNormalizedDiscountedCumulativeGain(), EPSILON);
  }
View Full Code Here


      public Recommender buildRecommender(DataModel dataModel) throws TasteException {
        return new SlopeOneRecommender(dataModel);
      }
    };
    RecommenderIRStatsEvaluator evaluator = new GenericRecommenderIRStatsEvaluator();
    IRStatistics stats = evaluator.evaluate(builder, null, model, null, 1, 0.2, 1.0);
    assertNotNull(stats);
    assertEquals(0.75, stats.getPrecision(), EPSILON);
    assertEquals(0.75, stats.getRecall(), EPSILON);
    assertEquals(0.75, stats.getF1Measure(), EPSILON);
    assertEquals(0.75, stats.getNormalizedDiscountedCumulativeGain(), EPSILON);
  }
View Full Code Here

      public DataModel buildDataModel(FastByIDMap<PreferenceArray> trainingData) {
        return new GenericBooleanPrefDataModel(GenericBooleanPrefDataModel.toDataMap(trainingData));
      }
    };
    RecommenderIRStatsEvaluator evaluator = new GenericRecommenderIRStatsEvaluator();
    IRStatistics stats = evaluator.evaluate(
        builder, dataModelBuilder, model, null, 1, GenericRecommenderIRStatsEvaluator.CHOOSE_THRESHOLD, 1.0);

    assertNotNull(stats);
    assertEquals(0.666666666, stats.getPrecision(), EPSILON);
    assertEquals(0.666666666, stats.getRecall(), EPSILON);
    assertEquals(0.666666666, stats.getF1Measure(), EPSILON);
    assertEquals(0.666666666, stats.getFNMeasure(2.0), EPSILON);
    assertEquals(0.666666666, stats.getNormalizedDiscountedCumulativeGain(), EPSILON);
  }
View Full Code Here

    assertEquals(0.666666666, stats.getNormalizedDiscountedCumulativeGain(), EPSILON);
  }

  @Test
  public void testIRStats() {
    IRStatistics stats = new IRStatisticsImpl(0.3, 0.1, 0.2, 0.05, 0.15);
    assertEquals(0.3, stats.getPrecision(), EPSILON);
    assertEquals(0.1, stats.getRecall(), EPSILON);
    assertEquals(0.15, stats.getF1Measure(), EPSILON);
    assertEquals(0.11538461538462, stats.getFNMeasure(2.0), EPSILON);
    assertEquals(0.05, stats.getNormalizedDiscountedCumulativeGain(), EPSILON);
  }
View Full Code Here

      public Recommender buildRecommender(DataModel dataModel) throws TasteException {
        return new SlopeOneRecommender(dataModel);
      }
    };
    RecommenderIRStatsEvaluator evaluator = new GenericRecommenderIRStatsEvaluator();
    IRStatistics stats = evaluator.evaluate(builder, null, model, null, 1, 0.2, 1.0);
    assertNotNull(stats);
    assertEquals(0.75, stats.getPrecision(), EPSILON);
    assertEquals(0.75, stats.getRecall(), EPSILON);
    assertEquals(0.75, stats.getF1Measure(), EPSILON);
    assertEquals(0.75, stats.getFNMeasure(2.0), EPSILON);
    assertEquals(0.75, stats.getNormalizedDiscountedCumulativeGain(), EPSILON);
  }
View Full Code Here

    assertEquals(0.75, stats.getNormalizedDiscountedCumulativeGain(), EPSILON);
  }

  @Test
  public void testIRStats() {
    IRStatistics stats = new IRStatisticsImpl(0.3, 0.1, 0.2, 0.05, 0.15);
    assertEquals(0.3, stats.getPrecision(), EPSILON);
    assertEquals(0.1, stats.getRecall(), EPSILON);
    assertEquals(0.15, stats.getF1Measure(), EPSILON);
    assertEquals(0.11538461538462, stats.getFNMeasure(2.0), EPSILON);
    assertEquals(0.05, stats.getNormalizedDiscountedCumulativeGain(), EPSILON);
  }
View Full Code Here

TOP

Related Classes of org.apache.mahout.cf.taste.eval.IRStatistics

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.