19
A Family of Large Margin Linear Classifiers and Its Application in Dynamic Environments Jianqiang Shen Pearson Knowledge Technologies 299 S. California Ave, Palo Alto, CA94306 [email protected] Thomas G. Dietterich 1148 Kelley Engineering Center Oregon State University, Corvallis, OR97331 [email protected] Abstract Real-time problems prediction problems pose a challenge to machine learning algorithms because learning must be fast, the set of classes may be changing, and the relevance of some features to each class may be changing. To learn robust clas- sifiers in such nonstationary environments, it is essential not to assign too much weight to any single feature. We address this problem by combining regularization mechanisms with online large margin learning algorithms. We prove bounds on their error and show that removing features with small weights has little influence on prediction accuracy, suggest- ing that these methods exhibit feature selection ability. We show that such regularized learning algorithms automatically decrease the influence of older training instances and focus on the more recent ones. This makes them especially at- tractive in dynamic environments. We evaluate our algo- rithms through experimental results on real data sets and through experiments with an online activity recognition sys- tem. The results show that these regularized large-margin methods adapt more rapidly to changing distributions and achieve lower overall error rates than state-of-the-art meth- ods. Keywords: Classification, online learning, feature selec- tion, activity recognition, non-stationary environments. 1 Introduction When applying machine learning to real-world problems such as web page categorization and activity recognition, ef- ficiency and non-stationarity are important issues. Popular web sites, such as blogs and newspapers, continually gener- ate large numbers of novel documents. Learning over such web-scale data is very expensive, even with thousands of ma- chines running in parallel [24]. In addition, topics of inter- est change rapidly – a topic with millions of visits last year might be completely ignored this year. Similar challenges arise when intelligent personal assis- tants seek to track desktop activities (e.g., [18, 17, 26, 30]). Each time the user provides feedback (either implicit or ex- plicit) about a prediction, the assistant needs to update its predictor. This update must be very efficient in order for such an assistant to be usable. User activity patterns change over time, as a result of changes in the mix of projects and dead- lines, which again raises the problem of non-stationarity. In this paper, we explore learning algorithms that are able to efficiently handle large-scale data sets and rapidly adapt to changes in the set of categories, their definitions, and their relative frequencies. Online learning algorithms are algorithms that consume a constant amount of storage and incrementally update the classifier in a constant amount of time for each new train- ing example. In the stationary case, the ultimate accuracy of such algorithms is limited by the total number of train- ing examples. However, in the non-stationary case, only the more recent training examples within each class are rel- evant to recognizing that class. The greater the degree of non-stationarity (i.e., the faster the problem is changing), the smaller the effective number of training examples. As a con- sequence, the risk of overfitting increases, and it is important to prevent overfitting through some form of regularization or feature selection. This is particularly true for text clas- sification problems where there are thousands of candidate features (words). In this paper, we design and evaluate efficient large mar- gin learning algorithms by combining regularization mecha- nisms with online updates. Regularization has been shown to be effective for batch learning algorithms when learn- ing from data with many irrelevant features [33, 15]. The regularization penalty shrinks the classifier weights towards zero and has the effect of controlling the variance of the learned model. Appropriate regularization can generally re- duce over-fitting by trading off a small increase in bias for a large reduction in variance. Compared with feature selec- tion, regularization is a continuous process that shrinks the influence of some features. Because it can be implemented in an online algorithm, unlike standard feature selection meth- ods, it is more suitable for nonstationary data. Unlike other weight-shrinking online learning algorithms [16, 21], our al-

A Family of Large Margin Linear Classifiers and Its …web.engr.oregonstate.edu/~tgd/publications/sadm2010...A Family of Large Margin Linear Classifiers and Its Application in Dynamic

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: A Family of Large Margin Linear Classifiers and Its …web.engr.oregonstate.edu/~tgd/publications/sadm2010...A Family of Large Margin Linear Classifiers and Its Application in Dynamic

A Family of Large Margin Linear Classifiers and ItsApplication in Dynamic Environments

Jianqiang ShenPearson Knowledge Technologies

299 S. California Ave, Palo Alto, [email protected]

Thomas G. Dietterich1148 Kelley Engineering Center

Oregon State University, Corvallis, [email protected]

Abstract

Real-time problems prediction problems pose a challenge tomachine learning algorithms because learning must be fast,the set of classes may be changing, and the relevance of somefeatures to each class may be changing. To learn robust clas-sifiers in such nonstationary environments, it is essentialnotto assign too much weight to any single feature. We addressthis problem by combining regularization mechanisms withonline large margin learning algorithms. We prove boundson their error and show that removing features with smallweights has little influence on prediction accuracy, suggest-ing that these methods exhibit feature selection ability. Weshow that such regularized learning algorithms automaticallydecrease the influence of older training instances and focuson the more recent ones. This makes them especially at-tractive in dynamic environments. We evaluate our algo-rithms through experimental results on real data sets andthrough experiments with an online activity recognition sys-tem. The results show that these regularized large-marginmethods adapt more rapidly to changing distributions andachieve lower overall error rates than state-of-the-art meth-ods.

Keywords: Classification, online learning, feature selec-tion, activity recognition, non-stationary environments.

1 Introduction

When applying machine learning to real-world problemssuch as web page categorization and activity recognition, ef-ficiency and non-stationarity are important issues. Popularweb sites, such as blogs and newspapers, continually gener-ate large numbers of novel documents. Learning over suchweb-scale data is very expensive, even with thousands of ma-chines running in parallel [24]. In addition, topics of inter-est change rapidly – a topic with millions of visits last yearmight be completely ignored this year.

Similar challenges arise when intelligent personal assis-tants seek to track desktop activities (e.g., [18, 17, 26, 30]).Each time the user provides feedback (either implicit or ex-

plicit) about a prediction, the assistant needs to update itspredictor. This update must be very efficient in order for suchan assistant to be usable. User activity patterns change overtime, as a result of changes in the mix of projects and dead-lines, which again raises the problem of non-stationarity.

In this paper, we explore learning algorithms that areable to efficiently handle large-scale data sets and rapidlyadapt to changes in the set of categories, their definitions,and their relative frequencies.

Online learning algorithms are algorithms that consumea constant amount of storage and incrementally update theclassifier in a constant amount of time for each new train-ing example. In the stationary case, the ultimate accuracyof such algorithms is limited by the total number of train-ing examples. However, in the non-stationary case, onlythe more recent training examples within each class are rel-evant to recognizing that class. The greater the degree ofnon-stationarity (i.e., the faster the problem is changing), thesmaller the effective number of training examples. As a con-sequence, the risk of overfitting increases, and it is importantto prevent overfitting through some form of regularizationor feature selection. This is particularly true for text clas-sification problems where there are thousands of candidatefeatures (words).

In this paper, we design and evaluate efficient large mar-gin learning algorithms by combining regularization mecha-nisms with online updates. Regularization has been shownto be effective for batch learning algorithms when learn-ing from data with many irrelevant features [33, 15]. Theregularization penalty shrinks the classifier weights towardszero and has the effect of controlling the variance of thelearned model. Appropriate regularization can generally re-duce over-fitting by trading off a small increase in bias fora large reduction in variance. Compared with feature selec-tion, regularization is a continuous process that shrinks theinfluence of some features. Because it can be implemented inan online algorithm, unlike standard feature selection meth-ods, it is more suitable for nonstationary data. Unlike otherweight-shrinking online learning algorithms [16, 21], oural-

Page 2: A Family of Large Margin Linear Classifiers and Its …web.engr.oregonstate.edu/~tgd/publications/sadm2010...A Family of Large Margin Linear Classifiers and Its Application in Dynamic

gorithms penalizes the model complexity without compro-mising the margin of the training instances. This paper in-vestigates both L1 and L2 regularization for online updates.We analyze the characteristics of the regularization mecha-nism in online learning settings.

The regularization penalty drives the weights of manyfeatures towards zero. The theoretical analysis shows thatignoring features with small weights has little influence onthe prediction accuracy. This feature selection effect canalsoexplain why regularized online learning is usually more ac-curate, as confirmed by our experiments. For real-world on-line learning problems, the distribution generating the datais usually changing as the time passes. A very discrimi-native feature can rapidly become less useful or even use-less. By avoiding over-weighting a feature, our regularizedmethods can shift to the right model more quickly when thedata changes. We also show that the L2 regularized learningmethod has another property appropriate for dynamic envi-ronments – it automatically shrinks the influence of oldertraining instances and pays more attention to more recentones.

We present an application of our algorithms to an intel-ligent activity management system, the TaskTracer system[10, 30]. TaskTracer helps users organize and retrieve in-formation based on user activities. It collects various time-stamped user interactions (such as file open, save, text se-lection, copy/paste, window focus, web navigation, emailread/send and so on) in Microsoft Office (Word, Excel, Pow-erPoint, Outlook), text and pdf files, Internet Explorer, andthe Windows operating system. Each interaction generatesevents which are stored in a database. TaskTracer associateswith each activity the set of resources accessed when per-forming that activity. It employs this data to configure thedesktop to assist users in organizing and re-finding informa-tion. TaskTracer requires the user to explicitly declare thecurrent activity in order to correctly associate resourceswithactivities. This approach fails when the user is interrupted(e.g., by a phone call, instant message). The user typicallychanges documents, web pages, and so on without remem-bering to first inform TaskTracer. To address this problem,we designed and implemented an activity recognition com-ponent by applying a variation of the learning algorithms de-scribed in this paper [29].

This paper is organized as follows. We begin with an in-troduction to online learning and a discussion of our motiva-tion. We then derive our regularized large margin algorithmsand present their theoretical analysis. We show experimentalresults on real data sets to evaluate the performance of ouralgorithms. We present an application in the activity recog-nition component of TaskTracer. We conclude the paper witha discussion of future work.

2 Online Algorithms and Dynamic Environments

An online learning algorithm processes instances in se-quence. In iterationt, the algorithm receives instancext ∈R

n and makes a prediction with its current learned func-tion ft. Then it receivesyt, the correct label ofxt, andcomputes the update conditionC. If C is true, it updatesft to produceft+1 so that a requirement setR is satis-fied. The goal is to minimize the online prediction errorof a single pass over all instances [2]. Online learning al-gorithms can be characterized based on their choices ofCandR [28, 22, 13, 23, 21, 7, 6]. We focus on the binaryclass problem whereyt ∈ +1,−1 andft is a linear clas-sifier: ft = wt · xt. The results can easily be generalizedto multiclass problems. We consider only additive updatealgorithms.

The termyt(wt · xt) is generally referred to as themar-gin. Enforcing a large margin can often improve predictionaccuracy. In this paper, we consider algorithms that performaPassive-Aggressive(PA) update [6] when the classifier failsto correctly classify an instance with a functional margin of1. The PA update modifies the learned function subject totwo constraints: (a) the correct label should have a functionalmargin of 1, and (b) the change to the weights should be min-imal in order to reduce fluctuations. The PA update sets thenew weight vectorwt+1 to be the solution to the followingconstrained optimization problem,

wt+1 = arg minw∈Rn

1

2‖w − wt‖2

2

s.t.

yt(w · xt) ≥ 1.

Most online learning algorithms have no limitation onthe size of the feature weights. Consequently, some weightscan grow to be quite large. This is inappropriate in dy-namic environments, where features that were important atone time may become unimportant at later times. For exam-ple, let’s consider the problem of sentiment prediction wherethe goal is to predicts whether a product review is positive.Consider an imaginary product, theiLearn. Suppose thatwhen it first appears on the market, it gets many positive re-views, because of its novel functionality. Hence, the wordiLearn is a good indicator of positive sentiment and receivesa large weight. But then suppose that a serious problem isdiscovered with theiLearn. Then the wordiLearn imme-diately changes from predicting positive sentiment to pre-dicting negative sentiment. However, sinceiLearn receiveda large positive weight during the early phases, it may takestandard learning algorithms a long time to respond to thechange. In particular, standard methods such as Naive Bayeswould not realize thatiLearn is now predictive of negativesentiment until it had seen as many negative examples as ithad previously seen positive examples. In the mean time,the algorithm will make many prediction errors. One way to

Page 3: A Family of Large Margin Linear Classifiers and Its …web.engr.oregonstate.edu/~tgd/publications/sadm2010...A Family of Large Margin Linear Classifiers and Its Application in Dynamic

avoid this problem is to avoid assigning too much weight toany one feature.

When constructing classifiers over high-dimensionaldata sets, we face problem of over-fitting. A common strat-egy for addressing this issue is to first perform a feature se-lection step. Standard feature selection methods [35] adoptthe batch approach and thus are inappropriate for onlinelearning. Some feature selection methods have been de-signed for the online setting [14, 9], but they have two short-comings. First, they assume an adversarial environment andtake a worse-case approach. Thus the performance is usuallysuboptimal in the normal case. Second, they usually mustsolve a difficult optimization problem that lacks a closed-form solution. In this paper, we address the over-fittingproblem by applying regularization. We show that our al-gorithms have feature selection ability and can improve overnon-regularized algorithms.

We say that an instance isactiveif it triggers an update.Online learning algorithms typically set the initial weightvector to the zero vector and do updates of the formwt+1 =wt + τtytxt whereτt is the learning rate determined by thelearning algorithm. Thus,wt is a linear combination of theactive instances, and the newer active instances play the samerole as the older active instances. We show that for certainkinds of regularized online learning, the updates have theform wt+1 = 1

Ztwt + τtytxt, whereZt ≥ 1. Thus, the

coefficients of those active instances appearing earlier shrinkand have less influence as additional instances are received.Note that this is exactly the opposite of standard stochasticgradient descent algorithms, which decreaseτ (usually as1/t), and hence place more weight on older instances andless weight on more recent ones [27].

3 Regularized Online Learning of Linear Classifiers

We investigate two kinds of regularization. The first employsa penalty in the objective function, and the second one placesexplicit norm requirement in the constraints.

3.1 Online Learning with a Regularized Objective. Letα be a constant controlling the shrinkage rate. We can shrinkthe norm of the weight vector towards zero by adding apenalty in the objective function:

wt+1 = arg minw∈Rn

1

2‖w − wt‖2

2 +α

2‖w‖2

2(3.1)

subject toyt(w · xt) ≥ 1,

We denote the hinge loss [15] at iterationt asℓt. This givesa simple closed-form update:

LEMMA 3.1. Problem 3.1 has the closed-form solutionwt+1 = 1

1+α(wt + τtytxt), whereτt = ℓt+α

‖xt‖22

.

Proof. The Lagrangian of the optimization problem in Prob-

lem 3.1 is

L(w, τ) =1

2‖w − wt‖2

2 +α

2‖w‖2

2 + τ(1 − yt(w · xt)),

(3.2)

whereτ ≥ 0 is the Lagrange multiplier. Differentiating thisLagrangian with respect to the elements ofw and setting thepartial derivatives to zero gives

w =1

1 + αwt +

τ

1 + αytxt.(3.3)

Replacingw in Eq 3.2 with Eq 3.3, the Lagrangian becomes

L(τ ) =1

2

τ

1 + αytxt −

α

1 + αwt

2

2

+

α

2

τ

1 + αytxt +

1

1 + αwt

2

2

+ τ (1 −yt(wt · xt)

1 + α−

τ ‖xt‖2

2

1 + α).

By setting the derivative of this with respect toτ to zero,we obtain

1 − τ

1 + α‖xt‖2

2 −yt(wt · xt)

1 + α= 0

⇒ τ =1 − yt(wt · xt) + α

‖xt‖22

.

We will refer to this algorithm as theobjective-regularized algorithm, because it places the regularizationin the objective function of the optimization problem. Thisalgorithm combines (a) largin margin fitting of the data (theconstraints) with (b) minimizing the change in the weights(first term of the objective) with (c) minimizing the mag-nitude of the weights (second term of the objective). Thefirst term of the objective could also be viewed as beingthe “memory term”, since it seeks to remember the previousweights, while the second term in the object can be viewedas the “forgetting term”, since it serves to shrink the weights.Hence, the algorithm can be viewed as balancing the compe-tition between remembering and forgetting, as controlled byα. Notice that in all cases, our algorithm must fit the mostrecent training example with a functional margin of 1.

A few other online learning algorithms attempt to shrinkweights towards zero [16, 21]. These algorithms trade offfitting the data against simplicity of the learned model. Theirupdates do not directly ensure a large margin. Consequently,their shrinking mechanisms have to sacrifice the fitting to thetraining data. Experimental results show that our algorithmgives much higher accuracy.

Since we are handling nonstationary problems, the besthypothesis at each iteration might be changing. Let us definethe optimal algorithmto be one that performs the minimalnumber of updates and does not update its hypothesis unlessour algorithm updates the hypothesis—that is, it may per-form fewer updates by skipping some of the updates that our

Page 4: A Family of Large Margin Linear Classifiers and Its …web.engr.oregonstate.edu/~tgd/publications/sadm2010...A Family of Large Margin Linear Classifiers and Its Application in Dynamic

algorithm makes. We will show that our regularized algo-rithm is competitive with the optimal algorithm, as long asthe change between two consecutive optimal hypotheses isnot extremely dramatic.

Let u0, ..,uT ∈ Rn be the sequence of weight vectors

chosen by the optimal algorithm. We will specify thatu0 =0, the zero vector. Letℓ∗t denote the loss ofut at iterationt.Assume that the norm is bounded for each instancext, i.e.,‖xt‖2 ≤ R. Let It be theactive setat iterationt for ouralgorithm. An instancexi is in It iff i < t and it triggers anupdate by our algorithm. The following theorem provides anerror bound of our algorithm.

THEOREM 3.1. Assume that there exists an optimal se-quence of vectorsu0, ...,uT ∈ R

n such that‖ut‖2 = D,ℓ∗t = 0 for all t, ‖ut − ut+1‖2 ≤ µ and µ satisfiesg =1−α2

R2 − 2(1 + α)µβ − αD2

2+α> 0. Givenmaxt ‖wt‖2 ≤ β,

the number of prediction mistakes made by the objective-regularized algorithm is bounded bym ≤ D2

g.

Proof. Let ∆t = ‖wt − ut‖22 − ‖wt+1 − ut+1‖2

2. We canprove the bound by lower and upper bounding

t ∆t. Sincew0 is a zero vector and the norm is non-negative,

t ∆t =

‖w0 − u0‖22 − ‖wT − uT ‖2

2 ≤ ‖w0 − u0‖22 = D2.

Obviously,∆t 6= 0 only if t ∈ IT , whereIt is the activeset of our algorithm at iterationt. We will only consider thiscase here. Letw′

t = wt + τtytxt, wt+1 = 11+α

w′t. ∆t can

be rewritten as

(‖wt − ut‖22 − ‖w′

t − ut‖22)

+(‖w′t − ut‖2

2 − ‖w′t − ut+1‖2

2)

+(‖w′t − ut+1‖2

2 − ‖wt+1 − ut+1‖22) = δt + ψt + ǫt.

We will lower boundδt, ψt andǫt.For δt, we have

δt = − 2τtytxt · (wt − ut) − ‖τtytxt‖22

≥2τtℓt − τ2t ‖xt‖2

2 .

Plugging the definition ofτt and consideringℓt ≥ 1 get

δt ≥2ℓ2t + 2ℓtα

‖xt‖22

− ℓ2t + 2ℓtα+ α2

‖xt‖22

≥ 1 − α2

R2.(3.4)

Forψt, we have

ψt = − 2w′t · (ut − ut+1)

≥− 2 ‖w′t‖2 ‖ut − ut+1‖2 ≥ −2(1 + α)µβ.(3.5)

For ǫt, we have

ǫt =(1 − 1

(1 + α)2) ‖w′

t‖22 − 2(1 − 1

1 + α)w′

t · ut+1.

Using the fact that‖u− v‖22 ≥ 0 which is equivalent to

‖u‖22 − 2u · v ≥ −‖v‖2

2, we get

(1 − 1

(1 + α)2) ‖w′

t‖22 − 2(1 − 1

1 + α)w′

t · ut+1

≥−1 − 1

1+α

1 + 11+α

‖ut+1‖22 = − αD2

2 + α.(3.6)

Using Eq 3.4, 3.5 and 3.6, we obtain

T∑

t=1

∆t ≥ m

(

1 − α2

R2− 2(1 + α)µβ − αD2

2 + α

)

.

Applying∑

t ∆t ≤ D2 gives

m

(

1 − α2

R2− 2(1 + α)µβ − αD2

2 + α

)

≤ D2.(3.7)

Sinceg = 1−α2

R2 − 2(1 + α)µβ − αD2

2+α> 0, we get the

result in the theorem.

Note that the error bound increases asµ (the bound onthe size of the optimal weight changes) increases. This con-firms the intuition that a learning problem with dramaticallychanging concepts is difficult, even for a regularized onlinelearning algorithm.

3.2 Online Learning with a Norm Constraint. Theobjective-regularized algorithm keeps shrinking the weightseven when the weights have become quite small. This couldhurt prediction accuracy. We can instead only shrink theweights when they get too large by enforcing a norm con-straint:

wt+1 = arg minw∈Rn

1

2‖w − wt‖2

2(3.8)

subject toyt(w · xt) ≥ 1 and ‖w‖2 ≤ β.

This leads to the following simple closed-form update:

LEMMA 3.2. Problem 3.8 has the closed-form solu-tion wt+1 = 1

Zt(wt + τtytxt), where Zt =

max

1,

‖wt‖22‖xt‖

22−(wt·xt)

2

β2‖xt‖22−1

, τt = ℓt+Zt−1‖xt‖

22

.

A detailed proof is presented in the Appendix. Wewill refer to this algorithm as theL2-norm constrainedalgorithm , because it places an L2 norm constraint on theweight vector. This algorithm performs the normal passive-aggressive update until the norm ofwt exceedsβ. It thenshrinks the weights enough to ensure that theβ constraint issatisfied. Our experiments show that this approach is slightlymore accurate than the objective-regularized algorithm.

It is easy to show that both the objective-regularizedand the L2 norm constrained algorithms are rotationally

Page 5: A Family of Large Margin Linear Classifiers and Its …web.engr.oregonstate.edu/~tgd/publications/sadm2010...A Family of Large Margin Linear Classifiers and Its Application in Dynamic

invariant. LetM = M ∈ Rn×n|MM ′ = M ′M =

I, |M | = 1 be the class of rotational matrices, whereIis the identity matrix. Given a learning algorithmL, wesay it is rotational invariant [25] if for any training setS,rotational matrixM ∈ M, and test examplex, we haveL[S, x] = L[MS,Mx], whereL[S, x] is the predicted labelof x resulting from usingL to train onS.

LEMMA 3.3. The learning algorithm solving Problem 3.1and the algorithm solving Problem 3.8 are rotationally in-variant.

Proof. We focus on the Problem 3.1. The proof can besimilarly applied to Problem 3.8. We show that ifL trainedwith S outputsw, thenL trained withMS outputs theweight vectorMw by induction on the size ofS.

LetL[S] denote the weight vector returned byL trainedwith S.

When |S| = 0, both weight vectors are zero vectors.Thus, the claim is true and the score functions will be thesame since they always return 0.

Assume when|S| = k, L[MS] = ML[S]. Now,consider|S| = k + 1. Let S = S′ ∪ xk+1 andMS =(MS′) ∪ Mxk+1. We knowL[MS′] = ML[S′], sincethe size ofS′ is k. Since we are using the linear product asthe score function, forL trained withMS′ we have the scoreforMxk+1: L[MS′] · (Mxk+1) = (ML[S′]) · (Mxk+1) =L[S′] (MM)xk+1 = L[S′] · xk+1. Thus the prediction ofMxk+1 given byLwithMS′ is the same with the predictionof xk+1 given byL with S′.

If there is no need to update the weights, we obvi-ously haveL[MS] = ML[S]. If we need to update theweights, the update will beL[MS] = 1

1+α(L[MS′] +

τ ′tyt (Mxk+1)), whereτ ′t = ℓ′+α‖Mxk+1‖

2 = ℓ+α‖xk+1‖

2 = τt.

ThusL[MS] = M 11+α

(L[S′] + τtyt (xk+1)) = ML[S].In summary,L[MS] = ML[S] given any data set.

Since we are using the linear product as the score function,we always haveL[S, x] = L[MS,Mx].

Ng [25] shows that rotationally invariant algorithmscan require a large number of training instances to learn asimple model when there are many irrelevant features. Insuch situations, learning algorithms with L1 regularizationusually learn more quickly. Thus, it is worth exploring thefollowing L1 norm constrained learning algorithm:

wt+1 = arg minw∈Rn

1

2‖w − wt‖2

2(3.9)

subject toyt(w · xt) ≥ 1 and ‖w‖1 ≤ β.

This can be transformed into a quadratic programmingproblem and solved with an off-the-shelf quadratic program-ming package. Since the L1 norm constraint is still convex, itis guaranteed to find the global optimum. There is a disconti-nuity in the gradient of L1 with respect towi atwi = 0. This

tends to force a subset of weights to be exactly zero [33], sothat the learned weight vector is sparse.

The following theorem provides an error bound for theonline learning algorithms with L2 or L1 norm constraints:

THEOREM 3.2. Assume that there exists an optimal se-quence of vectorsu0, ...,uT ∈ R

n such that‖ut‖2 =D ≤ β, ℓ∗t = 0 for all t, ‖ut − ut+1‖2 ≤ µ and µ sat-isfies 1

R2 − 2µβ > 0, then the number of errors made bythe algorithm with the L2 norm constraint is bounded bym ≤ R2D2

1−2µβR2 . Similarly, if there exists an optimal vector se-quence such that‖ut‖1 = D ≤ β and‖ut − ut+1‖∞ ≤ µ,then the number of errors made by the algorithm with the L1norm constraint is bounded bym ≤ R2D2

1−2µβR2 .

Proof. We concentrate on the L2 norm case. The proof canbe applied to the L1 case similarly. Let∆t = ‖wt − ut‖2

2 −‖wt+1 − ut+1‖2

2. We can prove the bound by lower andupper bounding

t ∆t. We know∑

t ∆t ≤ D2.We now lower bound∆t. We let∆t = (‖wt − ut‖2

2 −‖wt+1 − ut‖2

2) + (‖wt+1 − ut‖22 − ‖wt+1 − ut+1‖2

2) =γt + χt.

Forχt, we haveχt = −2wt+1 · (ut − ut+1) ≥ −2µβ.It is obvious that‖u‖1 =

i |ui| ≥ |∑i ui|. Thus

‖(wt+1 − wt)xt‖1 ≥ |yt(wt+1 − wt) · xt| ≥ 1.(3.10)

Applying Holder’s inequality, we have

‖(wt+1 − wt)xt‖1 ≤ ‖wt+1 − wt‖2 ‖xt‖2(3.11)

‖wt+1 − wt‖2 ≥ 1

‖xt‖2

≥ 1

R.(3.12)

Let PS(w) denote the projection ofw onto the convexset S. We know for anyu ∈ S, we have‖w − u‖2

2 −‖PS(w) − u‖2

2 ≥ ‖w − PS(w)‖22 [3].

We note thatwt+1 is a projection ofwt onto the convexsetS = w ∈ R

n|loss(w, (yt,xt)) = 0 and ‖w‖2 ≤ βfor the L2 norm constrained algorithm. Sinceut ∈ S,

γt ≥ ‖wt − wt+1‖22 ≥ 1

R2.(3.13)

Thus, we have

i∈IT

(

1

R2− 2µβ

)

≤ D2(3.14)

m ≤ R2D2

1 − 2µβR2.(3.15)

Hence, we obtain the result in the theorem.

Since ‖ut − ut+1‖∞ ≤ ‖ut − ut+1‖2, the errorbounds suggest that the L1 algorithm can tolerate more fluc-tuations of the best hypotheses than the L2 algorithm.

Page 6: A Family of Large Margin Linear Classifiers and Its …web.engr.oregonstate.edu/~tgd/publications/sadm2010...A Family of Large Margin Linear Classifiers and Its Application in Dynamic

3.3 Regularization and Dynamic Environments.Ourregularized algorithms have some characteristics especiallydesirable in dynamic environments.

The algorithms regularized with L2 norm automaticallyshrink the influence of the old observations and put moreweight on the recent ones. LetIt denote the active setat iterationt. Based on Lemma 3.1, the learned decisionfunction of the objective-regularized algorithm at timet canbe rewritten as

ft(x) = sign

(

i∈It

τiyi

(1 + α)|It−Ii|xi · x

)

,(3.16)

where|It − Ii| is the number of active examples (and hence,the number of weight updates) from timei+ 1 up to timet.

Similarly, for the L2-norm constrained algorithm, wecan rewrite the learned decision function at timet based onLemma 3.2 as

ft(x) = sign

(

i∈It

τiyi∏

j∈(It−Ii)Zj

xi · x)

.(3.17)

These forms are interestingly similar to the Forgetron al-gorithm [8], an online kernel-based learning algorithm. TheForgetron performs the standard percetron update but con-trols the number of support vectors by removing the oldestsupport vector when the size of the support vector set is toolarge. Since removing a support vector may significantlychange the hypothesis, it tries to “shrink” the weight of oldsupport vectors. It multiplies the weights byφt ∈ (0, 1] ineach iteration. Our L2-regularized algorithms automaticallyshrink the weights of those support vectors and, hence, “for-get” the old support vectors. This is critically important forhandling non-stationary online learning problems.

Note also that these forms only involve inner productsbetween training examplesxi and the new input examplex.This suggests that the method can be extended to non-lineardecision boundaries by applying the kernel trick to replacethe inner product with a functionK(·, ·) that satisfies theMercer conditions.

Theorem 3.2 also explains why it is important to shrinkthe norm of the weight vector towards zero and not toassign too much weight to any single feature in a dynamicenvironment. In order to be competitive with the optimalsequence of vectors, the norm of the learned vector has tosatisfy 1

R2 − 2µβ > 0, or β < 12µR2 . When the change

between two consecutive optimal hypotheses becomes moredramatic (i.e.,µ becomes larger), the valid value ofβbecomes even smaller. In such cases, we need to keepthe norm of the weight vector small so that the learnedhypothesis can adapt to the new environment quickly.

In Theorem 3.1, since we usually setα quite small, wecan approximateg with 1

R2 − 2µβ by ignoringα. This ex-pression then matches the requirement in Theorem 3.2. Thus

by analogy, when the optimal hypotheses change dramati-cally (i.e., whenµ is large), we need to shrink the norm ofour learned model more aggressively (keepβ small) for thenorm-penalized algorithms.

We cannot setα extremely large or setβ extremelysmall, since we must ensure that the correct label can receivea positive score by a given margin. Thus the norm of theweight vector cannot be too small. But when possible, weshould keep the norm of the learned weight vector smallin order to improve the prediction precision in dynamicenvironments. To see this, note that the error boundR2D2

1−2µβR2

in Theorem 3.2 is directly proportional toβ, the norm of theweight vector. Ensuring a smallerβ will lead to a smallerguaranteed error bound.

3.4 The Feature Selection Effect of Regularized OnlineLearning. Regularized online learning methods force manyfeature weights to be small. We now show that we canremove these features with small weights without hurtingthe accuracy too much. Assume that features are sorted inascending order according to the absolute values of theirweights. Suppose we remove the firstk features so that∑k

i=1 w2i < σ and

∑k+1i=1 w

2i ≥ σ. As long asσ is small, the

number of errors will still be close to the original regularizedmethod. For the objective-regularized algorithm, we havethe following error bound:

THEOREM 3.3. Assume that there exists an optimal se-quence of weight vectorsu0, ...,uT ∈ R

n such that‖ut‖2 =D, ℓ∗t = 0 for all t, ‖ut − ut+1‖2 ≤ µ and µ satisfies

h = 1−α2

R2 − 2(1 + α)µβ − αD2

2+α− 2

√σD > 0. Given

maxt ‖wt‖2 ≤ β, then the number of prediction mistakesmade by the objective-regularized algorithm which removessmall weights is bounded bym ≤ D2

h.

Proof. Let ∆t = ‖wt − ut‖22 − ‖wt+1 − ut+1‖2

2. We canprove the bound by lower and upper bounding

t ∆t. Asthe above, we know

t ∆t ≤ D2.Let w′

t = wt + τtytxt, w′′t = 1

1+αw

′t. We define vector

vt ∈ Rn as

vti =

w′′t i if

∑ij=1 w

′′t2j < σ

0 otherwise.(3.18)

Thenwt+1 = w′′t − vt. ∆t can be rewritten as

(‖wt − ut‖22 − ‖w′

t − ut‖22)

+ (‖w′t − ut‖2

2 − ‖w′t − ut+1‖2

2)

+ (‖w′t − ut+1‖2

2 − ‖w′′t − ut+1‖2

2)

+ (‖w′′t − ut+1‖2

2 − ‖wt+1 − ut+1‖22) = δt + ψt + ǫt + ρt.

Page 7: A Family of Large Margin Linear Classifiers and Its …web.engr.oregonstate.edu/~tgd/publications/sadm2010...A Family of Large Margin Linear Classifiers and Its Application in Dynamic

We have already proved the lower bounds forδt, ψt andǫt above. Forρt, we have

ρt =2vt · w′′t − 2vt · ut+1 − ‖vt‖2

2 .

It is obvious thatvt ·w′′t = ‖vt‖2

2, thus we have

ρt = ‖vt‖22 − 2vt · ut+1 ≥ −2vt · ut+1.(3.19)

Applying the Cauchy-Schwarz inequality, we get

ρt ≥− 2 ‖vt‖2 ‖ut+1‖2 ≥ −2√σD.(3.20)

Using Eqs. 3.4, 3.6 and 3.20, we obtain

T∑

t=0

∆t ≥m(

1 − α2

R2− 2(1 + α)µβ − αD2

2 + α− 2

√σD

)

.

Since∑

t ∆t ≤ D2, we have

m

(

1 − α2

R2− 2(1 + α)µβ − αD2

2 + α− 2

√σD

)

≤ D2.

Sinceh = 1−α2

R2 − 2(1 + α)µβ − αD2

2+α− 2

√σD > 0,

we obtain the result in the theorem.

Similarly, for the algorithms with norm constraints, weobtain the following error bound:

THEOREM 3.4. Assume that there exists an optimal se-quence of weight vectorsu0, ...,uT ∈ R

n such that‖ut‖2 =D ≤ β, ℓ∗t = 0 for all t, ‖ut − ut+1‖2 ≤ µ andµ satisfiesq = 1

R2 −2µβ−2√σD > 0, then the number of errors made

by the algorithm with the L2 norm constraint is bounded bym ≤ D2

q. Similarly, if there exists an optimal weight vector

sequence such that‖ut‖1 = D and‖ut − ut+1‖∞ ≤ µ, thenumber of errors made by the algorithm with the L1 normconstraint is bounded bym ≤ D2

q.

Proof. Let ∆t = ‖wt − ut‖22 − ‖wt+1 − ut+1‖2

2. We canprove the bound by lower and upper bounding

t ∆t. Asthe above, we know

t ∆t ≤ D2.Obviously,∆t 6= 0 only if t ∈ IT . We will only con-

sider this case here. Letw′t be the solution of Problem 3.8.

We define the vectorvt ∈ Rn as

vti =

w′ti if

∑ij=1 w

′t2j < σ

0 otherwise.(3.21)

Thenwt+1 = w′t − vt. ∆t can be rewritten as

(‖wt − ut‖22 − ‖w′

t − ut‖22)(3.22)

+ (‖w′t − ut‖2

2 − ‖w′t − ut+1‖2

2)(3.23)

+ (‖w′t − ut+1‖2

2 − ‖wt+1 − ut+1‖22).(3.24)

0

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0 1 2 3 4

Probability

Phase

P1

P2

N1

N2

Figure 2: Non-stationary class probabilities employed in theexperiments.

We have previously shown thatχt +γt ≥ 1R2 −2µβ and

that‖w′t − ut+1‖2

2 − ‖wt+1 − ut+1‖22 ≥ −2

√σD. Thus,

∆t ≥1

R2− 2µβ − 2

√σD.(3.25)

Since we know 1R2 − 2µβ − 2

√σD > 0, we obtain the

result in the theorem.

This theorem shows that removing those small-weightfeatures slightly increases the error bounds by subtracting2√σ ‖u‖2 from the denominator. Given a smallσ, ignoring

the features with small weights has little influence on theprediction accuracy. Our experimental results show that theaccuracy is not hurt even when we remove more than halfof the features. This feature selection effect can also explainthe superior performance of regularized online learning: ouralgorithms drive many feature weights towards zero. Thealgorithms tend to learn a model with a sparse parametervector when the feature space is large.

4 Experimental Results

We evaluate our algorithms with three data sets.

4.1 Data sets.We tested our algorithms on one imagedata set, USPS, and two text data sets, 20NewsGroups andSRAA1. For all text documents, we removed the headerand converted the remainder into a 0/1 vector of indicatorvariables for each word (without stemming or a stoplist).To make the experiments more realistic and dynamic, wedefined a non-stationary process for generating the datasequence. In each data set, we chose four classes (P1, P2,N1, N2). We defined the union of P1 and P2 to be thepositive class and the union of N1 and N2 to be the negative

1Available at http://www.cs.umass.edu/˜mccallum/data/sraa.tar.gz

Page 8: A Family of Large Margin Linear Classifiers and Its …web.engr.oregonstate.edu/~tgd/publications/sadm2010...A Family of Large Margin Linear Classifiers and Its Application in Dynamic

class. Then we defined four phases for the data sequence (seeFigure 2). In Phase 1, the probability of class P1 decreasesfrom 0.7 to 0.5 and the probability of N1 increases from 0.3to 0.5. In Phase 2, the probability of P1 decreases from 0.5to 0.3, P2 increases from 0 to 0.2, and N1 is fixed at 0.5.In Phase 3, P2 is fixed at 0.5, N1 decreases from 0.2 to 0,and N2 increases from 0.3 to 0.5. In Phase 4, P2 decreasesfrom 0.5 to 0.3 and N2 increases from 0.5 to 0.7. Classes notmentioned have probability 0.

For the USPS set, we sampled 500 instances (withoutreplacement) in each phase and defined P1 to be the digit“3”, P2 to be “7”, N1 to be “8”, and N2 to be “9”. Forthe 20NewsGroups and SRAA data sets, we sampled 800instances (without replacement) in each phase. For 20News-Groups, P1 is “Baseball”, P2 is “Hockey”, N1 is “Auto”, andN2 is “Motorcycle”. For SRAA, P1 is “RealAutos”, P2 is“RealAviation”, N1 is “SimulatedAuto”, and N2 is “Simu-latedAviation”. There are 256 features in the USPS data,8354 features in the 20NewsGroups data, and 9610 featuresin the SRAA data.

4.2 Approach. We applied our algorithms to the gener-ated data sequence as follows. We used the first half of thedata to select the regularization parameter and then trainedthe model on the first half. We then measured online perfor-mance using the second half of the data. Since the secondhalf corresponds to phases 3 and 4, this approach means thatthe initial model (learned in phases 1 and 2) performs verybadly initially, because of the discontinuous shift in classprobabilities at the start of phase 3. The results are simi-lar if the regularization parameters are tuned on the secondhalf of the data. All results are averaged over 40 trials.

4.3 Comparison with Other Online Learning Methods.We compare our algorithms with the Bayesian Perceptronalgorithm [32, 4] (which approximates the posterior witha Gaussian), the linear NORMA algorithm [21] (whichis another regularized online learning algorithm), and thepassive-aggressive algorithm [6] (which is a state-of-the-art online learning algorithm). The results are shown inFigure 1.

Of the five methods evaluated, our objective-regularizedand L2-norm constrained algorithms are clearly superior onthe USPS and 20NewsGroups data sets. On SRAA, ouralgorithms are able to adapt very rapidly to the nonstationarychange in class probabilities at the start of Phase 3. However,by the end of Phase 4, the Bayesian Perceptron algorithm hascaught up and surpassed our methods.

We consider each of the methods in more detail. Theworst method appears to be the NORMA algorithm. Al-though in theory, NORMA can quickly adjust its hypothe-sis, in our experiments, it adjusts more slowly than all ofthe other algorithms. NORMA is consistently the worst per-

former, although PA is tied with it on SRAA during the earlypart of Phase 3.

The Passive-Aggressive algorithm is the next worse per-former. On USPS and 20NewsGroups, it starts out adaptingmore rapidly than NORMA and the Bayesian Perceptron, butthen its performance fails to improve as rapidly as the othermethods.

The Bayesian Perceptron algorithm initially adaptsmore slowly to the non-stationary change at the start of Phase3 than our algorithms. However, by the end of Phase 4, its ac-curacy approaches that of our algorithms, and in the case ofSRAA, it eventually becomes more accurate than our meth-ods. This may show that our algorithms are more stronglydesigned for non-stationary distributions and suffer some-what when the distribution is fairly stable for a sufficientlylong time. The Bayesian Perceptron algorithm requires moreCPU time and memory, partly because it must maintain a co-variance matrix. When the feature space is extremely large,the Bayesian Perceptron algorithm will become infeasible.

The experiments show that both the L1-norm con-strained algorithm and the L2-norm constrained algorithmgive similar performance. A possible reason for this is thatthe number of irrelevant features is within an order of magni-tude of the number of informative features in these problems.As we will show below, more than half of the features are in-formative in the USPS problem. For the text problems, thereare several times more meaningless features than informa-tive features, but the number of informative features is stillquite large. Previous work suggests that L1 regularizationworks best when a small number of features play moderate-sized effects in classification, while L2 regularization isquitecompetitive when a large number of features play small ef-fects in classification [33]. One future direction would be toconsider the elastic net approach, which employs a mix ofL1 and L2 regularization [36].

One advantage of the L2-constrained method is that itis more efficient than the L1-constrained method. However,recent work has shown that L1-constrained methods can bemade very fast [36, 11]. In our implementation, we used thecurrent weight vector as the initial value when solving thequadratic programming problem to compute the update. Thismakes the update quite efficient. For example, it took lessthan 10 minutes to process all 3200 20NewsGroups instanceson a Linux machine (AMD64 2.6Ghz CPU, 2G memory). Asa comparison, the objective-regularizedalgorithm took about16 seconds to process all 3200 20NewsGroups instances.

Feature Selection Power. Next we investigate thefeature selection power of our algorithms and compare thisto two other feature selection methods. For our methods,we did the following. We chose a set of possible values forσ and ran each algorithm with each value. In each run ateach time step, we sorted the weights by their magnitudesand removed features until the sum of the absolute values of

Page 9: A Family of Large Margin Linear Classifiers and Its …web.engr.oregonstate.edu/~tgd/publications/sadm2010...A Family of Large Margin Linear Classifiers and Its Application in Dynamic

the weights exceededσ. We computed the average numberof non-zero weights per iteration and the overall error rateover the testing sequence. Features were “removed” onlyfor purposes of predicting the label on the new example.The algorithm continued using the entire weight vector toperform its weight updates.

The other two feature selection methods that we ex-plored were information gain [35] and a game-theoreticmethod. When updating the model, we first perform fea-ture selection and then carry out the model update. Informa-tion gain is a pair-wise feature selection method that is veryeffective in aggressive term removal without losing classifi-cation accuracy in stationary environments [35]. It simplycomputes the mutual information between each feature andthe class label:I(xj ; y). It then chooses thek features withhighest mutual information.

We also devised a game-theoretic feature selection al-gorithm that tries to maximize accuracy in the worst case.Online learning faces a dynamic, sometimes even adversar-ial environment [14, 9]. We treat feature selection as a two-person game [12]. Let the learner be the row player and theenvironment be the column player. The game can be thoughtas this: given an observationx, the row player chooses a fea-turexi and probabilistically determinesy[i], the label ofxbased only on featurexi. Simultaneously, the column playerchooses a featurexj and probabilistically determines the la-bel y[j]. If they predict the same label, then the row playergets reward 1, otherwise 0. We want to design a reward ma-trix M so that each elementM(i, j) is proportional to thelikelihood thaty[i] = y[j] when the row player selects fea-turexi and the column player selects featurexj . There couldbe many choices. We chose the mutual information betweenxi andxj : M [i, j] := I(xi;xj). Letu be the learner’s selec-tion strategy andv be the environment’s strategy, our goal isthen to find a strategy that can maximize the reward in theworst case:

maxu

minv

(uMv)(4.26)

subject to∀i ui ∈ 0, 1, ∀j vj ∈ 0, 1,∑

i

ui =∑

j

vj = k,

wherek is the number of selected features. We then selectthose features withui = 1. In practice, we can relaxthe integer requirement and replace the constraint∀i ui ∈0, 1, ∀j vj ∈ 0, 1 with constraint∀i 0 ≤ ui ≤1, ∀j 0 ≤ vj ≤ 1. The problem can be converted intoa linear programming problem and solved efficiently. Wethen select thek features with the largestui.

The feature selection results are plotted in Figure 3. Inmost cases, the regularized methods significantly outperformother feature selection methods, especially for the USPSproblem in which most features are informative. Informa-

tion gain does not realize that the data is changing and con-tinues to select features aggressively based on overall mutualinformation. Its performance is extremely bad when we se-lect only a small number of features. Information gain showsimprovement only for the 20NewsGroups problem, which isrelatively easy to predict.

On USPS, the game-theoretic method selects betterfeature sets than information gain. However, the game-theoretic method is too inefficient to run on 20NewsGroupsor SRAA because of the large number of features in thesedomains.

The L1-norm constrained method does not perform aswell as the L2-norm method. This is probably because theL1-norm method is more likely to put more weight on asmaller number of informative features. Once these featuresare removed, its performance is severely damaged. Althoughit shows slightly better performance when we allow manyfeatures, it becomes unstable and its accuracy is much worsethan the L2 constrained method when the number of selectedfeatures is small. The accuracy of the L2-constrained methodis not hurt even when we remove most of the features. Thissuggests that this method has the ability to learn a sparsemodel that still performs well.

4.4 Adapting to a Changing Environment. For onlinelearning, the learned model is determined by theactive set.The regularized methods naturally reduce the influence ofthe old active instances and pay more attention to the morerecent ones. In Figure 4, we compare the final learnedmodels for the USPS problem. We plot the learned modelsas follows: each feature corresponds to its position in theimage, and the gray scale is proportional to its absoluteweight. To compute the information gain figure, we applythe information gain criterion to the entire data sequenceand compute the information gain of each feature. Forthe Passive-Aggressive (PA) algorithm, we plot the absoluteweights of the features at the end of Phase 4. At the end ofPhase 4, each algorithm should be just predicting whethera digit is “7” or “9”. The images suggest that this is whatthe regularized algorithms (and to a lesser extent, PA) aredoing. The information gain method does not appear tobe focused on this task. We can also see that the L1-constrained method has more aggressively put larger weightson a smaller number of features. The PA algorithm still putslarge weights on some features that can discriminate “3” and“8” (from Phases 1 and 2).

5 Application to Activity Recognition

We applied a variation of our regularized online learningalgorithms to do activity recognition in an intelligent activitymanagement system, the TaskTracer system [10, 30, 29].

Page 10: A Family of Large Margin Linear Classifiers and Its …web.engr.oregonstate.edu/~tgd/publications/sadm2010...A Family of Large Margin Linear Classifiers and Its Application in Dynamic

Figure 5: The screenshot of Task Selector, an application thatis located at the right bottom of the desktop.

5.1 The TaskTracer System and Its Activity Recogni-tion Problem The TaskTracer system is an intelligent activ-ity management system that helps knowledge workers man-age their work based on two assumptions: (a) the user’s workcan be organized as a set of ongoing activities such as “WriteTaskTracer Paper” or “Take CS534 Class”, (b) each activityis associated with a set ofresources. “Resource” is an um-brella term for documents, folders, email messages, emailcontacts, web pages and so on. TaskTracer collects eventsgenerated by the user’s computer-visible behavior, includ-ing events from MS Office, Internet Explorer, Windows Ex-plorer, and the Windows XP operating system. The user candeclare a “current activity” (via a “Task Selector” user inter-face, see Figure 5), and TaskTracer records all resources asthey are accessed and associates them with the current de-clared activity. TaskTracer then configures the desktop invarious ways to support the user. For example, it supplies anapplication called the Task Explorer, which presents a uni-fied view of all of the resources associated with the currentactivity and makes it easy to open those resources in the ap-propriate application. It also predicts which folder the useris most likely to access and modifies the Open/Save dialogbox to use that folder as the default folder. If desired, it canrestore the desktop to the state it was in when the user lastworked on an activity, and so on.

To get the right resource-activity associations, the usermust remember to indicate the current declared activity eachtime the activity changes. If the user forgets to do this,then resources become associated with incorrect activities,and TaskTracer becomes less useful. For this reason, wesought to supplement the user’s manual activity declarationwith an activity predictor that attempts to predict the currentactivity of the user. If the predictor is sufficiently accurate,its predictions could be applied to associate resources withactivities, to propose correct folders for files and email, andto remind the user to update the current declared activity.

We have previously developed two machine learningmethods for detecting activity switches and predicting thecurrent activity of the user [31, 30]. A significant drawbackof both of these learning methods is that they employed abatch SVM algorithm [19, 5]. This must store all of the train-ing examples and reprocess all of them when retraining is re-quired. SVM training time is roughly quadratic in the num-

ber of examples, so the longer TaskTracer is used, the slowerthe training becomes. Furthermore, activity prediction isamulti-class prediction problem over a potentially large num-ber of classes. For example, our busiest user worked on299 different activities during a four-month period. To per-form multi-class learning with SVMs, we employed the one-versus-rest approach. If there areK classes, then this re-quires learningK classifiers. If there areN examples perclass, then the total running time is roughlyO(N2K3). Thisis not practical in an interactive, desktop setting.

Another drawback with the previous learning methodsis that they are slow to respond to the user’s feedback. Inmany cases, when the user provides feedback, the algorithmonly takes a small step in the right direction, so the user mustrepeatedly provide feedback until enough steps have beentaken to fix the error. This behavior has been reported to beextremely annoying.

Our regularized online learning methods can address theabove problems. Thus we redesigned the activity predictorto apply our new methods.

5.2 System DesignAs indicated above, TaskTracer mon-itors various desktop events (Open, Close, Save, SaveAs,Change Window Focus and so on). Everys seconds (defaults=60) or when the user declares an activity switch, it com-putes an information vectorXt describing the time intervalt since the last information vector was computed. This in-formation vector is then mapped into feature vectors by twofunctions: FA : (Xt, yj) → Rk andFS : (Xt) → Rm.The first functionFA computesactivity-specificfeatures fora specified activityyj ; the second functionFS computesswitch-specific features. The activity-specific features in-clude

• Strength of association of the active resource with ac-tivity yj : if the user has explicitly declared that the ac-tive resource belongs toyj (e.g., by drag-and-drop inTaskExplorer), the current activity is likely to beyj. Ifthe active resource was implicitly associated withyj forsome duration (which happens whenyj is the declaredactivity and then the resource is visited), this is a weakerindication that the current activity isyj.

• Percentage of open resources associated with activityyj: if most open resources are associated withyj , it islikely thatyj is the current activity.

• Importance of window title wordx to activityyj. Giventhe bag of wordsΩ from the window title, we computea variant of TF-IDF [6] for each wordx and activityyj:

TF(x,Ω) · log|S|

DF(x,S). Here,S is the set of all feature

vectors not labeled asyj , TF(x,Ω) is the number oftimesx appears inΩ and DF(x, S) is the number offeature vectors containingx that are not labeledyj .

Page 11: A Family of Large Margin Linear Classifiers and Its …web.engr.oregonstate.edu/~tgd/publications/sadm2010...A Family of Large Margin Linear Classifiers and Its Application in Dynamic

These activity-specific features are intended to predictwhetheryj is the current activity. The switch-specific fea-tures predict the likelihood of a switch. They include

• Number of resources closed in the lasts seconds: if theuser is switching activities, many open resources willoften be closed.

• Percentage of open resources that have been accessed inthe lasts seconds: if the user is still actively accessingopen resources, it is unlikely there is an activity switch.

• The time since the user’s last explicit activity switch:immediately after an explicit switch, it is unlikely theuser will switch again. But as time passes, the likeli-hood of an undeclared switch increases.

To detect an activity switch, we adopt a sliding windowapproach: at timet, we use two information vectors (Xt−1

andXt) to score every pair of activities for time intervalst − 1 and t. Given an activity pair〈yt−1, yt〉, the scoringfunctiong is defined as

g(〈yt−1, yt〉) = Λ1 · FA(Xt−1, yt−1) + Λ1 · FA(Xt, yt)

− I[yt−1 6= yt] (Λ2 · FS(Xt−1) + Λ3 ·FS(Xt)) ,

whereΛ = 〈Λ1,Λ2,Λ3〉 ∈ Rn is a set of weights to be

learned by the system,I[p] = 1 if p is true and0 otherwise,and the dot (·) means inner product. The first two terms ofgmeasure the likelihood thatyt−1 andyt are the activities attime t − 1 andt (respectively). The third term measures thelikelihood that there is no activity switch from timet−1 to t.Thus, the third component ofg serves as a “switch penalty”whenyt−1 6= yt.

We search for the〈y1, y2〉 that maximizes the scorefunction g. If y2 is different from the current declaredactivity and the score is larger than a specified threshold, thena switch prediction is made.

5.3 Efficient Learning Algorithm. We employ a soft-margin variant of the L2-regularized objective algorithm.Allof the algorithms previously discussed in this paper are “hardmargin” algorithms that ensure that each new example iscorrectly classified with a functional margin of 1. This isappropriate for non-stationary learning problems, but it maynot be a good approach when there are likely to be errorsin the training data. Specifically, in the TaskTracer setting,the user can easily mislabel an activity switch. Hence, ouralgorithm needs to be robust to such label errors.

To achieve this, we follow the standard soft-marginapproach by introducing a slack variableξ in the constraintand penalizing it in the objective function:

Λt+1 = arg minΛ∈Rn

1

2‖Λ − Λt‖2

2 + Cξ2 +α

2‖Λ‖2

2

subject tog(〈y1, y2〉) − g(〈y1, y2〉) ≥ 1 − ξ.(5.27)

The second term in the objective function,Cξ2, servesto encourageξ to be small. Ideally,ξ = 0, so that thisenforces the condition that the functional margin (betweencorrect and incorrect scores) should be 1. The constantparameterC controls the tradeoff between taking small steps(the first term) and fitting the data (drivingξ to zero).

Like our other algorithms, this has a closed-form so-lution, so it can be computed in time linear in the num-ber of features and the number of classes. We now de-rive the closed-form update rule for this modified versionof our algorithms. First, let us expand theg terms. DefineZt =

Z1t ,Z

2t ,Z

3t

where

Z1t =FA(Xt−1, y1) + FA(Xt, y2)

− FA(Xt−1, y1) − FA(Xt, y2)

Z2t =(I[y1 6= y2] − I[y1 6= y2])FS(Xt−1)

Z3t =(I[y1 6= y2] − I[y1 6= y2])FS(Xt).

Plugging this into the above optimization problem allows usto rewrite the inequality constraint as the following simpleform:

Λ · Zt ≥ 1 − ξ.

We can then derive the following result:

LEMMA 5.1. The optimization problem (5.27) has theclosed-form solution

(5.28) Λt+1 :=1

1 + α(Λt + τtZt),

where

(5.29) τt =1 − Λt · Zt + α

‖Zt‖22 + 1+α

2C

.

A detailed proof is presented in the Appendix. Theupdate rule (5.28) can be viewed as shrinking the cur-rent weight vectorΛT and then adding in the incorrectly-classified training example with a step size ofτt/(1 + α).The step size is determined (in the numerator of (5.29)) bythe size of the error(1 − Λt · Zt) and (in the denominator)by the squared length of the feature vector and a correctionterm involvingα andC.

The time to compute this update is linear in the numberof features. Furthermore, the cost does not increase with thenumber of classes, because the update involves comparingonly the predicted and correct classes.

It is worth asking how much accuracy is lost in orderto obtain such an efficient online algorithm compared to abatch algorithm (or, more generally, to the best possible al-gorithm). By extending existing results from computationallearning theory, we can provide a partial answer to this ques-tion. Let us assume that the length of each vectorZt is nomore than some fixed valueR:

‖Zt‖2 ≤ R.

Page 12: A Family of Large Margin Linear Classifiers and Its …web.engr.oregonstate.edu/~tgd/publications/sadm2010...A Family of Large Margin Linear Classifiers and Its Application in Dynamic

0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.80.65

0.7

0.75

0.8

0.85

0.9

Recall

Pre

cisi

on

Objective−regularized methodBatch approach with silence periodBatch approach without silence period

Figure 6: Precision of different learning methods as a func-tion of the recall, created by varying the alarm threshold.

This is easily satisfied if every feature has a fixed range ofvalues. Suppose there is some other algorithm that computesa better weight vectoru ∈ R

n. Let ℓ∗t = max0, 1 − u ·Zt denote the hinge loss ofu at iterationt. With thesedefinitions, we can obtain a result that compares the accuracyof the online algorithm afterT examples to the total hingeloss of the weight vectoru afterT examples:

THEOREM 5.1. Assume that there exists a vectoru ∈ Rn

which satisfiesh = 1−α2

R2+ 1+α

2C

− α2+α

‖u‖22 > 0. Givenα < 1,

the number of prediction mistakes made by our algorithm isbounded bym ≤ 1

h‖u‖2

2 + 2Ch(1+α)

∑Tt=0(ℓ

∗t )

2.

A detailed proof is presented in the Appendix. Thistheorem tells us that the number of mistakes made by ouronline algorithm is bounded by the sum of (a) the squaredhinge loss of the ideal weight vectoru multiplied by aconstant term and (b) the squared Euclidean norm ofu

divided byh. This bound is not particularly tight, but it doessuggest that as long asu is not too large, the online algorithmwill only make a constant factor more errors than the ideal(batch) weight vector.

Theoretical analysis can provide one more insight intothe relationship betweenC and how often the user makesmistaken feedbacks. Since usuallyR2 ≫ 1+α

2C, we can treat

h as approximately independent ofC. When the user makesmany feedback errors (i.e.,

∑Tt=0(ℓ

∗t )

2 is large), we shouldsetC to be small to allow a large slack valueξ. As Cbecomes smaller, 2C

h(1+α)

∑Tt=0(ℓ

∗t )

2 becomes smaller, too.Thus we will have a smaller guaranteed error bound.

5.4 Experimental Results on Real Desktop User Data.We deployed TaskTracer on Windows machines in our re-search group and collected data from one regular user who

was fairly careful about declaring switches. This data setrecords 4 months of daily work, which involved 299 distinctactivities, 65,049 instances (i.e., information vectors), and3,657 activity switches.

To evaluate the learning algorithm described in Sec-tion 5.3, we make the assumption that these activity switchesare all correct, and we perform the following simulation. Thedata is ordered according to time. Suppose the user forgets todeclare every fourth switch. We feed the instances to the on-line algorithm and ask it to make predictions. A switch pre-diction is treated as correct if the predicted activity is correctand if the predicted time of the switch is within 5 minutes ofthe real switch point. When a prediction is made, our simula-tion provides the correct time and activity as feedback. Whenthe user declares an activity switch, the simulation also gen-erates training instances [29].

The online algorithm parameters were set based onexperiments with non-TaskTracer benchmark sets. We setC = 10 (which is a value widely used in the literature) andα = 0.001 (which gave good results on the benchmark datasets).

Performance is measured byprecisionandrecall. Pre-cision is the number of switches correctly predicted dividedby the total number of switch predictions, and Recall is thenumber of switches correctly predicted divided by the totalnumber of undeclared switches. We obtain different preci-sion and recall values by varying the score confidence thresh-old required to make a prediction.

The results comparing our online learning approachwith the batch training methods are plotted in Figures 6.The batch training methods adopt a large margin approach[34] to train the weight vectorΛ. This method createsa positive example for the correct label and a negativeexample the the incorrect label. It then trains the weightvector using all available examples with the linear kernel[5]. To reduce repeated incorrect predictions, we alsoevaluated the batch training method configured so that itdoes not raise any new alarms for at least the first 10minutes after the most recent switch alarm. Our onlineapproach gives competitive performances compared to thebatch approaches. The non-silent batch approach only takesa small step in the right direction after the user providesfeedback. So it is likely that it will make the same mistakein the next iteration. The user has to repeatedly providefeedback so that enough steps are taken to fix the error. Ouronline learning approach outperforms this in most cases. Ifwe force the batch predictor to keep silent after a switchalarm, the batch predictor can avoid many repeated mistakes.In this configuration during the silent period, the batchpredictor treats repeated prediction as an error. Hence, bythe time the silent period is over, it has probably fixed theerror by gaining enough training examples.

Compared to the batch approaches, the online learning

Page 13: A Family of Large Margin Linear Classifiers and Its …web.engr.oregonstate.edu/~tgd/publications/sadm2010...A Family of Large Margin Linear Classifiers and Its Application in Dynamic

approach is much more efficient. On an ordinary PC, itonly took 4 minutes to make predictions for the 65,049 in-stances (0.0037 seconds/instance) while the non-silent batchapproach needed more than 37 hours (more than 2 sec-onds/instance), a speedup factor of more than 500 fold.

6 Conclusions And Further Work

An important challenge for online learning is to achieve highaccuracy while also adapting rapidly to changes in the envi-ronment. This paper presented three efficient online algo-rithms that combine large margin training with regulariza-tion methods that enable rapid adaptation to nonstationaryenvironments. Each algorithm comes with theoretical guar-antees in the form of online error bounds with respect to anoptimal online algorithm. The algorithms have some inter-esting characteristics that make them especially appropriatein dynamic environments. First, they shrink the weights to-wards zero, which makes it easier to adapt the weights whenthe environment suddenly changes. Second, the algorithmsnaturally shrink the influence of the old instances and putmore weight on the more recent ones. Third, the methodslearn a sparse model that ignores or down-weights irrelevantfeatures. Finally, we have successfully applied a soft-marginversion of our algorithms to activity recognition in the Task-Tracer system [29].

There are two promising directions for future work.First, we noted that the learned weight vector of our L2-regularized methods is a linear combination of the activeinstances. It would be interesting to employ the kernel trickhere by replacing the inner product with a kernel satisfyingthe Mercer conditions and compare our algorithms with theForgetron algorithm [8]. The Forgetron is an online kernel-based learning algorithm that controls the number of supportvectors by removing the oldest support vector when thenumber of support vectors exceeds a fixed quota. Sinceremoving a support vector may significantly change thehypothesis, the Forgetron aggressively “shrinks” the weightof old support vectors. Our L2-regularized online algorithmsnaturally shrink the weights of those support vectors, andwe could also control the number of support vectors byremoving the oldest one.

Our current algorithms assume that the system willalways receive the correct label immediately after makinga prediction. However, in many cases there can be a delaybetween the time a prediction is made and the time feedbackis received. For example, in TaskTracer, sometimes there isno feedback at all after the system makes a switch alarm,because the user is too busy and does not notice the alarm.Currently TaskTracer does nothing when this happens, andthe system assumes that its prediction was incorrect. Butan alternative would be to assume the prediction is correctand automatically change TaskTracer’s “current activity”.This situation can be thought as a bandit setting [1, 20]. It

would be very interesting to design a bandit version of ouralgorithms.

Acknowledgments

The authors thank the anonymous reviewers for their helpfulcomments and suggestions.

Appendix – Detailed Proof of the Theorems

Proof of Lemma 3.2

Proof. The Lagrangian of Problem 3.8 is

L(w, τ) =1

2‖w − wt‖2

2

+ τ(1 − yt(w · xt)) + λ(‖w‖22 − β2),

where τ ≥ 0 and λ ≥ 0 are the Lagrange multipliers.Differentiating this Lagrangian with respect to the elementsof w and setting the partial derivative to zero gives

w =1

1 + 2λ(wt + τytxt).(6.30)

We letZ = 1 + 2λ. The KKT conditions require constraint1 − yt(w · xt) ≤ 0 to be active, which leads to

τ =Z − yt(wt · xt)

‖xt‖22

.(6.31)

The KKT conditions requireλ(‖w‖22−β2) = 0. We discuss

two cases here. First, ifλ = 0, then we getτ = 1−yt(wt·xt)

‖xt‖22

from Equation 6.31.Second, if ‖w‖2

2 − β2 = 0. We replaceτ withZ−yt(wt·xt)

‖xt‖22

and get

‖wt‖22 +

2Zyt(wt · xt) − 2(wt · xt)2

‖xt‖22

+Z2 − 2Zyt(wt · xt) + (wt · xt)

2

‖xt‖22

= β2Z2

(β2 ‖xt‖22 − 1)Z2 = ‖wt‖2

2 ‖xt‖22 − (wt · xt)

2.

This can be possible only ifβ2 ‖xt‖22 − 1 ≤

‖wt‖22 ‖xt‖2

2 − (wt · xt)2 sinceZ = 1 + 2λ ≥ 1. In this

case, we getZ =

‖wt‖22‖xt‖

22−(wt·xt)

2

β2‖xt‖22−1

. If β2 ‖xt‖22 − 1 >

‖wt‖22 ‖xt‖2

2 − (wt · xt)2, this corresponds to the first case,

λ = 0. We can easily show that constraint‖w‖22 ≤ β2 is

always feasible and inactive if it is true:

‖w‖22 =

‖wt‖22 ‖xt‖2

2 − (wt · xt)2 + 1

‖xt‖22

<β2 ‖xt‖2

2 − 1 + 1

‖xt‖22

= β2.

Page 14: A Family of Large Margin Linear Classifiers and Its …web.engr.oregonstate.edu/~tgd/publications/sadm2010...A Family of Large Margin Linear Classifiers and Its Application in Dynamic

Since both our objective function and constraint func-tions are convex, we know our solution is globally optimal.Combining the above two cases, we conclude the proof.

Proof of Lemma 5.1

Proof. The Lagrangian of the optimization problem in (3.1)is

L(Λ, ξ, τ) =1

2‖Λ − Λt‖2

2 + Cξ2 +α

2‖Λ‖2

2

+τ(1 − Λ · Zt − ξ),(6.32)

whereτ ≥ 0 is the Lagrange multiplier. Differentiating thisLagrangian with respect to the elements ofΛ and setting thepartial derivative to zero gives

Λ =1

1 + αΛt +

τ

1 + αZt.(6.33)

Differentiating the Lagrangian with respect toξ and settingthe partial derivative to zero gives

ξ =τ

2C.(6.34)

Expressingξ as above and replacingΛ in Eq 6.32 withEq 6.33, the Lagrangian becomes

L(τ) =1

2

τ

1 + αZt −

α

1 + αΛt

2

2

+τ2

4C

2

τ

1 + αZt +

1

1 + αΛt

2

2

+ τ

(

1 − Λt · Zt

1 + α− τ ‖Zt‖2

2

1 + α− τ

2C

)

.

By setting the derivative of the above to zero, we get

1 − τ

2C− τ

1 + α‖Zt‖2

2 −(Λt · Zt)

1 + α= 0(6.35)

⇒ τ =1 − (Λt · Zt) + α

‖Zt‖22 + 1+α

2C

.(6.36)

Combining Eq 6.33 and Eq 6.36 completes the proof.

Proof of Theorem 5.1

Proof. Let ∆t = ‖Λt − u‖22 − ‖Λt+1 − u‖2

2. We can provethe bound by lower and upper bounding

t ∆t.Since Λ0 is a zero vector and the norm is always

non-negative,∑

t ∆t = ‖Λ0 − u‖22 − ‖ΛT − u‖2

2 ≤‖Λ0 − u‖2

2 = ‖u‖22.

Obviously, ∆t 6= 0 only if t ∈ IT . We will onlyconsider this case here. LetΛ′

t = Λt+τtZt, Λt+1 = 11+α

Λ′t.

∆t can be rewritten as

(‖Λt − u‖22 − ‖Λ′

t − u‖22) + (‖Λ′

t − u‖22 − ‖Λt+1 − u‖2

2)

= δt + ǫt.(6.37)

We will lower bound bothδt andǫt. Letψ2 = (1 + α)/2C.For δt, we have

δt = ‖Λt − u‖22 − ‖Λt + τtZt − u‖2

2(6.38)

= ‖Λt − u‖22 − ‖Λt − u‖2

2

− 2τtZt · (Λt − u) − ‖τtZt‖22(6.39)

≥2τtℓt − 2τtℓ∗t − τ2

t ‖Zt‖22(6.40)

≥2τtℓt − 2τtℓ∗t − τ2

t ‖Zt‖22 − (ψτt − ℓ∗t /ψ)2(6.41)

=2τtℓt − τ2t (‖Zt‖2

2 + ψ2) − (ℓ∗t )2/ψ2.(6.42)

We get Eq 6.41 because(ψτt − ℓ∗t /ψ)2 ≥ 0. Pluggingthe definition ofτt and consideringℓt ≥ 1, we get

δt ≥ℓ2t − α2

‖Zt‖22 + 1+α

2C

− 2C

1 + α(ℓ∗t )

2(6.43)

≥ 1 − α2

R2 + 1+α2C

− 2C

1 + α(ℓ∗t )

2.(6.44)

For ǫt, we have

ǫt =(1 − 1

(1 + α)2) ‖Λ′

t‖22 − 2(1 − 1

1 + α)Λ′

t · u.(6.45)

Using the fact that‖u − v‖22 ≥ 0 which equals to

‖u‖22 − 2u · v ≥ −‖v‖2

2, we get

(1 − 1

(1 + α)2) ‖Λ′

t‖22 − 2(1 − 1

1 + α)Λ′

t · u(6.46)

≥−1 − 1

1+α

1 + 11+α

‖u‖22 = − α

2 + α‖u‖2

2 .(6.47)

Using Eq 6.44 and 6.47, we get

T∑

t=0

∆t =∑

t∈IT

∆t

(6.48)

≥∑

t∈IT

(

(1 − α2

R2 + 1+α2C

− 2C

1 + α(ℓ∗t )

2) − α

2 + α‖u‖2

2

)

(6.49)

= m(1 − α2

R2 + 1+α2C

− α

2 + α‖u‖2

2) −∑

t∈It

2C

1 + α(ℓ∗t )

2

(6.50)

≥ m(1 − α2

R2 + 1+α2C

− α

2 + α‖u‖2

2) −2C

1 + α

T∑

t=0

(ℓ∗t )2.

(6.51)

Since∑

t ∆t ≤ ‖u‖22, we have

Page 15: A Family of Large Margin Linear Classifiers and Its …web.engr.oregonstate.edu/~tgd/publications/sadm2010...A Family of Large Margin Linear Classifiers and Its Application in Dynamic

m(1 − α2

R2 + 1+α2C

− α

2 + α‖u‖2

2) −2C

1 + α

T∑

t=0

(ℓ∗t )2 ≤ ‖u‖2

2 .

(6.52)

Sinceh = 1−α2

R2+ 1+α

2C

− α2+α

‖u‖22 > 0, we get the result

in the theorem.

References

[1] P. Auer, N. Cesa-Bianchi, Y. Freund, and R. E. Schapire.Gambling in a rigged casino: The adversarial multi-armedbandit problem. InProc. of FOCS-95, pages 322–331, 1995.

[2] V. R. Carvalho and W. W. Cohen. Single-pass online learning:performance, voting schemes and online feature selection.InProc. of KDD-06, pages 548–553, 2006.

[3] Y. Censor and S. Zenios.Parallel Optimization: Theory,Algorithms, and Applications. Oxford University Press, NewYork, NY, USA, 1997.

[4] K. M. A. Chai, H. L. Chieu, and H. T. Ng. Bayesian onlineclassifiers for text classification and filtering. InProc. ofSIGIR-02, pages 97–104, 2002.

[5] C.-C. Chang and C.-J. Lin. LIBSVM: a library forsupport vector machines, 2001. Software available athttp://www.csie.ntu.edu.tw/∼cjlin/libsvm.

[6] K. Crammer, O. Dekel, J. Keshet, S. Shalev-Shwartz, andY. Singer. Online passive-aggressive algorithms.Journal ofMachine Learning Research, 7:551–585, 2006.

[7] K. Crammer and Y. Singer. Ultraconservative online algo-rithms for multiclass problems.Journal of Machine LearningResearch, 3:951 – 991, March 2003.

[8] O. Dekel, S. Shalev-Shwartz, and Y. Singer. The Forgetron:A kernel-based perceptron on a fixed budget. InAdvances inNIPS 18, pages 259–266. MIT Press, 2006.

[9] O. Dekel and O. Shamir. Learning to classify with missingand corrupted features. InProc. of ICML-08, pages 216–223,2008.

[10] A. N. Dragunov, T. G. Dietterich, K. Johnsrude,M. McLaughlin, L. Li, and J. L. Herlocker. Tasktracer:A desktop environment to support multi-tasking knowledgeworkers. InProc. of IUI-05, pages 75–82, 2005.

[11] J. Duchi, S. Shalev-Shwartz, Y. Singer, and T. Chandra.Effi-cient projections onto the l1-ball for learning in high dimen-sions. InICML ’08: Proceedings of the 25th internationalconference on Machine learning, pages 272–279, New York,NY, USA, 2008. ACM.

[12] Y. Freund and R. E. Schapire. Game theory, on-line pre-diction and boosting. InProc. of COLT-96, pages 325–332,1996.

[13] C. Gentile. A new approximate maximal margin classifi-cation algorithm. Journal of Machine Learning Research,2:213–242, 2002.

[14] A. Globerson and S. Roweis. Nightmare at test time: robustlearning by feature deletion. InProc. of ICML-06, pages 353–360, 2006.

[15] T. Hastie, R. Tibshirani, and J. H. Friedman.The Elements ofStatistical Learning. Springer, 2001.

[16] M. Herbster and M. K. Warmuth. Tracking the best expert.Machine Learning, 32(2):151–178, 1998.

[17] E. Horvitz. Principles of mixed-initiative user interfaces. InProc. of CHI-99, pages 159–166, 1999.

[18] E. Horvitz, J. Breese, D. Heckerman, D. Hovel, and K. Rom-melse. The lumiere project: Bayesian user modeling for in-ferring the goals and needs of software users. InUAI-98,pages 256–265, 1998.

[19] T. Joachims.Learning to Classify Text Using Support VectorMachines. Kluwer Academic Publishers, 2001.

[20] S. M. Kakade, S. Shalev-Shwartz, and A. Tewari. Efficientbandit algorithms for online multiclass prediction. InProc. ofICML-08, pages 440–447, 2008.

[21] J. Kivinen, A. J. Smola, and R. C. Williamson. Online learn-ing with kernels. IEEE Transactions on Signal Processing,52(8):2165–2176, August 2004.

[22] J. Kivinen and M. K. Warmuth. Exponentiated gradientversus gradient descent for linear predictors.Information andComputation, 132(1):1–63, 1997.

[23] Y. Li and P. M. Long. The relaxed online maximum marginalgorithm.Machine Learning, 46(1–3):361–387, 2002.

[24] M. W. Mahoney, L.-H. Lim, and G. E. Carlsson. Algorithmicand statistical challenges in modern large-scale data analy-sis are the focus of MMDS 2008.SIGKDD Explorations,10(2):57–60, 2008.

[25] A. Y. Ng. Feature selection, L1 vs. L2 regularization, androtational invariance. InProc. of ICML-04, pages 78–85,2004.

[26] M. Philipose, K. Fishkin, M. Perkowitz, D. Patterson, andD. Hahnel. The probabilistic activity toolkit: Towards en-abling activity-aware computer interfaces. Technical ReportIRS-TR-03-013, Intel Research Lab, Seattle, WA, 2003.

[27] H. Robbins and S. Monro. A stochastic approximationmethod. Annals of Mathematical Statistics, 22(3):400–407,1951.

[28] F. Rosenblatt. The Perceptron: a probabilistic model for in-formation storage and organization in the brain.Neurocom-puting: foundations of research, pages 89–114, 1988.

[29] J. Shen, J. Irvine, X. Bao, M. Goodman, S. Kolibaba, A. Tran,F. Carl, B. Kirschner, S. Stumpf, and T. Dietterich. Detectingand correcting user activity switches: Algorithms and inter-faces. InProc. of IUI-09, pages 117–125, 2009.

[30] J. Shen, L. Li, and T. G. Dietterich. Real-time detection oftask switches of desktop users. InProc. of IJCAI-07, pages2868–2873, 2007.

[31] J. Shen, L. Li, T. G. Dietterich, and J. Herlocker. A hybridlearning system for recognizing user tasks from desktopactivities and email messages. InProc. of IUI-06, pages 86–92, 2006.

[32] S. Solla and O. Winther. Optimal perceptron learning: asonline bayesian approach. InOn-line learning in neuralnetworks, pages 379–398. Cambridge University Press, 1998.

[33] R. Tibshirani. Regression shrinkage and selection viathelasso.J. Royal. Statist. Soc B, 58(1):267–288, 1996.

[34] I. Tsochantaridis, T. Joachims, T. Hofmann, and Y. Altun.Large margin methods for structured and interdependent out-

Page 16: A Family of Large Margin Linear Classifiers and Its …web.engr.oregonstate.edu/~tgd/publications/sadm2010...A Family of Large Margin Linear Classifiers and Its Application in Dynamic

put variables.JMLR, 6:1453–1484, 2005.[35] Y. Yang and J. O. Pedersen. A comparative study on feature

selection in text categorization. InProc. of ICML-97, pages412–420, 1997.

[36] H. Zou and T. Hastie. Regularization and variable selectionvia the elastic net.J. Royal. Stat. Soc. B., 67(2):301–320,2005.

Page 17: A Family of Large Margin Linear Classifiers and Its …web.engr.oregonstate.edu/~tgd/publications/sadm2010...A Family of Large Margin Linear Classifiers and Its Application in Dynamic

0.1

0.105

0.11

0.115

0.12

Error Rate

NORMA

PA

Bayesian Perceptron

L2 Objective Regularized

L2 Constraint Regularized

L1 Constraint Regularized

0.07

0.075

0.08

0.085

0.09

0.095

100 200 300 400 500 600 700 800 900

Cumulative

Number of Instances

(a) USPS

0.07

0.08

0.09

Error Rate

NORMA

PA

Bayesian Perceptron

L2 Objective Regularized

L1 Constraint Regularized

L2 Constraint Regularized

0.04

0.05

0.06

100 200 300 400 500 600 700 800 900 1000 1100 1200 1300 1400 1500

Cumulative

Number of Instances

(b) 20NewsGroups

0.17

0.18

0.19

0.2

0.21

Error Rate

NORMA

PA

L2 Objective Regularized

L2 Constraint Regularized

L1 Constraint Regularized

Bayesian Perceptron

0.12

0.13

0.14

0.15

0.16

100 200 300 400 500 600 700 800 900 1000 1100 1200 1300 1400 1500

Cumulative

Number of Instances

(c) SRAA

Figure 1: Cumulative error rate of different online methodsas a function of the number of instances.

Page 18: A Family of Large Margin Linear Classifiers and Its …web.engr.oregonstate.edu/~tgd/publications/sadm2010...A Family of Large Margin Linear Classifiers and Its Application in Dynamic

103050100180

0.1

0.15

0.2

0.25

0.3

0.35

The number of features

The

ove

rall

erro

r ra

te

Information gainGame theoreticL2 norm constrainedL1 norm constrained

(a) USPS

5010030010006000

0.05

0.1

0.15

0.2

The number of features

The

ove

rall

erro

r ra

te

Information gainL2 norm constrainedL1 norm constrained

(b) 20NewsGroups

0.2

0.3

0.4

0.5

The

ove

rall

erro

r ra

te

Information gainL2 norm constrainedL1 norm constrained

Page 19: A Family of Large Margin Linear Classifiers and Its …web.engr.oregonstate.edu/~tgd/publications/sadm2010...A Family of Large Margin Linear Classifiers and Its Application in Dynamic

(a) Information gain (b) PA

(c) L2 norm constraint (d) L1 norm constraint

Figure 4: The learned models. The lighter color indicates larger absolute value of the weights.