<!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 />
    <article-meta>
      <title-group>
        <article-title>From Covariance to Comode in context of Principal Component Analysis</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Daniyal Kazempour</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Long Mathias Yan</string-name>
          <email>l.yan@campus.lmu.de</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Thomas Seidl</string-name>
          <email>seidlg@dbs.ifi.lmu.de</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Ludwig-Maximilians-Universitat Munchen</institution>
          ,
          <addr-line>Munich</addr-line>
          ,
          <country country="DE">Germany</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>When it comes to the task of dimensionality reduction, the Principal Component Analysis (PCA) is among the most well known methods. Despite its popularity, PCA is prone to outliers which can be traced back to the fact that this method relies on a covariance matrix. Even with the variety of sophisticated methods to enhance the robustness of the PCA, we provide here in this work-in-progress an approach which is intriguingly simple: the covariance matrix is replaced by a socalled comode matrix. Through this minor modi cation the experiments show that the reconstruction loss is signi cantly reduced. In this work we introduce the comode and its relation to the MeanShift algorithm, including its bandwidth parameter, compare it in an experiment against the classic covariance matrix and evaluate the impact of the bandwidth hyperparameter on the reconstruction error.</p>
      </abstract>
      <kwd-group>
        <kwd>Covariance Comode Principal Component Analysis</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>
        In cases where we have to deal with high-dimensional data, a common strategy is
to perform a Principal Component Analysis (PCA)[
        <xref ref-type="bibr" rid="ref5">5</xref>
        ]. A PCA yields eigenpairs
consisting of eigenvectors and their corresponding eigenvalues. In the use-case of
dimensionality reduction, projecting given data down to the eigenvectors with
the top-k eigenvalues, comes with a reconstruction error when projecting it back
to the full dimensional data. This reconstruction error decreases if more principal
components are incorporated. Nevertheless, despite using more principal
components, the reconstruction error can still be signi cantly high. Outliers can heavily
skew the results which is originated in the mere observation that an outlier can
skew the mean for each of the features of a data set. More robust measures of
central tendency are the median and the mode. In this work we propose the
so-called comode matrix as an alternative to the covariance matrix on which the
eigenvalues and eigenvectors are computed in a PCA. Our contribution in this
work-in-progress shows that it is more robust towards outliers, but at the same
time dependant on the choice of a hyperparameter known as bandwidth.
      </p>
      <p>
        Copyright c 2019 for this paper by its authors. Use permitted under Creative
Commons License Attribution 4.0 International (CC BY 4.0).
Many e orts have been made to make the PCA more robust towards noise. As
such in the work of [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ] the authors describe a robust M-estimation algorithm for
capturing multivariate representations of high-dimensional data exemplary on
images, known as Robust Principal Component Analysis. The authors elaborate
that methods such as RANSAC[
        <xref ref-type="bibr" rid="ref3">3</xref>
        ] and Least Median Squares would be more
robust compared to M-estimation yet remain unclear in their application on
high-dimensional data. In a classical approach by Candes et al. [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ] the outliers
are modeled by a sparse matrix based on the assumption that the data matrix
can be expressed in terms of a sum of a low rank and a sparse matrix. The so far
mentioned methods rely on complex and sophisticated methods. We challenge
the task of robust PCA by asking: What if we simply replace the covariance
matrix by a comode matrix? Since the mode is insensitive against noise, so
should be the comode according to our hypothesis.
3
      </p>
    </sec>
    <sec id="sec-2">
      <title>Comode</title>
      <p>Given a data matrix D where each of its rows represents a data record and
its columns represent the features (A1; :::; Ad). When performing a PCA, rst
a covariance matrix is computed. The covariance is a generalization of the
variance. For computing the covariance from every feature, the expected value
E (mean) is subtracted. Since the mean is sensitive towards outliers, the
computation of the covariance matrix is also sensitive against outliers. A more robust
measure is the mode. Generalizing the mode like variance is generalized to the
covariance leads to the comode:
. . .</p>
      <p>com(A1; Ad) 1</p>
      <p>... CA
mode(Ad)</p>
      <p>
        But how do we actually compute com(Ai; Aj) which represents the mode of
a variable Ai in dependence of another variable Aj? One solution we propose
here relies on the so called MeanShift[
        <xref ref-type="bibr" rid="ref2">2</xref>
        ] algorithm. MeanShift is a method which
was primarily used for locating the maxima, which are basically the modes of a
given density function. It is well known as being a mode-seeking algorithm and
its applications have been extended to tasks like cluster analysis. For any given
data object x the shifted data object at one iteration is computed as:
m(x) =
      </p>
      <p>PiN=(1x) K(x
PiN=(1x) K(x
xi)xi
xi)
(1)
where K(X) = k de nes a kernel and N(x) are all objects in the
neighborhood of x within a bandwidth . The bandwidth follows the intuition of an
-range. It de nes the local neighborhood of an data object x. The mean shif t
of x is the di erence m(x) x. At this point it may still be unclear how the
MeanShift may lead to the detection of the comodes? A comode com(Ai; Aj) is
determined by computing the MeanShift shift(DAi;Aj ) on a given dataset D
considering only its features (= random variables) Ai and Aj.</p>
      <p>The comode matrix can thus be expressed in terms of MeanShift
computations:</p>
      <p>What remains unclear so far is: how do we approach the fact that there can
be not only one (unimodal) but several (multimodal) modes? In this
work-inprogress we have focused on taking the mode with the highest frequency, meaning
we take the top mode which has the highest number of objects belonging to it.
In the case where we have several equally high top-modes, we randomly select
one of them. Due to the brevity of this paper, we pursue it in future work to
elaborate and evaluate the impact of choosing di erent top-modes.
4</p>
    </sec>
    <sec id="sec-3">
      <title>Experiments</title>
      <p>In our experiments we use the MeanShift with a at kernel from sklearn1. For
reproducibility purposes, the code is made available on github2. We conduct our
experiments on the iris dataset3 which consists of 150 instances and 4 features.
We compute the PCA using the comode instead of the covariance matrix. We
discard all principal components from the eigenvector matrix U except the rst
one, and project the data D down to its lower (one)dimensional representation
Y through: Y = D Uk=i. We reconstruct the data by projecting it back to its
original full-dimensional representation through: Z = Y Uk=i. By projecting
the data down and back again, enables us to compute the Mean Squared Error
(MSE) which is de ned as M SE(D; Z) = Pin=1(ndi zi)2 where di 2 D, zi 2 Z
and n denoted the number of objects for which holds n = jDj = jZj. We apply
this procedure for taking the second, third,...,d-th principal component. Since
we want to investigate the e ect of the choice of the bandwidth we further
perform the comode computation choosing the bandwidths = (0:1; 4:0; 5:5). The
results can be seen in Figure 4 where the horizontal axis represents the principal
components in descending order of their corresponding eigenvalues. The vertical
axis represents the MSE. It can be seen from Figure 4 that PCA with comode
and a bandwidth of = 0:1 yields an MSE ( 1) which is signi cantly below
that of the classical PCA with a covariance matrix ( 7) taking only the rst
1 https://scikit-learn.org/stable/modules/generated/sklearn.cluster.MeanShift.html
2 https://github.com/hamilton-function/comode
3 https://archive.ics.uci.edu/ml/datasets/iris
principal component. By taking additionally the second principal component
the MSE of the covariance-based PCA drops even slightly below the MSE of the
comode variant with = 0:1 which holds for taking three principal components
as well. A larger bandwidth of = 4:0 yields to MSE values which exhibit a
course similar to that of the covariance-based PCA but with overall higher MSE
values. At this point it is interesting for further research to investigate if there
is an 'even'-point regarding the bandwidth where the MSE for di erent number
of principal components equals the MSE of the covariance-based PCA. A
bandwidth of = 5:5 yields MSE results which are by far worse compared to the
other settings.</p>
      <p>
        However, we have to take the MSE results with a grain of salt for the
following observation which has been made in [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ]. Here the insights were that a low
MSE (or in that work: MAE) does not imply a high robustness towards outlier.
In fact, the opposite is the case: a low MSE indicates that even outliers can be
reconstructed well, which in turn means that the computed principal component
is distorted by the outlier. In contrast, a high MSE can indicate that a principal
component has been computed which does not take outliers into account, giving
therefore more weight to the majority of the objects following a direction with
largest variance. As we stated a high MSE can indicate a better principal
component. For this purpose in future work it is vital do develop methods by which
the reconstruction without the outliers is computed. With the bandwidth we
have a control unit to tune the comode computation such that either the MSE is
minimized, or the overall deviation from the principal component is minimized.
      </p>
    </sec>
    <sec id="sec-4">
      <title>Conclusion and Future Work</title>
      <p>In this work-in-progress we have presented the Comode in context of PCA. A rst
experiment showed promising results, outperforming a covariance-based PCA
while being intriguingly simple. There are however interesting aspects which
demand further research: rst and foremost, it remains an open question on how
to deal with multimodal cases. What are the e ects on the PCA if we choose
the second or third strongest mode(s)? How are good bandwidths determined?
For these aspects we may seek previous works which aimed at estimating good
bandwidths for MeanShift. Further it is of interest to investigate if
featurespeci c bandwidths have any impact on the robustness of the Comode-based
PCA. As for now, we have one bandwidth which is valid for all features,
neglecting feature-speci c bandwidths. We hope to stimulate further research on the
Comode, revealing its limitations as well as its potentials.</p>
    </sec>
    <sec id="sec-5">
      <title>Acknowledgement</title>
      <p>This work has been funded by the German Federal Ministry of Education and
Research (BMBF) under Grant No. 01IS18036A. The authors of this work take
full responsibilities for its content.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <surname>Candes</surname>
            ,
            <given-names>E.J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Li</surname>
            ,
            <given-names>X.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Ma</surname>
            ,
            <given-names>Y.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Wright</surname>
          </string-name>
          , J.:
          <article-title>Robust principal component analysis? Journal of the ACM (JACM) 58(3</article-title>
          ),
          <volume>11</volume>
          (
          <year>2011</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2. Cheng, Y.:
          <article-title>Mean shift, mode seeking, and clustering</article-title>
          .
          <source>IEEE transactions on pattern analysis and machine intelligence</source>
          <volume>17</volume>
          (
          <issue>8</issue>
          ),
          <volume>790</volume>
          {
          <fpage>799</fpage>
          (
          <year>1995</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>Fischler</surname>
            ,
            <given-names>M.A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Bolles</surname>
            ,
            <given-names>R.C.</given-names>
          </string-name>
          :
          <article-title>Random sample consensus: a paradigm for model tting with applications to image analysis and automated cartography</article-title>
          .
          <source>Communications of the ACM</source>
          <volume>24</volume>
          (
          <issue>6</issue>
          ),
          <volume>381</volume>
          {
          <fpage>395</fpage>
          (
          <year>1981</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>Kazempour</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ; Hunemorder,
          <string-name>
            <given-names>M.A.X.</given-names>
            ;
            <surname>Seidl</surname>
          </string-name>
          ,
          <string-name>
            <surname>T.</surname>
          </string-name>
          :
          <article-title>On coMADs and Principal Component Analysis</article-title>
          .
          <source>SISAP 2019 - Springer Lecture Notes in Computer Science</source>
          (
          <year>2019</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <surname>Pearson</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          : Liii.
          <article-title>on lines and planes of closest t to systems of points in space</article-title>
          .
          <source>The London, Edinburgh, and Dublin Philosophical Magazine and Journal of Science</source>
          <volume>2</volume>
          (
          <issue>11</issue>
          ),
          <volume>559</volume>
          {
          <fpage>572</fpage>
          (
          <year>1901</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <surname>De la Torre</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Black</surname>
            ,
            <given-names>M.J.:</given-names>
          </string-name>
          <article-title>Robust principal component analysis for computer vision</article-title>
          . In: Proceedings Eighth IEEE International Conference on
          <source>Computer Vision. ICCV 2001</source>
          . vol.
          <volume>1</volume>
          , pp.
          <volume>362</volume>
          {
          <fpage>369</fpage>
          .
          <string-name>
            <surname>IEEE</surname>
          </string-name>
          (
          <year>2001</year>
          )
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>