How can I use the MovieLens Dataset in matlab

3 visualizaciones (últimos 30 días)
fadams18
fadams18 el 3 de Nov. de 2020
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

Respuestas (0)

Categorías

Más información sobre Statistics and Machine Learning Toolbox en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by