
#1
Nov1912, 01:43 PM

P: 1

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[(AiAj)/(agemaxagemin)]; 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) 



#2
Nov2212, 01:12 PM

P: 1,200

the data import depends on the form of your database, but assuming you can do this and obtain a 4by963 cell array, you can do this using a pair of for loops, eg.




#3
Dec512, 03:47 AM

P: 46

Hi, if I were you I'd encode all attributes as integers, so that all records can be stored as rows in a matrix of type int. I'll assume that you've done this, and your database is a matrix "db" of size [numusers 4]. I'll let you work out the details of that. First, let me give names to the columns:



Register to reply 
Related Discussions  
Nation of Tool Users? ( ex. Matlab)  Career Guidance  2  
calculating e, using matlab (how to get answer in double type)  Engineering, Comp Sci, & Technology Homework  1  
MATLAB code (calculating displacement)  Math & Science Software  7  
Calculating FT using matlab quad function  General Math  1  
Calculating variance matlab discrepancy  Math & Science Software  0 