Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## prea.recommender.baseline
Class Average

    java.lang.Object
      prea.recommender.baseline.BaselineRecommender
          prea.recommender.baseline.Average

All Implemented Interfaces:
  Recommender

    public class Average

extends BaselineRecommender

The class implementing a baseline, predicting by overall average of training set ratings.

Since:
  2012. 4. 20
Version:
  1.1
Author:
  Joonseok Lee

Field Summary
`private double` | `constantValue` The value which will be used for predicting all ratings.

Fields inherited from class prea.recommender.baseline.BaselineRecommender
`itemCount, maxValue, minValue, rateMatrix, userCount`

Constructor Summary
`Average(int uc, int ic, double max, double min)` Construct a constant model with the given data.

Method Summary
`void` | `buildModel(SparseMatrix rm)` Build a model with given training set.
`double` | `predict(int userId, int itemId)` Predict a rating for the given user and item.

Methods inherited from class prea.recommender.baseline.BaselineRecommender
`evaluate`

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

Field Detail

### constantValue

    private double constantValue

  The value which will be used for predicting all ratings.

Constructor Detail

### Average

    public Average(int uc,
                   int ic,
                   double max,
                   double min)

  Construct a constant model with the given data.

  Parameters:
    `uc` - The number of users in the dataset.
    `ic` - The number of items in the dataset.
    `max` - The maximum rating value in the dataset.
    `min` - The minimum rating value in the dataset.

Method Detail

### buildModel

    public void buildModel(SparseMatrix rm)

  Build a model with given training set.

  Specified by:
    `buildModel` in interface `Recommender`
  Overrides:
    `buildModel` in class `BaselineRecommender`
  Parameters:
    `rm` - Training data set.

### predict

    public double predict(int userId,
                          int itemId)

  Predict a rating for the given user and item.

  Specified by:
    `predict` in class `BaselineRecommender`
  Parameters:
    `userId` - The target user.
    `itemId` - The target item.
  Returns:
    predicted rating.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD