正在加载图片...
an2 a course only with courses offered in previous terms. Another pos- sibility is a select operator that may follow in order to filter the out ut of a recommend operator, e. g, selecting only tuples with score bove a threshold. In these cases, we will use Dcf. a c as a short- hand. In what follows, for simplicity, we omit cf, a, and c from the operator notation whenever they are understood or not required (e.g, when there is no filtering), and we simply write RiDRj 3.5 The blend operator Often, we may want to combine recommendations generated (a) different recommendations through two different processing paths into one. For example, we FrendCourses5ReqCourses CourseID T幽see may have a set of courses that can be recommended based on the Advanc tudent history and courses suggested by friends or courses that are required for graduating, and we want to provide one recommenda- tion. For this purpose, we introduce the blend operator. put relations, Ri and Ri, augmented with an attribute with default name bscore, as follow R: BM R: =I(r,u) RUR AU: =MRi, r(r)) FriendCourses B Req Courses Tuples in the input relations should be union-compatible. In a sense, the blend operator is an advanced union, which does not only combine the tuples from its input relations but also augments each tuple with an attribute whose value is computed by taking into account the tuple in perspective with the tuples coming from 07 both relations using a blending method M. the name of the new attribute can be different from the default by renaming (c)normalized blending Example: Figure 4(a) shows two sets of courses, which have been generated in different ways: the set Req Courses is recommended FriendCourses 8 Req course based on degree requirements and the set Friend Courses is recom- mended by a students friends. A course in either set is described by the course code, title and recommendation score. The attributes may have been renamed before the relations are presented in the c1c778 blend operator using a rename operator. A blending method Occurrences (A, Ri, Ri counts the occur- rences of each tuple, identified by the attribute A, in both relations. Figure 4(b) shows the result of mixing the sets of courses using Figure 4: Blending examples Occurrences[CourselD, ReqCourses, Friend Courses]. For example, the Advanced Programming course is found in both sets in tuples ti The Occurrences blending method computes the same si[A]*cf(t, si) value for both tuples, i.e., Occurrences(t1)= Occurrences(ta) W_Avglcf, A(t, S) 2. This may not occur with other methods, like the next one ∑s[4 A Norm_Blend [B, wi, w,, Ri, Ril method computes a bscore for each tuple by normalizing the value of its attribute B and weight ing it using a real number in 0,1] ltioned earlier, (aggregation)comparison functions, like the e illustrate here, will belong to a library of functions to be Norm_Blend[B, w'i,wj, Ri, R,l()=BP *tift∈R1 *t;ift∈R DEFINITION 5. Recommend, Def, a, outputs the tuples of a re- For the two course sets, we could use Norm_Blend(score, 0.7.1 lation Ri augmented with an attribute with default name score, whose value for each tuple is computed by comparing this tuple the second set because satisfying the requirements is more impor with the tuples of a relation Ri, as follows tant. In the combined set of courses shown in Figure 4(c). the Ad- vanced Programming course now appears with different bscores R1 Def, a R:={(r,v)r;∈R4∧v:=al](r,B)} 0.7 = 0.7 in ti and a to*1= 1.0 in ta. On the other hand, the Graphics course is highly recommended by the students In other words, the score value of each tuple ri in Ri is produced friends but it has a lower score according to the requirements: a 9 in y comparing ri to each tuple in R, using function cf and then ts in contrast to a 7 in tb. However, due to giving different weight b aggregating using function a to the two sets, the bscore for ts is Io*0.7=0.63 and for tb is The new attribute can be renamed. if so desired. Furthermore sidered for each tuple in Ri. For example, we may want to compare for each tuple, identified by an attribute A in the two input relations,FriendCourses CourseID Title Score ReqCourses t1 t2 t3 ta tb tc C2 Advanced Programming 10 C5 AI Techniques 7 C10 Graphics 9 CourseID Title Score C2 Advanced Programming 10 C10 Graphics 7 C22 Compilers 8 (a) different recommendations CourseID Title Score C2 Advanced Programming 10 C5 AI Techniques 7 C10 Graphics 9 FriendCourses ß ReqCourses C10 Graphics 7 C22 Compilers 8 t1, ta t2 t3 tb tc Bscore 2 1 2 2 1 (b) occurrence-based blending CourseID Title Score C2 Advanced Programming 10 C5 AI Techniques 7 C10 Graphics 9 FriendCourses ß ReqCourses C2 Advanced Programming 10 C10 Graphics 7 C22 Compilers 8 t1 t2 t3 ta tb tc Bscore 0.7 0.49 0.63 1 0.7 0.8 (c) normalized blending CourseID Title Score C2 Advanced Programming 10 C5 AI Techniques 7 C10 Graphics 9 FriendCourses ß ReqCourses C10 Graphics 7 t1 t2 t3 ta, tb Bscore 10 2.88 7.82 7.82 tc C22 Compilers 8 4.7 (d) weighted average blending Figure 4: Blending examples W_Avg[cf, A](t, S) = X si ∈ S si[A] ∗ cf(t, si) X si ∈ S si[A] As mentioned earlier, (aggregation) comparison functions, like the ones we illustrate here, will belong to a library of functions to be used with the recommend operator. DEFINITION 5. Recommend, .cf,a, outputs the tuples of a re￾lation Ri augmented with an attribute with default name score, whose value for each tuple is computed by comparing this tuple with the tuples of a relation Rj , as follows: Ri .cf,a Rj := {(ri, v)|ri ∈ Ri ∧ v := a[cf](ri, Rj )} In other words, the score value of each tuple ri in Ri is produced by comparing ri to each tuple in Rj using function cf and then aggregating using function a. The new attribute can be renamed, if so desired. Furthermore, we may specify a condition on which tuples from Rj will be con￾sidered for each tuple in Ri. For example, we may want to compare a course only with courses offered in previous terms. Another pos￾sibility is a select operator that may follow in order to filter the out￾put of a recommend operator, e.g., selecting only tuples with score above a threshold. In these cases, we will use .cf,a,c as a short￾hand. In what follows, for simplicity, we omit cf, a, and c from the operator notation whenever they are understood or not required (e.g., when there is no filtering), and we simply write Ri.Rj . 3.5 The Blend Operator Often, we may want to combine recommendations generated through two different processing paths into one. For example, we may have a set of courses that can be recommended based on the student history and courses suggested by friends or courses that are required for graduating, and we want to provide one recommenda￾tion. For this purpose, we introduce the blend operator. DEFINITION 6. Blend, βM, outputs the tuples from its two in￾put relations, Ri and Rj , augmented with an attribute with default name bscore, as follows: Ri βM Rj := {(r, v)|r ∈ Ri ∪ Rj ∧ v := M[Ri, Rj ](r)} Tuples in the input relations should be union-compatible. In a sense, the blend operator is an advanced union, which does not only combine the tuples from its input relations but also augments each tuple with an attribute whose value is computed by taking into account the tuple in perspective with the tuples coming from both relations using a blending method M. The name of the new attribute can be different from the default by renaming. Example: Figure 4(a) shows two sets of courses, which have been generated in different ways: the set ReqCourses is recommended based on degree requirements and the set FriendCourses is recom￾mended by a student’s friends. A course in either set is described by the course code, title and recommendation score. The attributes may have been renamed before the relations are presented in the blend operator using a rename operator. • A blending method Occurrences[A,Ri, Rj ] counts the occur￾rences of each tuple, identified by the attribute A, in both relations. Figure 4(b) shows the result of mixing the sets of courses using Occurrences[CourseID, ReqCourses, FriendCourses]. For example, the Advanced Programming course is found in both sets in tuples t1 and ta. The Occurrences blending method computes the same value for both tuples, i.e., Occurrences(t1) = Occurrences(ta) = 2. This may not occur with other methods, like the next one. • A Norm_Blend[B, wi, wj ,Ri, Rj ] method computes a bscore for each tuple by normalizing the value of its attribute B and weight￾ing it using a real number in [0, 1]: Norm_Blend[B, wi, wj , Ri, Rj ](t) = ( t[B] max B ∗ wi if t ∈ Ri, t[B] max B ∗ wj if t ∈ Rj . For the two course sets, we could use Norm_Blend[Score, 0.7, 1, FriendCourses, ReqCourses], which gives more weight to the courses in the second set because satisfying the requirements is more impor￾tant. In the combined set of courses shown in Figure 4(c), the Ad￾vanced Programming course now appears with different bscores: a 10 10 ∗ 0.7 = 0.7 in t1 and a 10 10 ∗ 1 = 1.0 in ta. On the other hand, the Graphics course is highly recommended by the student’s friends but it has a lower score according to the requirements: a 9 in t3 in contrast to a 7 in tb. However, due to giving different weight to the two sets, the bscore for t3 is 9 10 ∗ 0.7 = 0.63 and for tb is 7 10 ∗ 1.0 = 0.7. • A Wavg_Blend[A, B, wi, wj ,Ri, Rj ] method computes a bscore for each tuple, identified by an attribute A in the two input relations
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有