How can I use the MovieLens Dataset in matlab

3 vues (au cours des 30 derniers jours)
fadams18
fadams18 le 3 Nov 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

Réponses (0)

Catégories

En savoir plus sur Statistics and Machine Learning Toolbox dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by