Bipolar disorder (BD) and major depressive disorder (MDD) both share depressive symptoms, so how to discriminate them in early depressive episodes is a major clinical challenge. Independent components (ICs) extracted from fMRI data have been proved to carry distinguishing information and can be used for classification. Here we extend a previous method that makes use of multiple fMRI ICs to build linear subspaces for each individual, which is further used as input for classifiers. The similarity matrix between different subjects is first calculated using distance metric of principal angle, which is then projected into kernel space for support vector machine (SVM) classification among 37 BDs and 36 MDDs. In practice, we adopt forward selection technique on 20 ICs and nested 10-fold cross validation to select the most discriminative IC combinations of fMRI and determine the final diagnosis by majority voting mechanism. The results on human data demonstrate that the proposed method achieves much better performance than its initial version  (93% vs. 75%), and identifies 5 discriminative fMRI components for distinguishing BD and MDD patients, which are mainly located in prefrontal cortex, default mode network and thalamus etc. This work provides a new framework for helping diagnose the new patients with overlapped symptoms between BD and MDD, which not only adds to our understanding of functional deficits in mood disorders, but also may serve as potential biomarkers for their differential diagnosis.