Learnng User's Schedulng Crtera n a Personal Calendar Agent! Shh-ju Ln and Jane Yung-jen Hsu Deartment of Comuter Scence and Informaton Engneerng Natonal Tawan Unversty 1 Sec 4 Roosevelt Road, Tae, 106 (02) 2363-5336 x 120 {sjln, yjhsu}@agents.cse.ntu.edu.tw} Abstract Calendar schedulng s a necessary but tedous job n daly lfe. Even wth the hel of schedulng software, a user has to secfy hs/her ersonal schedulng crtera reeatedly n each delegaton. Ths aer resents a software agent that learns a user's schedulng atterns from ast exerence, and suggests relevant schedulng crtera when the user wants to arrange a new actvty. New schemas of schedulng crtera are nduced usng decson trees. To mrove the agent s learnng erformance, an enhanced decson tree algorthm, HID3, s roosed. Moreover, the agent observes the calendar of a user to dentfy nconsstency between hs actual behavor and schedulng crtera. The agent can alert user of such nconsstency and suggest udates to hs schedulng crtera. Exermental data show that the roosed ersonal calendar agent can not only learn a user's schedulng crtera wth hgh accuracy, but also kee u wth subsequent changes. 1. Introducton Calendar schedulng s a necessary but tedous job n daly lfe. When schedulng an actvty, one must consder ersonal restrctons and references as well as external factors such as the schedules of the other artcants, and any requred resources. There have been software develoed to hel eole manage ther calendars and schedule ther daly actvtes. For examle, Haynes et al. [1] roosed a communty of dstrbuted software agents that can communcate wth each other by e-mal, and schedule meetngs on behalf of ther users usng a negotaton mechansm. A user smly secfes the crtera of the meetng to be scheduled, then the agents fnd a tme accetable to all the artcants. Whle such agents hel automate the task of schedulng, a user needs to secfy hs schedulng crtera exlctly each tme he delegates the task to the agents. To further automate the schedulng rocess, we desgned a ersonal calendar agent that releves the user of reeated delegaton by suggestng schedulng crtera learned from ast exerence [2]. In what follows, Secton 2 frst formulates the roblem of calendar schedulng n terms of restrctons and references, and Secton 3 descrbes the roosed learnng aroach. The mechansms for udatng and verfyng the learned results are resented n Sectons 4 and 5. The exermental results are summarzed n Secton 6, followed by a dscusson of related work and the concluson. 2. Problem Formulaton When a user delegates her agent to schedule her calendar, she has to secfy the set of actvtes together wth all relevant schedulng crtera ntally. Each actvty s secfed by fve attrbutes: actvty name, artcants, locaton, requred resources, and actvty duraton. The goal of a ersonal calendar agent s to fnd the best tme to schedule each actvty by learnng the general atterns of a user's schedulng crtera and reusng them n future delegatons. Each schedulng crteron s ether a restrcton or a reference. The former defnes constrants that must hold n the user s calendar, whle the latter ndcates choces among alternatve schedules. There are three knds of restrctons as follows. (1) Tme nterval restrcton constrans the tme for a sngle actvty. For examle, takng MRT can not be scheduled at 2 a.m. snce the trans are not n servce after mdnght. (2) Precedence restrcton constrans the orderng of two actvtes. For examle, one must get a assort before travelng abroad. (3) Tme margn restrcton constrans the tme margn between two actvtes. For examle, the tme margn between two meetngs must be greater than the travel tme between the two meetng laces. Smlarly, there are three tyes of references. (1) Tme nterval reference models the user's! Ths research was sonsored n art by ROC Natonal Scence Councl under grant No. NSC-88-2213-E-002-007.
reference for the executon tme of a sngle actvty, e.g. referrng workng n the mornng to at nght. (2) Precedence reference models the executon rorty of two actvtes, e.g. dong homework before layng a game. (3) Tme margn reference ndcates referred tme margn between two actvtes, e.g. arrvng at the arort at least one hour before the flght s scheduled dearture. Unlke restrctons, references may be volated. For examle, suose that a user refers meetng n the afternoon. It s accetable, whle not deal, to schedule a meetng n the mornng n order to accommodate all meetng artcants. The ersonal calendar agent nduces the general atterns of a user's schedulng crtera, whch are used as suggestons n schedulng new actvtes. The learned general atterns are reresented as schemas. A schema descrbes the condtons of the actvtes assocated wth a secfc restrcton or reference. For examle, gven a reference schema dslke meetng wth John n the mornng, the agent wll suggest dslke mornng for all meetng n whch John artcates. When the user wants to arrange a new actvty, the agent suggests relevant schedulng crtera accordng to the learned schemas. tree s the schema dslke dong entertanment outdoors n the mornng. 2 hours dslked duraton 0.5 hour exercse normal actvty name wth John? No referred work Yes dslked entertanment ndoor normal locaton outdoor dslked Fgure 1: A decson tree reresentng the tme nterval references wth resect to mornng Fgure 2 shows a decson tree for recedence restrctons. Each recedence restrcton s assocated wth two actvtes, and ndcates whether the executon order the frst actvty before the second actvty s. Each ath n the tree reresents a recedence restrcton schema. For examle, the mddle-left ath means meetng before rearng meetng materals s forbdden. name of the 1st actvty 3. Learnng Schemas codng meetng rearng meetng materal 3.1 Decson Trees name of the 2nd actvty We use a machne learnng aroach, decson tree, to nduce schemas. The schemas for the sx knds of schedulng crtera are learned resectvely. The nut to a decson tree s an nstance, whch s descrbed by a set of attrbutes; the outut of the tree s a classfcaton for that nstance. Each node n the tree secfes a test of some attrbute of the nstance, and each branch descendng from that node corresonds to one of the ossble values for ths attrbute [3]. In the decson tree for restrcton schemas, the classfcaton s ether, or forbdden; whle n the decson tree for reference schemas, the classfcaton can be one of the values {hghly referred, referred, normal, dslked, hghly dslked}. For tme nterval schemas (both the restrcton and reference schemas), the nstances n the decson tree are actvtes. For recedence and tme margn schemas, the nstances are actvty ars, as each schema s assocated wth two actvtes. For examle, the decson tree n Fgure 1 reresents the tme nterval reference wth resect to mornng. Each ath from the tree root to a leaf s a schema. For nstance, the rghtmost ath n the rearng meetng materal forbdden codng Fgure 2: A decson tree reresentng recedence restrctons The tree n Fgure 3 reresents tme margn restrctons. It ndcates whether t s to execute two actvtes wth a tme margn 0.5 hour. Academa Snca forbdden home locaton of the 2nd actvty school locaton of the 1st actvty swmmng ool school locaton of the 2nd actvty home forbdden Fgure 3: A decson tree reresentng the restrctons wth resect to tme margn of 0.5 hour.
3.2 Herarchcal Concets Two of the actvty attrbutes, actvty name and locaton, may contan herarchcal concets. That s, ther values can be groued nto several categores, whch can be further groued nto suer categores. The resultng categores form a herarchy of actvtes. Take the attrbute actvty name for examle. Suose that there are sx values: swm, jog, read, sng, study and codng. Among these values, swm and jog belong to exercse ; read and sng belong to enjoyment ; study and codng belong to work. Furthermore, enjoyment and exercse are sub-categores of lesure. The herarchy for actvty name s llustrated n Fgure 4. actvtes work lesure study codng exercse enjoyment swm jog read sng Fgure 4: A herarchy for the attrbute actvty name A user can categorze and buld u such herarches, so that actvtes n the same category have smlar schedulng crtera. For examle, f a user refers swmmng n the afternoon, t s lkely that he also refers joggng n the afternoon, snce they both belong to the exercse actvty. The herarchy enables the agent to nduce more general schemas n terms of categores and to make suggestons for a novel actvty n the same category. 3.3 HID3 Algorthm HID3 (herarchcal ID3) algorthm s desgned to mrove the erformance of decson tree learnng by makng use of the herarchcal attrbutes. Smlar to ID3, HID3 constructs the decson tree n a to-down fashon,.e. from root to leaves. At each node, an attrbute s selected to classfy nstances to maxmze the nformaton gan. However, when the chosen attrbute contans herarchcal concets, nstances are arttoned accordng to the categores n the herarchy, nstead of ther values. Take the herarchy n Fgure 4 as an examle, f the attrbute actvty name s selected for the frst tme, the decson tree s branched accordng to the categores on the frst level of the herarchy. That s, the nstances are dvded nto the two categores: work and lesure. When the attrbute actvty name s chosen for the second tme, the decson tree s branched accordng to the categores on the second level of the herarchy. That s, nstances n the work category are dvded nto study and codng, whle nstances n the lesure category are dvded nto exercse and enjoyment. Ths rocess reeats tll the entroy of the leaf nodes becomes zero or the lowest level of the herarchy s reached. Detals of the HID3 algorthm are descrbed below. Algorthm 1 HID3 Algorthm HID3 (S, C, A, H) Requre: A set of nstances S, a set of attrbutes A descrbng S, a set of classfcaton C for S, and an array of categores H, wth H[a] denotng the current categores for the attrbute a Create a node r for the tree f the classfcaton for all nstances n S s the same then Return r wth that classfcaton f A s emty then Return r wth the most common classfcaton for the nstances n S Choose an attrbute a from A, that best classfes S Assgn a to the test for r f a has herarchcal concets then Let V be the set of sub-categores of H[a] Let V be the set of ossble values of a for each v V test Add a new tree branch below r, corresondng to the a = v S Let be the subset of S that have value for a f S v v end for Return r s emty then Add a leaf node wth the most common classfcaton for the nstances n S v f a has herarchcal concets then f s on the lowest level of the herarchy v of a then Add the sub-tree HID3(, C, A-{a}, H) H[a]=v S v S v Add the sub-tree HID3(, C, A, H) Add the sub-tree HID3( S v, C, A-{a}, H) HID3 has a learnng bas: to classfy nstances wth the hghest level of categores n the herarches. v
That s, t tends to generate schemas n terms of more general categores. Therefore, t s able to mrove the generalzaton ablty of the learned schemas. The dfference of HID3 and ID3 can be exlaned from the vewont of hyothess sace. When the actvty name attrbute s selected as the classfer, ID3 hyotheszes that actvtes wth the same name have the same schedulng crtera, whle HID3 starts by hyotheszng that actvtes n the same category on the frst level of the herarchy have the same schedulng crtera. If the schedulng crtera are dfferent wthn the same category, the hyothess of HID3 shrnks and becomes all actvtes n the same category on the second level of the herarchy have the same schedulng crtera. If the schedulng crtera reman dfferent wthn the category, the hyothess wll kee shrnkng and fnally become actvtes wth the same name has the same schedulng crtera, whch s exactly the hyothess of ID3. In other words, HID3 exlores more general hyotheses before reachng the hyothess nduced by ID3. The comlexty, n both sace and tme, of HID s greater than that of ID3. Furthermore, gven that decson tree learnng erforms greedy search wthout backtrackng, the bas of HID3 may result n learnng schemas wth lower accuracy. The exerment reorted n Secton 6.1 comares the erformance of the two learnng algorthms, and examnes f HID3 s able to make better redctons when the schedulng crtera nvolvng more herarchcal concets. 4. Udatng Schemas The user's schedulng crtera may change over tme. After schemas are learned, the agent should also kee track of subsequent changes by udatng the learned schemas. To ths end, the agent kees a restrcton (or reference) value for each schema. The restrcton value r s a real number such that (1) r = 1 f the schema ndcates that the executon tme s. (2) r = -1 f the schema ndcates that the executon tme s forbdden. On the other hand, the reference value s any nteger from the set {-2, -1, 0, 1, 2}, ndcatng that the reference s {hghly referred, referred, normal, dslked, hghly dslked} resectvely. The agent catures the changes by contnuously udatng the restrcton and reference values of each schema. Gven a restrcton schema σ, the r restrcton value r of σ r s udated teratvely each tme when the user modfes the restrcton, whch s suggested accordng to σ r : r = α R + ( 1 α ) new r old where α s learnng rate n [0,1], and R s n {1, -1} to ndcate f the restrcton s {, forbdden} after the user's modfcaton. Smlarly, the functon for udatng reference value s: = α P + ( 1 α ) new old where P s n {-2, -1, 0, 1, 2} to ndcate that the reference s {hghly referred, referred, normal, dslked, hghly dslked} after the user's modfcaton. By udatng the restrcton and reference values, the agent s able to adat tself to the changes, and make udated suggestons for the user's schedulng crtera. 5. Verfyng Schemas Research n cogntve sychology shows the lable nature of human's references. Preferences secfed by a erson may be nconsstent: one may refer an alternatve A to B, refer B to C, but refer C to A ( ntranstvty of references [4]). Even f the reference s consstent, when t s reresented n terms of numercal values, these values may be asymmetrcal. For examle, one may rate the alternatve A as value 2, when the alternatve B s taken as the standard (whose value s 0 ). On the other hand, when the alternatve A s taken as the standard, B may not be rated as -2, but -3 or -1 ( asymmetry n references [5]). Therefore, modelng references by user-nut values s straghtforward, but may not be able to reflect the references accurately. There may be nconsstency between the user's schedulng crtera and schedulng behavor. For examle, the user may consder a tme nterval hghly dslked, but always schedule actvtes n t, even though other tme ntervals are avalable. Snce schemas are nduced from the schedulng crtera secfed by the user, the agent has to verfy the schemas by keeng track of the user's schedulng behavor (.e., the actual calendar). The basc dea s to calculate the frequency of volaton of a reference schema. If the frequency s too hgh, the agent suggests the user to gnore the reference. Gven a reference schemaσ, the volaton frequency v of σ s udated each tme when the actvty defned n σ s scheduled:
v = α V + ( 1 α ) new v old where α s learnng rate, and V s a Boolean value to ndcate f σ s volated n the actual calendar. Wth ths mechansm, the agent s able to hel the user clarfy what he/she really wants and learn the user's schedulng crtera wth better accuracy. 6. Exerments 6.1 Exerments for Learnng Schemas The tranng nstances n the exerments are generated sem-automatcally. We collected two users' daly actvtes, relevant schedulng crtera, as well as the herarches for actvty name and locaton. The users have a total of 20 and 30 schedulng crtera, resectvely. We selected 25 actvtes for learnng tme nterval restrctons and references; and 15 actvtes for learnng recedence and tme margn restrctons and references. The tranng nstances are generated accordng to these schemas and actvtes. Nose s added nto the tranng nstances randomly. The number of tranng nstances needed s calculated accordng to learnng theory to get PAC (robably aroxmately correct) results [6]. There are 196 nstances for tme nterval restrctons; 1583 for tme nterval references; 425 for recedence and tme margn restrctons; and 3640 for recedence and tme margn references. We exerment both ID3 and HID3 n nducng decson trees. Tranng nstances are dvded nto fve grous, and the learned schemas are evaluated by cross-valdaton. The exermental results show that the user's schedulng crtera can be learned by usng decson trees. The accuracy s shown n Tables 1 and 2. Accuracy (%) User A User B tranng/testng HID3 ID3 HID3 ID3 Tme nterval 98.5/85.7 98.5/82.7 99.6/91.8 99.6/89.7 Precedence 99.6/98.2 99.6/98.8 99.4/99.4 99.4/99.4 Tme margn 100/97.3 100/96.8 99.3/91.8 99.3/87.1 Table 1: The accuracy of learnng restrcton schemas Accuracy (%) User A User B tranng/testng HID3 ID3 HID3 ID3 Tme nterval 99.4/93.2 99.4/88.4 99.4/98.9 99.4/97.6 Precedence 100/91.7 100/90.5 100/94.4 100/80.9 Tme margn 99.9/90.5 99.9/90.4 99.9/96.9 99.9/97.1 Table 2: The accuracy of learnng reference schemas The two algorthms, HID3 and ID3, erform the same n the tranng set. In the testng set, HID3 has better accuracy then ID3 f there are more herarchcal concets n the nstances (e.g., User A's tme nterval references; User B's tme margn restrctons and recedence references); the two algorthms have smlar erformance f the schemas contan few herarchcal concets. Ths result shows that usng HID3 nstead of ID3 wll not degrade the erformance even f there are few herarchcal concets n the key schemas. Consder the comutaton tme of the two algorthms. HID3 needs more tme than ID3, but the dfference s less than 30%. In summary, HID3 matches the erformance of ID3 wth a slght comutatonal overhead. On the other hand, HID3 nduces more general schemas and makes better redctons when the learnng target contans herarchcal concets. 6.2 Exerments for Udatng Schemas We randomly generated 1500 schemas for restrcton and reference resectvely, and smulate the user's changes by modfyng each schema arbtrarly. The results show that changes of restrctons and references can be catured by udatng the restrcton value (and reference value) of schemas. On average, t takes about 2 to 5 teratons to kee u wth changes n restrctons; and 3 to 6 teratons to kee u wth changes n references. 7. Related Work and Concluson There are two eces of mortant research n ths roblem doman. One s CAP (Calendar APrentce) by Mtchell et al [7], and the other s the learnng nterface agent by Maes [8, 9]. Both of them are learnng agents that hel eole n calendar schedulng. The CAP agent observes the user's schedulng behavor, and hels the user by suggestng meetng arameters (e.g., locaton, duraton, date, tme). These suggestons are based on some rules nduced by decson trees from the meetngs scheduled by the user earler. Maes's learnng nterface agent learns from the user's behavor by memory-based learnng, and redcts the user's acton n a artcular stuaton. The agent may suggest an acton to the user (e.g., to accet an nvtaton, to reschedule a meetng) by comarng current stuaton aganst revous exerence.
Both of them focus on learnng and redctng the executon tme of the user s actvtes. However, suggestng executon tme er se s hardly meanngful, esecally when the actvty nvolves other artcants and/or resources. The user cannot determne the executon tme wthout consderng external factors of schedulng (e.g., the references of other artcants, the schedule of requred resources). Therefore, the executon tme becomes undecded and unredctable for any sngle user, let alone the agent. It s also roblematc to learn from executon tme. The executon tme s a comromse between the user's references and other external factors. The user may volate the ersonal references n order to gve way to the schedulng crtera of other artcants or resources. However, the user may mantan the same references the next tme around and wll arrange actvtes n the referred tme wthout conflcts from external factors. In other words, executon tme s not necessarly the referred tme. As a result, learnng from executon tme does not always reflect the actual references of the user. The other roblem s, t s too secfc to nduce references from executon tme. For examle, the user refers meetng wth John n the afternoon. Suose the meetngs haened to be scheduled on Wed. afternoon for several tmes. The agent observes the calendar and concludes: the user refers Wed. afternoon. Actually, the user has no reference for Wed. over other days. By observng the calendar only, t s mossble and unreasonable for the agent to generalze from refer Wed. afternoon to refer afternoon. In other words, the executon tme for meetngs s too secfc to learn, and the learned result s only a small art of the user's reference. The agent cannot get the whole cture of the user's references, untl all knds of meetngs were scheduled n every ossble tme slot at least once. That s to say, the agent s not able to redct the restrctons and references for a novel <meetng, executon tme> ar, due to the lack of generalzaton ablty. Instead of executon tme, the roosed ersonal calendar agent learns to redct schedulng crtera. When the user wants to arrange an actvty nvolvng external factors, t s more lausble for the agent to suggest schedulng crtera. Such crtera need to be exchanged wth the other artcants. An actvty s then scheduled based on the schedulng crtera of all artcants and resources. It s also easer to learn from schedulng crtera than executon tme. The user wrtes schedulng crtera for actvtes, and the agent nduces schemas of the schedulng crtera. Because of the generalzaton ower of learnng, the agent s able to suggest schedulng crtera for revously seen actvtes as well as for novel actvtes. Snce the agent also kees track of the actual calendar and calculates the volaton frequency of each schema, t can not only reeat the user's schedulng crtera, but also suggest useful modfcatons roactvely. Ths aer has resented an agent to learn a user's schedulng crtera. The exermental evdence shows that the agent can learn a user's schedulng crtera wth hgh accuracy, and kee u wth subsequent changes effectvely. Such a learnng agent can work wth other calendar schedulng software to automate the schedulng rocess and to mrove the qualty of the resultng schedule. References [1] T. Haynes, S. Sen, N. Arora, and R. Nadella. An automated meetng schedulng system that utlzes user references. In Proceedngs of Agents 97 Conference, 1997. [2] S. J. Ln. Learnng restrctons and references n a ersonal agent for calendar schedulng. Master s thess, Natonal Tawan Unversty, Tae, Tawan, 2000. [3] T. Mtchell. Machne Learnng, chater 3. New York: McGraw-Hll, 1997. [4] A. Tversky. Intranstvty of references. Psychologcal Revew, 76:31-48, 1969. [5] P. D. Tyson. Do your standards make any dfference? Asymmetry n reference judgments. Percetual and Motor Sklls, 63:1059-1066, 1986. [6] S. J. Russell. Artfcal ntellgence: A modern aroach, chater 18. London: Prentce Hall Internatonal, 1995. [7] T. Mtchell, R. Caruana, D. Fretag, J. McDermott, and D. Zabowsk. Exerence wth learnng ersonal assstant. Communcatons of the ACM, 37:81-91, 1994. [8] P. Maes and R. Kozerok. Agents that reduce work and nformaton overload. Communcatons of the ACM, 37:31-40, 1994. [9] R. Kozerok and P. Maes. A learnng nterface agent for schedulng meetngs. In Proceedngs of Intellgent User Interfaces 93, 1993.