How can I use the MovieLens Dataset in matlab

조회 수: 1 (최근 30일)
fadams18
fadams18 2020년 11월 3일
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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Statistics and Machine Learning Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by