Вы находитесь на странице: 1из 34

Interest-based

personalised real time


content recommendation
in online social
communities

Nini P Suresh
137511

Problem
Identify unique and diverse
interests of users on real time
basis
Existing Recommendation
system flaw: yield biased
decisions
favoring
popular
content

Problem
U={ u1,u2,....,um }

I={ i1,i2,....,in }

u1
i1
u2
i2
u3
i3
u4
3

Problem
i1, i2,i3 should be grouped into
cluster based on the interest of
users optimally.
Calculate rating for u1,u2,u3,u4
Find

whether

recommendation

repair is required

DESIGN AND IMPLEMENTATION OF INTEREST


BASED REAL TIME PERSONALIZED SOCIAL
RECOMMENDATION SYSTEM

Through Jaccard Similarity, find


distance between two items
Distance(i,j)=1-JaccardSimilarity(i,j)
=

Ui U j
Ui U j

Assign each item to cluster initially


Based on distance, using k means
clustering algorithm , find k clusters
Perform Interest Group Clustering on
these k clusters

Objective Function
The probability of clustering error

PEu 1 cC wu ,c Support (u , c)
wu,c : Fraction of items of cluster c viewed
by the user u
Support(u, c) : Probability of user belonging to
cluster c
8

Objective Function
Variance is given by

1
2
Var
( PEu
)

| U | 1
|U |
Our objective is to minimize variance and
form the biggest cluster

Input
1.user id, item id,Time spent, Y
value
2.Item id, post time
3. user id, new online time,
previous time
10

Interest Group contains set


of items, set of users and
centre Cg
Centre of an Interest group
is the item with smallest
average distance
All users in the set will like
zero or more item in the set
of item of Interest group
11

4 Distinguishing operation
Mutation
Crossover
Merge
Divide
12

MUTATION
i7
i14
i6
i21

i1

i2

i13
Cg=i3
Mutation
i12
i17

i23

i9

i20

i11

i10
i5

i8
i4

i15
i19

i16

i25
i24

i18

i22

13

MUTATION
i7
i14
i6
i21

i1

i13

i2
Cg=i3

i12
i17

i23

i9

i20

i11

i10
i5

i8
i4

i15
i19

i16

i25
i24

i18

i22

14

CROSSOVER
i14

i1

i13
i21

c=i6

i12
i17

i23
i22

i7

i20

i25

i8

i10
i2

i4

i3
i11

C=i9
i5

i24

i15

i19

i16

i18

15

CROSSOVER
i14

i7

i13
i21

c=i6

i12
i17

i23
i22

i1

i20

i25

i8

i10
i2

i4

i3
i11

c=i9
i5

i24

i15

i19

i16

i18

16

MERGE
i7 i14
i13
i12
i21
i20

c=i6
i17
i23

i22

i1

i25

i8

i10
i2

i4

i3
i11

c=i9
i5

i24

i15

i19

i16

i18

17

MERGE
i7 i14
i13
i12
i21
i20

i6
i23

i22

i1
i17

i10

i25

i8

i2

i4

c=i3
i11

i9
i5

i24

i15

i19

i16

i18

18

DIVIDE
i7 i14

i10

i13
i12
i21
i20

i6
i23

i22

i17
i5

i11

i2

i1

i4

c= i3 i9
i19

i25

i8

i24

i15

i16

i18

19

DIVIDE
i7 i14

i10

i13
i12
i21
i20

i6
i23

i22

i2

i1
i17
i5

i11

i8
i4

c= i3 i9
i19

i25

C=i24

i15

i16

i18

20

Algorithm 6: InterestGroupCluster()
Require: several clusters as the output of k means clustering
1. Initialise all clusters into a set C
2. smallest_obj=0
3. do
4.
for i=1 to Csize-1 where Csize is size of C
5.
for j=i+1 to Csize
6.
Initialise C' to null
7.
add Cto C'
8.
remove ith group and jth group from C'
9.
Initialise union to null
10.
add ith and jth group to union
11.
add union to C'
12.
if Objective(C')< Objective(C)
13.
C*=C'
14.
smallest_obj= Objective(C')
15.
end if
16.
end for
17.
end for
18.
if smallest_obj > Objective(C')
19.
C=C*
20.
end if
21. while smallest_obj Objective(C)

21

Algorithm 6: InterestGroupCluster()
22. round=0
23. for round < CONSTANT
24.

C'= Randomly do either crossover(C) or merge(C) or Divide(C)

25.

if Objective(C')< Objective(C)

26.

C=C'

27.

end if

28.

if C doesnot change for 10 rounds

29.
30.

C=Mutation(C)
end if

31. round++
32. end for
33. Return C as the biggest cluster with minimum variance
22

Real Time
recommendations
Issues
1.False negatives
2.Real time neighbor
selection
3.Different levels of Interest
23

Algorithm 7: Neighbor Select(C,item)


Require: set of interest group C, post time of item, users latest time t1 and previous time t2
1.
Map item with post time
2.
Map user with t2-t1
3.
for all users u
4.
for all items i
5.
if Y(u,i) 0
6.
CMu,i=1
7.
else
8.
if t2-t1 of user u < 1800000
9.
F1=1
10.
end if
11.
else
12.
F1=0
13.
end else
14.
if post time < t1
15.
F2=1
16.
end if
17.
else
18.
F2=0
19.
end else
16.
Cmu,i=F1*F2
17.
end else
18.
end for
19. end for

24

Algorithm 7: Neighbor Select(C,item)


20. for all user u
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.
37.
38.
39.
40.

for each interest group g in C


for all items i in g
if Cmu,i=1
Gmg,u=1
end if
end for
end for
end for
i=interest group of item
for all user u
NBitem,u=CMu,item*GMTu,i
Map column id of CM with list of row indexes with non-zero entry in updated CM
if li null where li is list corresponding to index of i
for each u in li do
if NBitem,u 1
NBitem,u=GMi,u
end if
end for
end if
Return NBitem

25

Neighbor Selection(item)
1.Create a hashmap for user
context matrix with item index as
key and list of users liked as
value
2.Obtain the index c of interest
group with the item
3.Take list with c as key
4.If list is not empty, for all users
check NB[i][u]=1,
if not NB[i][u]=GM[c][u]

26

User Time
Adaption
if 0t 5

time _ weight (u , i )
if 1t >5(t )u
if u2 posts/comments
on i

if t 0.5 * t avg (u ),2 * t avg (u )

0
where

(t ) u

t t avg (u )

2 | t t (u ) |
avg

otherwise

27

Pr ecision(u , g )

| Iu I g |
| Ig |

Re call (u, g )

| Iu I g |
| Iu |

(1 ) Pr ecision(u , g ) Re call (u , g )
weightage(u , g )
Pr ecision(u , g ) Re call (u , g )

Final _ weight (u , i ) time _ weight (u , i ) * weight (u , g )

28

Algorithm 3: Real Time


Recommender
Input:new item;
1.Run neighbour selection
algorithm for the new item and
get the neighbours
2.update new item rating within
24hr

29

3.update neighbour list


4.if neighbour list is not empty find the
distance of the item with centre of all interest
groups
5.select interest group with the small
distance
6.for each of users in neighbour list,Final
weight is added
7.Remove users from neighbour list if user
doesnt like item
8.calculate local rating for the item
I trustworth
9.Calculate
global
rating
for
eachy _ user
user
Trusts (user , trustworthy _ user )
I user users
10.For a specific user findI trustworth
trusty _ user
worthy
and determine trust values

30

11. Calculate weightage


n

weightage

Trust (user , trustworthy _ user )


j

j 1

Maximum _ Rating * n

12. Calculate user approval and disapproval

User _ approval avg _ like _ rating * weightage


User _ dissapprov al avg _ dislike _ rating * weightage

13. If User_disapproval> user_approval ,then


recommendation repair is required.
31

Result
No. of items

No. of clusters with objective in terms of


probability

No. of clusters with objective in terms of


variance

160

20

26

400

45

55

800

96

119

1200

140

175

1600

216

265

32

Result
Cluster distribution

300
250
200
150
No. of clusters
100
50
0

200

400

600

800

1000

1200

1400

1600

1800

No. of items

No. of clusters with objective in terms of probability


No. of clusters with objective in terms of variance

33

Thank You

34

Вам также может понравиться