## View User-based neighborhood approach (public)

- Summary
Method for collaborative-filtering tasks. We base the rating of item for user by checking ratings of users with similar tastes

- License
- CC-BY-SA 3.0
- Tags
- collaborative-filtering neighborhood recommender systems user-based
- Feature Processing
- No feature processing required, however standard outlier removal might be helpful.
- Parameters
- matrix of user/item ratings
- Operating System
- independent
- Code
function X = userbased( y,M,sizeX,swap,sim,neib) % Neighbour based regression algorithm % calculates similarities between users and than rating for i as % r_u(i) = sum_v sim(u,v) * rv(i) / sqrt(sim(u,u) * sim(v,v)

% Output % X - matrix to be estimated % Input % y - sampled entries % M - masking operator, applied to vectorized form of X % sizeX - size of matrix to be reconstructed % swap - switch to ITEM-BASED (default = 0) % sim - similarity measure (0 - PC, 1 - WPC, 2 - cos sim, default = 0) % neib - percentage of neibours taken into sum

% Copyright (c) Lukasz Kidzinski 2011

`Y = reshape(M(y,2),sizeX); if nargin < 4 swap = 0; end if nargin < 5 sim = 0; end if nargin < 6 neib = 0.8; end if swap Y = Y'; end; if (sim < 2) corr = pearsonsim(Y,sim); else corr = cosinesim(Y); end; corr(corr < 0) = 0; rated = Y>0; usedcorr = corr * rated'; X = corr * Y'; X = X ./ usedcorr; X(usedcorr==0) = mean(y); X = X'; if (swap) X = X'; end;`

end

- Software Packages
matlab

- Description
(No information yet)

- URLs
- (No information yet)
- Publications

- revision 1
- by kidzik on 2011-09-13 19:55
- revision 2
- by kidzik on 2011-09-13 20:00
- revision 3
- by kidzik on 2011-09-13 20:08

No one has posted any comments yet. Perhaps you would like to be the first?

### Leave a comment

To post a comment, please sign in.This item was downloaded 0 times and viewed 6218 times.

#### Disclaimer

We are acting in good faith to make datasets submitted for the use of the scientific community available to everybody, but if you are a copyright holder and would like us to remove a dataset please inform us and we will do it as soon as possible.

#### Acknowledgements

This project is supported by PASCAL (Pattern Analysis, Statistical Modelling and Computational Learning)

http://www.pascal-network.org/.