How can I use the MovieLens Dataset in matlab

1 view (last 30 days)
I want to use the MovieLens dataset for my NMF algorithm for matrix completion.
I have a function which i use to sample data into observed and index of the observed entries.
The problem is, the dataset i download looks weird, it has files like, u.data, u.item, u.ratings. How can i preprocess this to have a single Matrix in oder to use my function below
function [Idx, Omega] = subsampling(data, obs)
if(nargin < 1 || nargin > 2)
error('data must be defined');
end
if(nargin == 1)
obs = 0.5; % 50% of observed values (default)
end
nae = numel(double(data));
rp = randperm(nae)';
k = floor(obs*nae);
Idx = rp(1:k);
Omega = zeros(size(data));
Omega(Idx) = 1;
end

Answers (0)

Categories

Find more on Statistics and Machine Learning Toolbox in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!