Dynamic Principal Projection for Cost-Sensitive Online Multi-Label Classification

We study multi-label classification (MLC) with three important real-world issues: online updating, label space dimensional reduction (LSDR), and cost-sensitivity. Current MLC algorithms have not been designed to address these three issues simultaneously. In this paper, we propose a novel algorithm, cost-sensitive dynamic principal projection (CS-DPP) that resolves all three issues. The foundation of CS-DPP is an online LSDR framework derived from a leading LSDR algorithm. In particular, CS-DPP is equipped with an efficient online dimension reducer motivated by matrix stochastic gradient, and establishes its theoretical backbone when coupled with a carefully-designed online regression learner. In addition, CS-DPP embeds the cost information into label weights to achieve cost-sensitivity along with theoretical guarantees. Experimental results verify that CS-DPP achieves better practical performance than current MLC algorithms across different evaluation criteria, and demonstrate the importance of resolving the three issues simultaneously.


Introduction
The multi-label classification (MLC) problem allows each instance to be associated with a set of labels and reflects the nature of a wide spectrum of real-world applications [8,4,12]. Traditional MLC algorithms mainly tackle the batch MLC problem, where the input data are presented in a batch [24,28]. Nevertheless, in many MLC applications such as e-mail categorization [22], multi-label examples arrive as a stream. Online analysis is therefore required as batch MLC algorithms may not meet the needs to make a prediction and update the predictor on the fly. The needs of such applications can be formalized as the online MLC (OMLC) problem.
The OMLC problem is generally more challenging than the batch one, and many mature algorithms for the batch problem have not yet been carefully extended to OMLC. Label space dimension reduction (LSDR) is a family of mature algorithms for the batch MLC problem [7,13,17,26,14,25,33,6,2,5]. By viewing the label set of each instance as a high-dimensional label vector in a label space, LSDR encodes each label vector as a code vector in a lowerdimensional code space, and learns a predictor within the code space. An unseen instance is predicted by coupling the predictor with a decoder from the code space to the label space. For example, compressed sensing (CS) [13] encodes using random projections, and decodes with sparse vector reconstruction; principal label space transformation (PLST) [26] encodes by projecting to the key eigenvectors of the known label vectors obtained from principal component analysis (PCA), and decodes by reconstruction with the same eigenvectors. This low-dimensional encoding allows LSDR algorithms to exploit the key joint information between labels to be more robust to noise and be more effective on learning [26]. Nevertheless, to the best of our knowledge, all the LSDR algorithms mentioned above are designed only for the batch MLC problem.
Another family of MLC algorithms that have not been carefully extended for OMLC contains the cost-sensitive MLC algorithms. In particular, different MLC applications usually come with different evaluation criteria (costs) that reflect their realistic needs. It is important to design MLC algorithms that are cost-sensitive to systematically cope with different costs, because an MLC algorithm that targets one specific cost may not always perform well under other costs [15]. Two representative cost-sensitive MLC algorithms are probabilistic classifier chain (PCC) [10] and condensed filter tree (CFT) [15]. PCC estimates the conditional probability with the classifier chain (CC) method [24] and makes Bayes-optimal predictions with respect to the given cost; CFT decomposes the cost into instance weights when training the classifiers in CC. Both algorithms, again, targets the batch MLC problem rather than the OMLC one.
From the discussions above, there is currently no algorithm that considers the three realistic needs of online updating, label space dimension reduction, and cost-sensitivity at the same time. The goal of this work is to study such algorithms. We first formalize the OMLC and cost-sensitive OMLC (CSOMLC) problems in Section 2 and discuss related work. We then extend LSDR for the OMLC problem and propose a novel online LSDR algorithm, dynamic principal projection (DPP), by connecting PLST with online PCA. In particular, we derive the DPP algorithm in Section 3 along with its theoretical guarantees, and resolve the issue of possible basis drifting caused by online PCA.
In Section 4, we further generalize DPP to cost-sensitive DPP (CS-DPP) to fully match the needs of CSOMLC with a theoretically-backed label-weighting scheme inspired by CFT. Extensive empirical studies demonstrate the strength of CS-DPP in addressing the three realistic needs in Section 5. In particular, we justify the necessity to consider LSDR, basis drifting and cost-sensitivity. The results show that CS-DPP significantly outperforms other OMLC competitors across different CSOMLC problems, which validates the robustness and effectiveness of CS-DPP, as concluded in Section 6.

Preliminaries and Related Work
For the MLC problem, we denote the feature vector of an instance as x ∈ R d and its corresponding label vector as y ∈ Y ≡ {+1, −1} K , where y[k] = +1 iff the instance is associated with the k-th label out of a total of K possible labels. We let y[k] ∈ {+1, −1} to conform with the common setting of online binary classification [9], which is equivalent to another scheme, y[k] ∈ {1, 0}, used in other MLC works [15,24].
Traditional MLC methods consider the batch setting, where a training dataset D = {(x n , y n )} N n=1 is given at once, and the objective is to learn a classifier g : R d → {+1, −1} K from D with the hope thatŷ = g(x) accurately predicts the ground truth y with respect to an unseen x. In this work, we focus on the OMLC setting, which assumes that instance (x t , y t ) arrives in sequence from a data stream. Whenever an x t arrives at iteration t, the OMLC algorithm is required to make a predictionŷ t = g t (x t ) based on the current classifier g t and feature vector x t . The ground truth y t with respect to x t is then revealed, and the penalty of y t is evaluated against y t .
Many evaluation criteria for comparing y andŷ have been considered in the literature to satisfy different application needs. A simple criterion [28] is the Hamming loss c HAM (y,ŷ) = .
In this work, we follow existing cost-sensitive MLC approaches [15] to extend OMLC to the cost-sensitive OMLC (CSOMLC) setting, which further takes the evaluation criterion as an additional input to the learning algorithm. We call the criterion a cost function and overload c : {+1, −1} K × {+1, −1} K → R as its notation. The cost function evaluates the penalty ofŷ against y by c(y,ŷ).We naturally assume that c(·, ·) satisfies c(y, y) = 0 and maxŷ c(y,ŷ) ≤ 1. The objective of a CSOMLC algorithm is to adaptively learn a classifier g t : R d → {+1, −1} K based on not only the data stream but also the input cost function c such that the cumulative cost T t=1 c(y t ,ŷ t ) with respect to the input c, whereŷ t = g t (x t ), can be minimized.
Note that the cost function within the CSOMLC setting above corresponds to the examplebased evaluation criteria for MLC, named because the predictionŷ t of each example is evaluated against the ground truth y t independently. More sophisticated evaluation criteria such as micro-based and macro-based criteria [27,20] can also be found in the literature. The following equations highlight the difference between example-F1 (what our CSOMLC setting can handle), micro-F1 and macro-F1 when calculated on T predictions .
In particular, the three criteria differ by the averaging process. Average example-F1 computes the geometric mean of precision and recall (F1) per example and then computes the arithmetic mean over all examples; micro-F1 computes the geometic mean of precision and recall per label and then computes the arithmetic mean over all labels; macro-F1 computes the geometric mean of precision and recall over the set of all example-label predictions. The more sophisticated ones are known to be more difficult to optimize. Thus, similar to many existing cost-sensitive MLC algorithms for the batch setting [15], we consider only example-based criteria in this work, and leave the investigation of achieving cost-sensitivity for micro-and macro-based criteria to the future. Several OMLC algorithms have been studied in the literature, including online binary relevance [23], Bayesian OMLC framework [34], and the multi-window approach using k nearest neighbors [32]. However, none of them are cost-sensitive. That is, they cannot take the cost function into account to improve learning performance.
Cost-sensitive MLC algorithms have also been studied in the literature. Cost-sensitive RAkEL [19] and progressive RAkEL [31] are two algorithms that generalize a famous batch MLC algorithm called RAkEL [29] to cost-sensitive learning. The former achieves cost-sensitivity for any weighted Hamming loss, and the latter achieves this for any cost function. Probabilistic classifier chain (PCC) [10] and condensed filter tree (CFT) [15] are two other algorithms that generalizes another famous batch MLC algorithm called classifier chain (CC) [24] to cost-sensitive learning. PCC estimates the conditional probability of the label vector via CC, and makes a Bayes-optimal prediction with respect to the cost function and the estimation. PCC in principal achieves cost-sensitivity for any cost function, but the prediction can be time-consuming unless an efficient Bayes inference rule is designed for the cost function (e.g. the F1 loss [11]). CFT embeds the cost information into CC by an O(K 2 )-time step that re-weights the training instances for each classifier. All four algorithms above are designed for the batch cost-sensitive MLC problem, and it is not clear how they can be modified for the CSOMLC problem. CC-family algorithms typically suffer from the problem of ordering the labels properly to achieve decent performance. Some works start solving the ordering problem for the original CC algorithm, such as the easy-to-hard paradigm [18], but whether those works can be well-coupled with CFT or PCC has yet to be studied.
Label space dimension reduction (LSDR) is another family of MLC algorithms. LSDR encodes each label vector as a code vector in the lower-dimensional code space, and learns a predictor from the feature vectors to the corresponding code vectors. The prediction of LSDR consists of the predictor followed by a decoder from the code space to the label space. For example, compressed sensing (CS) [13] uses random projection for encoding, takes a regressor as the predictor, and decodes by sparse vector reconstruction. Instead of random projection, principal label space transformation (PLST) [26] encodes the label vectors {y n } N n=1 to their top principal components for the batch MLC problem. Some other LSDR algorithms, including conditional principal label space transformation (CPLST) [7], featureaware implicit label space encoding (FaIE) [17], canonical-correlation-analysis method [25], and low-rank empirical risk minimization for multi-label learning [33], jointly take the feature and the label vectors into account during encoding [7,17,25,33] to further improve the performance.
The physical intuition behind LSDR algorithms is to capture the key joint information between labels before learning. By encoding to a more concise code space, LSDR algorithms enjoy the advantage of learning the predictor more effectively to improve the MLC performance. Moreover, compared with non-LSDR algorithms like RAkEL and CFT, LSDR algorithms are generally more efficient, which in turn makes them favorable candidates to be extended to online learning.
Motivated by the possible applications of online updating, the realistic needs of costsensitivity, and the potential effectiveness of label space dimension reduction, we take an initiative to study LSDR algorithms for the CSOMLC setting. In particular, we first adapt PLST to the OMLC setting in Section 3, and further generalize it to the CSOMLC setting in Section 4. cost for predicting y asŷ z ∈ R M code vector P ∈ R M ×K encoding matrix from the label space to the code space W ∈ R d×M linear predictor matrix from the input space to the code space U ∈ R K×K (roughly) rank-M matrix within matrix stochastic gradient (MSG) discrete probability distribution for sampling the rows of Q to get P δ (k) ∈ R weight of the k-th label for representing the cost in CS-DPP

Dynamic Principal Projection
In this section, we first propose an online LSDR algorithm, dynamic principal projection (DPP), that optimizes the Hamming loss. DPP is motivated by the connection between PLST, which encodes the label vectors to their top principal components, and the rich literature of online PCA algorithms [1,21,16]. We shall first introduce the detail of PLST. Then, we discuss the potential difficulties along with our solutions to advance PLST to our proposed DPP. To facilitate reading, the common notations that will be used for the coming sections are summarized in Table 1.

Principal Label Space Transformation
Given the dimension M ≤ K of the code space and a batch training dataset D = {(x n , y n )} N n=1 , PLST, as a batch LSDR algorithm, encodes each y n ∈ {+1, −1} K into a code vector z n = P * (y n − o), where o is a fixed reference point for shifting y n , and P * contains the top M eigenvectors of N n=1 (y n − o)(y n − o) . While PLST works with any fixed o, it is worth noting that when o is taken as 1 N N n=1 y n , the code vector z n contains the top M principal components of y n . A multi-target regressor r is then learned on {(x n , z n )} N n=1 , and the prediction of an unseen instance x is made bŷ . By projecting to the top principal components, PLST preserves the maximum amount of information within the observed label vectors. In addition, PLST is backed by the following theoretical guarantee: When making a predictionŷ from x byŷ = round P r(x) + o with any left orthogonal matrix P, the Hamming loss where z ≡ Py and y ≡ y − o with respect to any fixed reference point o.
Theorem 1 bounds the Hamming loss by the prediction and reconstruction errors. Based on the results of singular value decomposition, P * in PLST is the optimal solution for minimizing the total reconstruction error of the observed label vectors with respect to any fixed o, and the particular reference point 1 N N n=1 y n minimizes the reconstruction error over all possible o. Then, by minimizing the prediction error with regressor r, PLST is able to minimize the Hamming loss approximately.

General Online LSDR Framework for DPP
The upper bound in Theorem 1 works for any regressor r and any left orthogonal encoding matrix P. Based on the bound, we propose an online LSDR framework that approximately minimizes the Hamming loss with an online regressor r t and an online encoding matrix P t in each iteration t. Similar to PLST, the proposed framework works with any fixed referenced point o. But for simplicity of illustration, we assume that o = 0 to remove o from the derivations below. The steps of the framework are: Receive y t and incur error (t) (r t , P t ) Update P t and r t In each iteration t of the framework, an online predictionŷ t is made with the updated r t and P t . We take the online error function (t) (r, P) to be r(x t ) − Py t 2 2 + (I − P P)y t 2 2 , which upper bounds the Hamming loss c HAM (y t ,ŷ t ) of the online prediction. Then, by updating r t and P t with online learning algorithms that minimize the cumulative online error T t=1 (t) (r t , P t ), we can approximately minimize the cumulative Hamming loss. The simple framework above transforms the OMLC problem to an online learning problem with an error function composed of two terms. Ideally, the online learning algorithm should update P t and r t to jointly minimize the total error from both terms. Optimizing the two terms jointly has been studied in batch LSDR algorithms like CPLST [7], which is a successor of PLST [26] that also operates with the upper bound in Theorem 1. Nevertheless, it is very challenging to extend CPLST to the online setting efficiently. In particular, a naıve online extension would require computing the hat matrix of the ridge regression part (from x to z) within CPLST in order to obtain P t , and the hat matrix grows quadratically with the number of examples. That is, in an online setting, computing and storing the hat matrix needs at least Ω(T 2 ) complexity up to iteration T , which is practically infeasible.
Thus, we resort to PLST [26], the predecessor of CPLST, to make an initial attempt towards tackling OMLC problems. PLST minimizes the two terms separately in the batch setting, and our proposed extension of PLST similarly contains two online learning algorithms, one for minimizing each term. That is, we further decompose the online learning problem to two sub-problems, one for minimizing the cumulative reconstruction error (by updating P t ), and one for minimizing the cumulative prediction error (by updating r t ). Designing efficient and effective algorithms for the two sub-problems turns out to be non-trivial, and will be discussed in Sections 3.3 and 3.4.

Online Minimization of Reconstruction Error
Next, we discuss the design of our first online learning algorithm to tackle the sub-problem of minimizing the cumulative reconstruction error T t=1 (I−P t P t )y t 2 2 , which corresponds to the second term in (2). The goal is to generate a left-orthogonal matrix P t ∈ R M ×K in each iteration that guarantees to minimize the cumulative reconstruction error theoretically.
Our design is motivated by a simple but promising online PCA algorithm, matrix stochastic gradient (MSG) [1]. MSG does not directly solve the sub-problem of our interest because the problem is non-convex over P t . Instead, MSG substitutes P t P t with a rank-M matrix U t ∈ R K×K and rewrites the cumulative reconstruction error as T t=1 y t (I − U t )y t . By further assuming that y t 2 ≤ 1, MSG loosens the constraint of rank(U t ) = M to tr(U t ) = M , and updates U t with online projected gradient descent upon receiving a new y t as U t+1 = P tr (U t + ηy t y t ) where η is the learning rate and P tr (·) is the projecting operator to a feasible U. The less-constrained U t in MSG carries the theoretical guarantee of minimizing the cumulative reconstruction error (subject to U t ), but decomposing U t to a left-orthogonal P t ∈ R M ×K with theoretical guarantee on P t is not only non-trivial but also time-consuming. Capped MSG [1] is an extension of MSG with the hope of lightening the computational burden of decomposing U t . In particular, Capped MSG introduces an additional (non-convex) constraint of rank(U t ) ≤ M + 1, and indirectly maintains the decomposition of U t as (Q t , σ t ), where the left-orthogonal matrix Q t ∈ R (M +1)×K and the vector of singular values σ t ∈ R M +1 such that U t = Q t diag(σ t )Q t . The decomposed (Q t , σ t ) in Capped MSG enjoys the same theoretical guarantee of minimizing the reconstruction error as the U t in MSG, while the maintenance step of Capped MSG is more efficient than MSG. Nevertheless, because we want P t to be M by K while Q t is (M +1) by K, the generated Q t in Capped MSG cannot be directly used to solve our sub-problem. A naïve idea is to generate P t by truncating the least important row of Q t , but the naïve idea is no longer backed by the theoretical guarantee of Capped MSG.
Aiming to address the above difficulties, we propose an efficient and effective algorithm to stochastically generate P t from (Q t , σ t ) maintained by Capped MSG in each iteration. To elaborate, let Q −i t be Q t with its i-th row removed and σ t [i] be the eigenvalue corresponding to i-th row of Q t . We generate P t by sampling from a discrete probability distribution Γ t , which consists of M + 1 events As the projecting operator P tr (·) ensures 0 ≤ σ t [i] ≤ 1 for each σ t [i], one can easily verify Γ t to be a valid distribution with the additional fact that i σ t [i] = tr(U t ) = M . The following lemma shows that the online encoding matrix generated by our simple stochastic algorithm is truly effective, and the proof can be found in the supplementary materials.
The proof of the lemma can be found in Appendix A.1. Moreover, our sampling algorithm is highly efficient regarding its O(M ) time complexity. Note that there is an earlier work that contains another algorithm of similar spirit [21]. Somehow the algorithm's time complexity is O(K 2 ), which is less efficient than ours.
To sum up, our online learning algorithm that minimizes the cumulative reconstruction error for DPP takes Capped MSG as its building block to maintain U t by Q t and σ t , and then samples the online encoding matrix P t from Γ t derived by Q t in each iteration by our proposed sampling algorithm. Note that to fulfill the assumption of y t 2 ≤ 1 required by Capped MSG, we apply a simple trick to scale each y t ∈ {+1, −1} K with a factor of 1 √ K . The predictions given by our online LSDR framework remain unchanged after the constant scaling due to the use of round(·) operator.

Online Minimization of Prediction Error
Next, we discuss another proposed online learning algorithm to solve the second sub-problem of minimizing the cumulative prediction error T t=1 r t (x t ) − P t y t 2 , which corresponds to the first term in (2). The proposed online learning algorithm is based on the well-known online ridge regression, and incorporates two different carefully designed techniques to remedy the negative effect caused by the variation of P t in each iteration.
The naïve online ridge regression parameterizes r t (x) to be an online linear regressor W t x with W t ∈ R d×M , and update W t by where z i = P i y i is the code vector of y i regarding P i , and λ is the regularization parameter. However, the naïve online ridge regression suffers from the drifting of projection basis caused by varying the online encoding matrix P t as t advances. To elaborate, recall that the online regressor W t aims to predict z t = P t y t from x t , where the code vector z t can essentially be viewed as the set of combination coefficients with reference projection basis formed by P t .
is mixed up with coefficients z i induced from different projection basis P i . As a consequence, expecting W t x t to give accurate prediction of z t for any specific P t is unrealistic. For a very extreme case, if P 1 = P 3 = . . . = P 2τ −1 = P and P 2 = P 4 = . . . = P 2τ = −P, the z i 's in the odd and even iterations are of totally opposite meanings although the projection matrices P and −P are mathematically equivalent in quality. The totally opposite meanings make it impossible for W t to predict z t accurately.
To remedy the problem of basis drifting, we propose two different techniques, principal basis correction (PBC) and principal basis transform (PBT), to improve online regressor W t . Each of them enjoys different advantages.

Principal Basis Correction
The ideal solution to handle basis drifting is to "correct" the reference basis of each z i to be the latest P t used for prediction. More specifically, we want W t to be the ridge regression . Such a correction step ensures that the reference basis for generating the previous z i 's is the same as the basis that will be used for the predicting z t and decodingŷ t from z t . Denote W PBC t as the ridge The part A −1 t B t is independent of the projection matrix P t . Thus, by maintaining another d by K matrix can be easily obtained by H t P t for any P t . The update of H t to H t+1 , on the other hand, requires the calculation of which at a first glance has a time complexity of O(d 3 + Kd 2 ). Fortunately, we can speed up the calculation by applying the Sherman-Morrison formula, which states that Then, the calculation can be rewritten as The third line follows from the fact that H t = A −1 t B t . Thus, the d by K matrix H t can be efficiently updated online by which requires only a time complexity of O(d 2 + Kd).
It is worth noting that H t actually stores the online ridge regression solution from x to y. Based on the definition of H t , we can then theoretically analyze the performance of our online ridge regression solution W PBC t from x to z with respect to the error (t) (·, ·) in our proposed online LSDR framework. Following the convention of online learning, we analyze the expected average regret R T , defined as for any given sequence of {(P t , Γ t )} T t=1 , where each P t is sampled from the distribution Γ t . (W # , P * ) here denotes the offline reference algorithm that is allowed to peek the whole data stream {(x t , y t )} T t=1 . As our algorithm aims to minimize the online error function by a similar decomposition of sub-problems as PLST , we particularly consider (W # , P * ) to be the solution of PLST when treating {(x t , y t )} T t=1 as the input batch data. That is, P * is the minimizer of T t=1 y t (I−P P)y t , which corresponds to the second term of (t) (·, ·), and W # is the minimizer of T t=1 W x t − P * y t 2 2 , which corresponds to the first term of (t) (·, ·) given P * . It can be easily proved that With the expected average regret defined, we can prove its convergence by assuming the convergence of the subspace spanned by P t to the subspace spanned by P * . The assumption generally holds when the M -th and (M + 1)-th eigenvalues of T t=1 (y t − o)(y t − o) are different, as the subspace spanned by P * to reach the minimum reconstruction error is consequently unique. In particular, define the expected subspace difference Theorem 3 With the definitions of H t in (7), 1. For any given T , the expected cumulative regret R is upper-bounded by The third assumption requires the residual errors of online ridge regression without projection to be bounded, which generally holds when there is some linear relationship between x t and y t . The detailed of the proof of the theorem can be found in Appendix A.2. Theorem 3 guarantees the performance of PBC to be competitive with a reasonable offline baseline in the long run given the convergence of subspace spanned by P t . Such a guarantee makes online linear regressor with PBC a solid option for DPP to tackle the sub-problem of minimizing cumulative prediction error. 2 The technicality of requiring H * F to be bounded is because we defined regret (up to the T -th iteration) with respect to the optimal offline solution upon receiving T examples, and hence H * depends on T . Standard regret proof in online learning alternatively defines regret with respect to any fixed H. Our proof could also go through with the alternative definition, which changes H * F to a constant H F (that is trivially bounded).

Principal Basis Transform
While PBC always gives the W PBC t learned on the correct code vectors with respect to the basis formed by P t , the time and space complexity of PBC depends on Ω(Kd) at the cost of maintaining H t ∈ R d×K . The Ω(Kd) dependency can make PBC computationally inefficient when both K and d are large.
To address the issue, we propose another technique, principal basis transform (PBT). Different from PBC, when a new online encoding matrix P t+1 is presented, PBT aims at a direct basis transform of the online linear regressor from P t to P t+1 . To be more specific, PBT assumes the regressor W PBT t to be the low-rank coefficients matrix of some unknown H t ∈ R d×K with reference projection basis formed by P t , which can equivalently be described as y t ) such that the reference projection basis of W PBT t+1 is now induced from P t+1 . PBT achieves the goal by a two-step procedure. The first step is to find the low-rank coefficients matrix W t of H t based on the new reference basis formed by P t+1 . However, as only the low rank coefficients matrix W PBT t rather than H t itself is known, we approximate W t by Solving (11) analytically gives The second step is to update W t with (x t , y t ) to obtain W PBT t+1 by wherez t = W t x t . Equation (13) can be derived with a similar use of the Sherman-Morrison formula as that for (7) by replacing (ỹ t , y t ) with (z t , P t y t ) respectively. One can easily verify that W PBT t+1 obtained by (13) still keeps its reference basis as P t+1 . Comparing to PBC, PBT only has Ω(M 2 (K + d)) dependency, which is particularly useful when M 2 min(K, d). The appealing time complexity makes PBT a highly practical option for DPP to minimize the cumulative prediction error with. The time and space complexity of the two variants of DPP are listed in Table 2.

Generalization to Cost-Sensitive Learning
In this section, we generalize DPP to cost-sensitive DPP (CS-DPP), which meets the requirement of CSOMLC. The key ingredient to the generalization is a carefully designed labelweighting scheme that transforms cost c(y,ŷ) into the corresponding weighted Hamming loss. With the help of the label weighting scheme, we subsequently derive the optimization

Algorithm 1 Cost-Sensitive Dynamic Principal Projection with Principal Basis Transform
Obtain Ct by (15) 5: Update U t−1 to Ut by Capped MSG (with Ctyt) and sample Pt from Γt as defined in Lemma 2 6: objective similar to Theorem 1 for general cost functions, which allows us to derive CS-DPP by reusing the building blocks of DPP.
We start from the detail of our label-weighting scheme based on the label-wise decomposition of c(y,ŷ). To represent the cost with the label weights, we propose a label-weighting scheme based on a label-wise and order-dependent decomposition of c(·, ·), which is motivated by a similar concept in [15]. The label-weighting scheme works as follows. Defininĝ y Recall that y is the ground truth vector andŷ is the prediction vector from the algorithm. The two newly constructed vectors,ŷ pred , can both be viewed as pseudo prediction vectors that are "better" thanŷ, as they are both perfectly correct up to the (k − 1)-th label. The two vectors only differ on the k-th prediction, which is correct forŷ (k) real and incorrect for y (k) pred . The difference allows the term δ (k) in (14) to quantify the price that the algorithm needs to pay if the k-th prediction is wrong. Then, the price δ (k) can be viewed as an indicator of importance for predicting the k-th label correctly. Our label-weighting scheme follows such intuition by simply setting the weight of k-th label as δ (k) . The label-weighting scheme with (14) is not only intuitive, but also enjoys nice theoretical guarantee under a mild condition of c(·, ·), as shown in the following lemma.
real ) ≥ 0 holds for any k, y andŷ, then for any given y andŷ, we have The condition of the lemma, which generally holds for reasonable cost functions, simply says that for any label, a correct prediction should enjoy a lower cost than an incorrect prediction. The proof of the lemma can be found in Appendix A.3. Lemma 4 transforms c(y,ŷ) into the corresponding weighted Hamming loss, and thus enables the optimization over general cost functions. Note that condition implies that correcting a wrongly-predicted label leads to no higher cost, and is considered mild as general cost functions for MLC satisfy the condition.
Next, we propose CS-DPP, which extends DPP based on our proposed label-weighting scheme. Define C as With C, which carries the cost information, we establish a theorem similar to Theorem 1 to upper-bound c(y,ŷ).
Theorem 5 When making a predictionŷ from x byŷ = round P r(x) + o with any left orthogonal matrix P, if c(·, ·) satisfies the condition of Lemma 4, the prediction cost where z C = P(y C ) and y C = Cy − o with respect to any fixed reference point o.
Theorem 5 generalizes Theorem 1 to upper-bound the general cost c(y,ŷ) instead of the original Hamming loss c HAM (y,ŷ). With Theorem 5, extending DPP to CS-DPP is a straightforward task by reusing the online updating algorithms of DPP with y t replaced by C t y t . The full details of CS-DPP using PBT is given in Algorithm 1, and we can easily write down similar steps for CS-DPP using PBC. Note that we simplify W PBT t to W t in Algorithm 1 to make a cleaner presentation.

Experiments
To empirically evaluate the performance, and also to study the effectiveness and necessity of design components of CS-DPP, we conduct three sets of experiments: (1) necessity justification of online LSDR, (2) experiments on basis drifting, and (3) experiments on cost-sensitivity. Furthermore, recall that the label weighting scheme of CS-DPP depends on the label order. We therefore conduct an additional set of experiments to study how different label orders affect the performance of CS-DPP. To assist the readers in understanding the experiments, we list the full names and acronyms of the algorithms to be compared along with their key differences in Table 3. The details of the algorithms will be illustrated as needed.

Experiments Setup
We conduct our experiments on eleven real-world datasets 3 downloaded from Mulan [30]. Statistics of datasets can be found in Table 4. In particular, datasets eurlex-eurovec and delicious are used only in the experiment to justify the necessity of online LSDR, and only 7500 sub-sampled instances are used on these two datasets to reduce the computational burden of the competitors in the experiment. In addition, only 50000 sub-sampled instances are used for nuswide because a competitor in the cost-sensitivity experiment is rather computationally inefficient. Data streams are generated by permuting datasets into different random orders. We perform sub-sampling on eurlex-eurovec, delicious and nuswide after computing the permutation so that each stream contains a diferent set of original instances for the three datasets.  All LSDR algorithms, except for competitors run on delicious and eurlex-eurovec, are coupled with online ridge regression and three different code space dimensions, M = 10%, 25%, and 50% of K, are considered. For DPP we fix λ = 1 and follow [1] to use the timedecreasing learning rate η = 2 √ t M K , and parameters of other algorithms will be elaborated along with their details in the corresponding section. For the two larger datasets delicious and eurlex-eurovec, we implement both DPP and O-BR using gradient descent instead of online ridge regression for calculating W t , where O-BR is the competitor that will be elaborated in Section 5.2. In particular, for PBC of DPP we replace the update of the online ridge regressor (6) with online gradient descent, while for PBT we replace (13), the update after basis transform, with a gradient descent update as well. Note that even with online ridge The performances of different algorithms are compared using the average cumulative cost 1 t t i=1 c(y i ,ŷ i ) at each iteration t. We remark that lower average cumulative cost imply better performance. We report the average results of each experiment after 15 repetitions.

Necessity of Online LSDR
In this experiment, we aim to justify the necessity to address LSDR for OMLC problems. We demonstrate that the ability of LSDR to preserve the key joint correlations between labels can be helpful when facing (1) data with noisy labels or (2) data with a large possible set of labels, which are often encountered in real-world OMLC problems. We compare DPP with online Binary Relevance (O-BR), which is a naïve extension from binary relevance [28] with online ridge regressor. The only difference between DPP and O-BR is whether the algorithm incorporates LSDR.
We first compare DPP and O-BR on data with noisy labels. We generate noisy data stream by randomly flipping each positive label y[i] = 1 to negative with probability p = {0.3, 0.5, 0.7}, which simulates the real-world scenario in which human annotators fail to tag the existed labels. We plot the results of O-BR and DPP with M = 10%, 25% and 50% of K on datasets emotions and enron with respect to Hamming loss and F1 loss in Figure 1, which contains error bars that represent the standard error of the average results. The standard errors are naturally larger when M is larger or when t (number of iterations) is The results from the first two rows of Figure 1 show that DPP with M = 10% of K performs competitively and even better than O-BR as p increases on dataset emotions. The results from the last two rows of Figure 1 show that DPP always performs better on enron. We can also observe from Figure 1 that DPP with smaller M tends to perform better as p increases. The above results clearly demonstrate that DPP better resists the effect of noisy labels with its incorporation of LSDR as the noise level (p) increases. The observation that DPP with smaller M tends to perform better demonstrates that DPP is more robust to noise by preserving the key of the key joint correlations between labels with LSDR. Next, we demonstrate that LSDR is also helpful for handling data with a large label set. We compare O-BR with DPP that is coupled with either PBC or PBT on datasets delicious and eurlex-eurovec. 4 DPP uses M = 10 for delicious and M = 25 for eurlex-eurovec. We summarize the results and average run-time in Table 5. Table 5 indicates that DPP coupled with either PBT or PBC performs competitively with O-BR, while DPP with PBT enjoys significantly cheaper computational cost. The results demonstrate that DPP enjoys more effective and efficient learning for data with a large label set than O-BR, and also justifies the advantage of PBT over PBC in terms of efficiency when K and d are large while M is relatively small, as previously highlighted in Section 3.

Experiments on Basis Drifting
To empirically justify the necessity of handling basis drifting, we compare variants of DPP that (a) incorporates PBC by (6), (b) incorporates PBT by (13), and (c) neglects basis drifting as (5). We plot the results for Hamming loss with M = 10% of K in Figure 2 on six datasets, and report the complete results in Appendix B.2. The results on all datasets in Figure 2 show that DPP with either PBC or PBT significantly improves the performance over its variant that neglects the basis drifting, which clearly demonstrates the necessity to handle the drifting of projection basis.
Further comparison of PBC and PBT based on Figure 2 reveals that PBC in general performs slightly better than PBC, reflecting its advantage of exact projection basis correction. Nevertheless, as discussed in Section 5.2, PBT enjoys a nice computational speedup when K and d are large and M is relatively small, making PBT more suitable to handle data with a large label set.

Experiments on Cost-Sensitivity
To empirically justify the necessity of cost-sensitivity, we compare CS-DPP using PBT with DPP using PBT and other online LSDR algorithms. To the best of our knowledge, no online LSDR algorithm has yet been proposed in the literature. We therefore design two simple online LSDR algorithms, online compressed sensing (O-CS) and online random projection (O-RAND), to compare with CS-DPP. O-CS is a straightforward extension of CS [13] with an online ridge regressor, and we follow [13] to determine the parameter of O-CS. O-RAND encodes using random matrix P R and simply decodes with the corresponding pseudo inverse P † R . We plot the results with respect to all evaluation criteria except for the Hamming loss with M = 10% of K in Figure 3 on three datasets, and report the complete results in Appendix B.3 Note that the results for CS-DPP here are obtained by using the original label order from the dataset.

CS-DPP versus DPP.
The results of Figure 3 clearly indicate that CS-DPP performs significantly better than DPP on all evaluation criteria other than the Hamming loss, while CS-DPP reduces to DPP when 10% Table 8: Results of CS-DPP on enron with 50 random label orders c HAM (·, ·) is used as the cost function. These observations demonstrate that CS-DPP, by optimizing the given cost function instead of Hamming loss, indeed achieves cost-sensitivity and is superior to its cost-insensitive counterpart, DPP.

CS-DPP versus Other Online LSDR Algorithms.
As shown in Figure 3, while DPP generally performs better than O-CS and O-RAND because of the advantage to preserve key label correlations rather than random ones, it can nevertheless be inferior on some datasets with respect to specific cost functions due to its cost-insensitivity. For example, DPP loses to O-RAND on dataset Corel5k with respect to the Normalized rank loss, as shown in the third row of Figure 3. CS-DPP conquers the weakness of DPP with its cost-sensitivity, and significantly outperforms O-CS and O-RAND on all three datasets with respect to all three evaluation criteria, as demonstrated in Figure 3. The superiority of CS-DPP justifies the necessity to take cost-sensitivity into account.

Experiment on Effect of Label Order for CS-DPP
The goal of this experiment is to study how different label orders affect the performance of CS-DPP as our proposed label weighting scheme with (14) is label-order-dependent. To evaluate the impact of label orders, we run CS-DPP with 50 randomly generated label orders and M = 10%, 25% and 50% of K on each dataset. The permutation of each dataset is fixed to the original one given in Mulan [30], which allows the variance of the performance to better indicate the effect of different orders. We summarize the results of all four different cost functions with mean and standard deviation on datasets CAL500, enron and yeast in Table 6, 7 and 8 respectively, and report the complete results in Appendix B.4. Note that the results of Hamming loss are unaffected by the order of labels, and the reported deviation is due to the randomness from P t . From the results of Table 6, 7 and 8, we see that standard deviation is generally in a relatively small scale of 10 −3 , indicating that the performance of CS-DPP is not that sensitive to the order of labels. Closer inspection of Table 7 reveals that the standard deviation of c ACC on yeast with M = 10% of K (which is only 2 in this case) is somewhat larger, but for sufficiently large M the label order does not seem to cause much variation.

Conclusion
We proposed a novel cost-sensitive online LSDR algorithm called cost-sensitive dynamic principal projection (CS-DPP). We established the foundation of CS-DPP with an online LSDR framework derived from PLST, and derived CS-DPP along with its theoretical guarantees on top of MSG. We successfully conquered the challenge of basis drifting using our carefully designed PBC and PBT. CS-DPP further achieves cost-sensitivity with theoretical guarantees based on our carefully designed label-weighting scheme. The empirical results demonstrate that CS-DPP significantly outperforms other OMLC algorithms on all evaluation criteria, which validates the robustness and superiority of CS-DPP. The necessity for CS-DPP to address LSDR, basis drifting and cost-sensitivity was also empirically justified.
For possible future works, an interesting direction is to design an online LSDR algorithm capable of capturing the key joint information between features and labels. As discussed, the concept to capture such joint information has been investigated for batch MLC [7,17,33], but it remains to be challenging for online MLC. Another direction is to apply OMLC algorithms as a fast approximate solver for large-scale batch data, and see how they compete with traditional batch algorithms. Another interesting direction, as mentioned in Section 2, is to design online learning algorithms that achieve cost-sensitivity for the more sophisticated micro-and macro-based criteria.
we have for any y Proof We first formally show that Γ t is a well-defined probability distribution. By the definition of the projection operator of Capped MSG we have 0 ≤ σ t [i] ≤ 1 for each σ t [i] Γ t is therefore a well-defined probability distribution.
Then it suffices to show that E P t ∼Γ t [P t P t ] = U t as To see that E P t ∼Γ t [P t P t ] = U t , first notice that by orthogonality of rows of Q t we have U t = M +1 j=1 σ t (j)e j e j where e j is the j-th row of Q t . We then have

Appendix A.2 Proof of Theorem 3
Theorem 3 With the definitions of H t in (7), H * in (9), R T in (8) and ∆ t in (10), assume that x t ≤ 1, y t ≤ 1 and H t x t − y t 2 2 ≤ .
1. For any given T , the expected cumulative regret R is upper-bounded by Proof We start by separating the definition of R to two terms: one for how P t in MSG converges to P * , and the other for how W PBC for P * . For simplicity, we will denote W PBC t by W t . Then, We can bound R MSG first. Let U t = E P t ∼Γ t [P t P t ] and U * = (P * ) P * , by linearity of expectation, where (17) from the assumption of y t 2 ≤ 1 and the definition of the matrix 2-norm. Next, we bound R ridge . With the definitions of H t in (7) and H * in (9), R ridge can be further decomposed to Bounding R 1 is very similar to bounding R MSG . In particular, where (18) follows from the assumption of H t x t − y t 2 2 ≤ . The term R 2 can be viewed as an online ridge regression process from x to P * y, because it can be easily proved that H t (P * ) is the ridge regression solution after receiving (x 1 , P * y 1 ), (x 2 , P * y 2 ), . . ., (x t−1 , P * y t−1 ). Also, as discussed in Section 3.4, W # = H * (P * ) is the optimal linear regression solution of {(x t , P * y t )} T t=1 . The assumption of as well. Similarly, he assumption of y t 2 ≤ 1 implies that P * y t 2 ≤ 1. Then, a standard ridge regression analysis (see, e.g. [3]) by provng that A t = λI+ t−1 i=1 x i x i grows linearly with t leads to where (19) is because P * 2 F = tr(U * ) = M . Summing R MSG , R 1 and R 2 results in which proves the first part of the theorem. The second part easily follows because the convergence of a sequence implies the convergence of the mean.

Appendix A.3 Proof of Lemma 4
Lemma 4 If c(y, y real ) ≥ 0 holds for any k, y andŷ, then for any given y andŷ we have Proof Recall the definition of y (k) real and y (k) pred to bê y (k) and the definition of δ (k) to be Now define k i , i = 1, . . . , L be the sequence of indices such that y[k i ] =ŷ[k i ] for every k i and k i < k i+1 . If such k i does not exist than (21) holds trivially by c(y, y) = 0. Otherwise, by the condition of c we have where (a) uses the condition of c(·, ·) to remove the absolute value function; (b) is from two possibilities of L: if L = 1 then the equation trivially holds; if L > 1 we use the observation thatŷ where the observation is by realizing y[j] =ŷ[j] for any k i < j < k i+1 ; (c) follows from the observation thatŷ where z C = P(y C ) and y C = Cy − o with respect to any fixed reference point o.
Recall the definition of C in the main context is Next we show and prove the following lemma before we proceed to the complete proof.
With Lemma 6 established, we now prove Theorem 5. (c) where we recall thatȳ C = Cy − o and z C = P(y c ). (a) is from Lemma 24, while (b) and (c) follow from the orthogonal rows of P.
We note that the proof above closely follows the proof of Theorem 1 in [26], while the key difference comes from Lemma 6 to handle the weighted Hamming loss.

Appendix B. Complete Results of Experiments
Here we report the complete results of each experiment.

Appendix B.1 Necessity of Online LSDR
We report the complete results of comparison between O-BR and DPP with M = 10%, 25% and 50% of K from Table 9 to Table 11 with respect to all four evaluation criteria, where the best values (the lowest) are marked in bold.
The results show that DPP outperforms O-BR as the value of p increases with respect to Hamming loss, F1 loss and Accuracy loss, demonstrating the robustness of DPP. On the otter hand, the results related to Normalized rank loss from Table 9 to Table 11 show that, while DPP cannot outperform O-BR regarding this specific criterion, DPP does start to perform competitively as the value of p increases. The observation again demonstrates that DPP indeed suffers less from noisy labels comparing to O-BR due to the incorporation with LSDR.  The complete results of comparison between DPP using (1) PBC, (2) PBT, and (3) nothing regarding Hamming loss can be found in Table 12, Table 13 and