concept precision in category machine learning

appears as: precision, The precision, precision
Machine Learning Bookcamp

This is an excerpt from Manning's book Machine Learning Bookcamp.

For our model the precision is 62%:

Figure 4.17 The precision of a model is the fraction of correct predictions (TP) among all positive predictions (TP + FP).
Mahout in Action

This is an excerpt from Manning's book Mahout in Action.

Taking this more general view, we could also apply classic information retrieval metrics to evaluate recommenders: precision and recall. These terms are typically applied to things like search engines, which return a set of best results for a query out of many possible results.

A search engine shouldn’t return irrelevant results in the top results, but it should strive to return as many relevant results as possible. Precision is the proportion of top results that are relevant, for some definition of relevant. Precision at 10 would be this proportion judged from the top 10 results. Recall is the proportion of all relevant results included in the top results. See figure 2.3 for a visualization of these ideas.

Figure 2.3. An illustration of precision and recall in the context of search results

These terms can easily be adapted to recommenders: precision is the proportion of top recommendations that are good recommendations, and recall is the proportion of good recommendations that appear in top recommendations. The next section will define good.

Listing 3.7. Evaluating precision and recall with Boolean data
DataModel model = new GenericBooleanPrefDataModel( new FileDataModel(new File("ua.base"))); RecommenderIRStatsEvaluator evaluator = new GenericRecommenderIRStatsEvaluator(); RecommenderBuilder recommenderBuilder = new RecommenderBuilder() { @Override public Recommender buildRecommender(DataModel model) { UserSimilarity similarity = new LogLikelihoodSimilarity(model); UserNeighborhood neighborhood = new NearestNUserNeighborhood(10, similarity, model); return new GenericUserBasedRecommender( model, neighborhood, similarity); } }; DataModelBuilder modelBuilder = new DataModelBuilder() { @Override public DataModel buildDataModel( FastByIDMap<PreferenceArray> trainingData) { return new GenericBooleanPrefDataModel( GenericBooleanPrefDataModel.toDataMap(trainingData)); } }; IRStatistics stats = evaluator.evaluate( recommenderBuilder, modelBuilder, model, null, 10, GenericRecommenderIRStatsEvaluator.CHOOSE_THRESHOLD, 1.0); System.out.println(stats.getPrecision()); System.out.println(stats.getRecall());