How can I use the MovieLens Dataset in matlab
1 回表示 (過去 30 日間)
古いコメントを表示
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 件のコメント
回答 (0 件)
参考
カテゴリ
Help Center および File 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!