- #1
Minaxi
- 1
- 0
Hi all,
I am having database of 963 users .
Records of two users are
uid gender occupation age
1 F student 23
2 M teacher 30
Now i need to calculate the similarity of each user with every other as
sim(ui,uj)=0.8*sim(age) + 0.1*sim(gender) + 0.1*sim(occupation)
where sim(age)=1-[(Ai-Aj)/(agemax-agemin)];
agemax is the maximum age and agemin is minimum age of user.
sim(gender)=1 if G1=G2 else 0
sim(occup)=1 if occupation is same .
Kindly tell me the code fir it so that i can get a matrix of similarities.(963*963)
I am having database of 963 users .
Records of two users are
uid gender occupation age
1 F student 23
2 M teacher 30
Now i need to calculate the similarity of each user with every other as
sim(ui,uj)=0.8*sim(age) + 0.1*sim(gender) + 0.1*sim(occupation)
where sim(age)=1-[(Ai-Aj)/(agemax-agemin)];
agemax is the maximum age and agemin is minimum age of user.
sim(gender)=1 if G1=G2 else 0
sim(occup)=1 if occupation is same .
Kindly tell me the code fir it so that i can get a matrix of similarities.(963*963)