<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta>
      <journal-title-group>
        <journal-title>September</journal-title>
      </journal-title-group>
    </journal-meta>
    <article-meta>
      <title-group>
        <article-title>On the use of Weighted Mean Absolute Error in Recommender Systems</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>S. Cleger-Tamayo</string-name>
          <email>sergio@facinf.uho.edu.cu</email>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>J.M. Fernández-Luna &amp; J.F. Huete</string-name>
          <email>{jmfluna,jhg}@decsai.ugr.es</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Dpto. de Ciencias de la Computación e I.A., CITIC - UGR Universidad de Granada</institution>
          ,
          <country country="ES">Spain</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Dpto. de Informática., Universidad de Holguín</institution>
          ,
          <country country="CU">Cuba</country>
        </aff>
      </contrib-group>
      <pub-date>
        <year>2012</year>
      </pub-date>
      <volume>9</volume>
      <issue>2012</issue>
      <fpage>24</fpage>
      <lpage>26</lpage>
      <abstract>
        <p>The classical strategy to evaluate the performance of a Recommender System is to measure the error in rating predictions. But when focusing on a particular dimension in a recommending process it is reasonable to assume that every prediction should not be treated equally, its importance depends on the degree to which the predicted item matches the deemed dimension or feature. In this paper we shall explore the use of weighted Mean Average Error (wMAE) as an alternative to capture and measure their e ects on the recommendations. In order to illustrate our approach two di erent dimensions are considered, one item-dependent and the other that depends on the user preferences.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. INTRODUCTION</title>
      <p>
        Several algorithms based on di erent ideas and concepts
have been developed to compute recommendations and, as
a consequence, several metrics can be used to measure the
performance of the system. In the last years, increasing
efforts have been devoted to the research of Recommender
System (RS) evaluation. According to [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ], \the decision on
the proper evaluation metric is often critical, as each
metric may favor a di erent algorithm". The selected metric
depends on the particular recommendation tasks to be
analyzed. Two main tasks might be considered: the rst one,
with the objective of measuring the capability of a RS to
predict the rating that a user should give to an unobserved
item, and the second one is related to the ability of an RS
to rank a set of unobserved items, in such a way that those
items more relevant to the user have to be placed in top
positions of the ranking. Our interest in this paper is the
measurement of the capability of a system to predict user
interest in an unobserved item, so we focus on rating
prediction.
      </p>
      <p>
        For this purpose, two standard metrics [
        <xref ref-type="bibr" rid="ref2 ref3">3, 2</xref>
        ] have been
traditionally considered: the Mean Absolute Error (MAE)
and the Root Mean Squared Error (RMSE). Both metrics
try to measure which might be the expected error of the
Acknowledgements: This work was jointly supported by the
Spanish Ministerio de Educación y Ciencia and Junta de Andalucía, under
projects TIN2011-28538-C02-02 and Excellence Project TIC-04526,
respectively, as well as the Spanish AECID fellowship program.
system, RMSE being more sensitive to the occasional large
error: the squaring process gives higher weight to very large
errors. A valuable property of both metrics is that they take
their values in the same range as the error being estimated,
so they can be easily understood by the users.
      </p>
      <p>But, these metrics consider that the standard deviation of
the error term is constant over all the predictions, i.e. each
prediction provides equally precise information about the
error variation. This assumption, however, does not hold, even
approximately, in every recommending application. In this
paper we will focus on the weighted Mean Absolute Error,
wMAE, as an alternative to measure the impact of a given
feature in the recommendations1. Two are the main
purposes for using this metric: On the one hand, as an enhanced
evaluation tool for better assessing the RS performance with
respect to the goals of the application. For example, in the
case of recommending books or movies it could be possible
that the accuracy of the predictions varies when focusing on
past or recent products. In this situation, it is not
reasonable that every error were treated equally, so more stress
should be put in recent items. On the other hand, it can
be also useful as a diagnosis tool that, using a \magnifying
lens", can help to identify those cases where an algorithm is
having trouble with. For both purposes, di erent features
shall be considered which might depend on the items, as
for example, in the case of a movie-based RS the genre, the
release date, price, etc. But also, the dimension might be
user-dependent considering, for example, the location of the
user, the users' rating distribution, etc.</p>
      <p>
        This metric has been widely used for evaluation of model
performance in several elds as meteorology or economic
forecasting [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ]. But, few have been discussed about its use
in the recommending eld; isolately several papers use small
tweaks on error metrics in order to explore di erent aspects
of RS [
        <xref ref-type="bibr" rid="ref5 ref7">5, 7</xref>
        ]. Next section presents the weighted mean
absolute error, illustrating its performance considering two di
erent features, user and item-dependent, respectively. Lastly
we present the concluding remarks.
2.
      </p>
    </sec>
    <sec id="sec-2">
      <title>WEIGHTED MEAN ABSOLUTE ERROR</title>
      <p>
        The objective of this paper is to study the use of a
weighting factor in the average error. In order to illustrate its
functionality we will consider simple examples obtained using
four di erent collaborative-based RS (using Mahout
implementations): i) Means, that predicts using the average
rat1A similar reasoning can be used when considering squared
error, which yields to the weighted Mean Root Squared
Error, wRMSE.
ings for each user; ii) LM [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ], following a nearest neighbors
approach; iii) SlopeOne [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ], predicting based on the average
di erence between preferences and iv) SVD [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ], based on a
matrix factorization technique. The metric performance is
showed using an empirical evaluation based on the classic
MovieLens 100K data set.
      </p>
      <p>A weighting factor would indicate the subjective
importance we wish to place on each prediction, relating the error
to any feature that might be relevant from both, the user or
the seller point of view. For instance, considering the release
date, we can assign weights in such a way that the higher the
weight, the higher importance we are placing on more recent
data. In this case we could observe that even when the MAE
is under reasonable threshold, the performance of a system
might be inadequate when analyzing this particular feature.</p>
      <p>The weighted Mean Absolute Error can be computed as
wM AE =</p>
      <p>PiU=1 PjN=i1 wi;j</p>
      <p>PiU=1 PjN=i1 wi;j
abs(pi;j
ri;j )
;
(1)
where U represents the number of users; Ni, the number
of items predicted for the ith-user; ri;j , the rating given by
the ith-user to the item Ij; pi;j , the rating predicted by
the model and wi;j represents the weight associated to this
prediction. Note that when all the individual di erences are
weighted equally wM AE coincides with M AE.</p>
      <p>In order to illustrate our approach, we shall consider two
factors, assuming that wi;j 2 [0; 1].</p>
      <p>Item popularity: we would like to investigate whether
the error in the predictions depends on the number of users
who rated the items. Two alternatives will be considered:
i+ The weights will put more of a penalty on bad
predictions when an item has been rated quite frequently
(the items has a high number of ratings). We still
penalize bad predictions when it has a small number of
ratings, but we do not penalize as much as when we
have more samples, since it may just be that the
limited number of ratings do not provide much
information about the latent factors which in uence the users
ratings. Particularly, for each item Ii we shall consider
its weight as the probability that this item were rated
in the training set, i.e. wi = pr(Ii).
i{ This is the inverse of the previous criterion, where we
put more emphasis on the predictions over those items
with fewer ratings. So the weights are wi = 1 pr(Ii).</p>
      <p>Rating distribution: It is well known that the users
does not rate the items uniformly, they tend to use
highvalued ratings. By means of this feature we can measure
whether the error depends on the ratings distribution or not.
Particularly, we shall consider four di erent alternatives:
rS+ Considering the overall rating distribution in the
system, putting more emphasis on the error in the
predictions on those common ratings. So the weights are
wi = prS(ri), ri being the rating given by the user to
the item Ii.
rS{ Inversely, we assess more weight to the less common
ratings, i.e. wi = 1 prS(ri).
rU+ Di erent users can use a di erent pattern of rating, so
we consider the rating distribution of the user, in such
a way that those common ratings for a particular user
will have greater weights, i.e. wi = prU (ri).
rU{ The last one assigns more weight to the less frequent
rating, i.e. wi = 1 prU (ri).</p>
      <p>Figures 1-A and 1-B present the absolute values of the
MAE and wMAE error for the four RSs considered in this
paper. Figure 1-A shows the results where the weights
are positively correlated to the feature distribution, whereas
Figure 1-B presents the results when they are negatively
correlated. In this case, we can observe that by using wMAE we
can determine that error is highly dependent on the users'
pattern of ratings, and weaker when considering item
popularity. Moreover, if we compare the two gures we can
observe that all the models perform better when predicting
the most common ratings. In this sense, they are able to
learn the most frequent preferences and greater errors (bad
performance) are obtained when focusing on less frequent
rating values. Related to item popularity these di erences
are less conclusive. In some sense, the way in which the user
rates an item does not depend of how popular the item is.
2.1</p>
    </sec>
    <sec id="sec-3">
      <title>Relative Weights vs. Relative Error</title>
      <p>Another di erent alternative to explore the bene ts of
using the wMAE metric is to consider the ratio between wMAE
and MAE. In this sense, denoting as ei;j = abs(pi;j ri;j ),
we have that wMAE/MAE is equal to
wM AE=M AE =</p>
      <p>Pi;j wi;j ei;j = Pi;j ei;j</p>
      <p>Pi;j wi;j =N
:</p>
      <p>Taking into account that we restrict the weights to take its
value in the [0; 1] interval, the denominator might represent
the average percentage of mass of the items that is related
to the dimension under consideration whereas the numerator
represents the average percentage of the error coming from
this feature. So, when wMAE &gt; MAE we have that the
percentage of error coming from the feature is greater than
its associated mass, so the the system is not able to predict
properly such dimension. When both metrics are equal this
implies that the expected error is independent of the feature.</p>
      <p>In Figure 1-C we present the values of the wMAE/MAE
where, again, we can see that there exists a dependence
between the rating and the error. The error associated to the
common ratings are less than the relative importance of this
feature in the system whereas for less common ratings the
system is not able to perform good predictions, being greater
the relative error than its associated weights. This situation
does not hold when considering item popularity.</p>
      <p>Figures 1-D and 1-E present an scatter plot that relates
the relative weights (horizontal axis) to the relative error
(vertical axis) for each user in the system and for each RS
used2. Particularly, in Figure 1-D we are considering rU+
as weighting factor. Note that, since there are 5 possible
ratings, the relative weight is equal to 0.2 when all the
ratings are equally probable and its value increases with the
importance of the most used ratings. In this gure we can
see that both percentage of mass and the percentage of
error are positively correlated, being wMAE/MAE &lt; 1 for
most of the users. Moreover, there is a trend to improve the
predictions for those users with higher relative mass (for
example, we can see how the regression line for the LM model
2We have included all the users with at least 10 predictions.
0,6
0,5
rrr
o
e
0,4
e
v
ilt
a
e
0r,3
0,2</p>
      <p>A
D</p>
      <p>Means</p>
      <p>LM</p>
      <p>Slope One</p>
      <p>SVD
LM Lineal (LM ) SO SVD</p>
      <p>i</p>
      <p>F
0,10,1 0,2 0r,3elative0,w4eight0,5 0,6 0,7
0,0000,50005
0,0010
0,0015 0,0020
relative weight
0,0025
0,0030
0,0035
rUrS+
rSigets further away3 from the line y=x). In some way we can
conclude that recommendation usefulness of the rating
distribution is consistent for all the users and RS models. On
the other hand, Figure 1-E considers i+ as weights. In this
case, although weights and error are positively correlated,
there exists signi cant di erences between di erent users.
This result is hidden in the global measures.
2.2</p>
    </sec>
    <sec id="sec-4">
      <title>Relative Comparison Among Models</title>
      <p>Although wMAE might give some information about how
the error has been obtained, there is no criterion about what
a good prediction is. In order to tackle this situation we
propose the use of the relative rather than the absolute error,
i.e. the weighted Mean Absolute Percentage Error, wMAPE.
Then, given two models, M 1 and M 2, the relative metric is
de ned as wM AEM1=wM AEM2. In this metric, the less
the value, the greater the improvements. Thus, if we x the
model M2 to be a simple model (as the average rating) we
obtain the wMAE values in Figure 1-F. From these values,
we can obtain some conclusions as for instance that LM ts
better the common user's preferences (rU+), whereas Slope
One and SVD are more biased toward the overall rating
distribution in the system (rS+). Similarly, we found that
better improvements, with respect to the average ratings, are
obtained when focusing on less frequent ratings. Finally,
with respect to item popularity all the models obtain
better improvements when considering the most popular items,
although these di erences are less signi cant.</p>
    </sec>
    <sec id="sec-5">
      <title>CONCLUSIONS</title>
      <p>In this paper we have explored the use of weighted Mean
Average Error as a means to measure the RS's performance
by focusing on a given dimension or feature, being able to
3The other models perform similarly, but we have decided
to not include these regression lines due to clarity reasons.
uncover speci c cases where a recommendation algorithm
may be having suboptimal performance. This is a very
useful way to know the origin of the errors found in the
recommendations and therefore useful for improving the RSs,
although its main problem is that it is not absolute as MAE.
4.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>S.</given-names>
            <surname>Cleger-Tamayo</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.M.</given-names>
            <surname>Fernandez-Luna</surname>
          </string-name>
          and
          <string-name>
            <given-names>J.F.</given-names>
            <surname>Huete</surname>
          </string-name>
          .
          <article-title>A New Criteria for Selecting Neighborhood in Memory-Based Recommender Systems</article-title>
          .
          <source>Proc. of 14th CAEPIA'11</source>
          , pp.
          <fpage>423</fpage>
          -
          <lpage>432</lpage>
          .
          <year>2011</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>A.</given-names>
            <surname>Gunawardana</surname>
          </string-name>
          and
          <string-name>
            <given-names>G.</given-names>
            <surname>Shani</surname>
          </string-name>
          .
          <article-title>A Survey of Accuracy Evaluation Metrics of Recommendation Tasks</article-title>
          .
          <source>Journal of Machine Learning Research 10</source>
          , pp.
          <fpage>2935</fpage>
          -
          <lpage>2962</lpage>
          .
          <year>2009</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>J.L.</given-names>
            <surname>Herlocker</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.A.</given-names>
            <surname>Konstan</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L.G.</given-names>
            <surname>Terveen</surname>
          </string-name>
          and
          <string-name>
            <given-names>J.T.</given-names>
            <surname>Riedl</surname>
          </string-name>
          .
          <article-title>Evaluating collaborative ltering recommender systems</article-title>
          .
          <source>ACM Trans. Inf. Syst</source>
          .
          <volume>22</volume>
          ,
          <issue>1</issue>
          .
          <year>2004</year>
          , pp.
          <fpage>5</fpage>
          -
          <lpage>53</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>D.</given-names>
            <surname>Lemire</surname>
          </string-name>
          and
          <string-name>
            <given-names>A.</given-names>
            <surname>Maclachlan</surname>
          </string-name>
          .
          <article-title>Slope One Predictors for Online Rating-Based Collaborative Filtering</article-title>
          .
          <source>Proc. of SIAM Data Mining (SDM'05)</source>
          ,
          <year>2005</year>
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>P.</given-names>
            <surname>Massa</surname>
          </string-name>
          and
          <string-name>
            <given-names>P.</given-names>
            <surname>Avesani</surname>
          </string-name>
          .
          <article-title>Trust metrics in recommender systems</article-title>
          .
          <source>Computing with Social Trust</source>
          , pp.
          <fpage>259</fpage>
          -
          <issue>285</issue>
          <year>Springer 2009</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>B.M.</given-names>
            <surname>Sarwar</surname>
          </string-name>
          , G. Karypis,
          <string-name>
            <given-names>J.</given-names>
            <surname>Konstan</surname>
          </string-name>
          and
          <string-name>
            <given-names>J.</given-names>
            <surname>Riedl</surname>
          </string-name>
          .
          <article-title>Incremental SVD-Based Algorithms for Highly Scaleable Recommender Systems</article-title>
          .
          <source>5th International Conf. on Computer and Information Technology</source>
          .
          <year>2002</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>T.</given-names>
            <surname>Jambor</surname>
          </string-name>
          and
          <string-name>
            <given-names>J.</given-names>
            <surname>Wang</surname>
          </string-name>
          .
          <article-title>Goal-driven collaborative ltering: A directional error based approach</article-title>
          .
          <source>In Proc. ECIR</source>
          '
          <year>2010</year>
          . pp.
          <fpage>407</fpage>
          -
          <lpage>419</lpage>
          .
          <year>2010</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <given-names>C.J.</given-names>
            <surname>Willmot</surname>
          </string-name>
          .
          <article-title>Statistics for the Evaluation and Comparison of Models</article-title>
          .
          <source>Journal of Geophysical Research</source>
          ,
          <volume>90</volume>
          . pp.
          <fpage>8995</fpage>
          -
          <lpage>9005</lpage>
          ,
          <year>1985</year>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>