Closed tachim closed 7 years ago
Hi @tachim , thank you for reporting this issue. I fixed it in the current version of the lrslibrary (committed today). Now you can run the matrix completion algorithms by:
obs = 0.5; % Percentage of observed entries [0...1]
[params.Idx, params.Omega] = subsampling(M, obs);
out = run_algorithm('MC', 'GROUSE', M, params);
where M is your input matrix, params.Idx is a vector of observed indexes and params.Omega is a binary matrix/tensor ('1's represent the observed entries and '0' otherwise). subsampling(.) is a function that performs a random subsampling over M and obs is the percentage of observed entries [0...1]. You can also set manually your own observation matrix by:
params.Omega = randi([0 1],size(M)); % '0's and '1's are generated from a uniform discrete distribution.
out = run_algorithm('MC', 'GROUSE', M, params);
or by:
params.Idx = find(randi([0 1],size(M))); % observed indexes.
out = run_algorithm('MC', 'GROUSE', M, params);
Note that you don't need to set params.Idx and params.Omega at same time. If params.Idx and params.Omega are not defined, the run_algorithm function sets them automatically using subsampling function with obs = 0.5.
Please let me know if it works well for you, Best regards, Andrews
Hey, this is an extremely impressive library in terms of coverage. Can you explain a bit, though, how to use the matrix completion routines? Suppose I have a matrix M that has NaNs where the entries are missing and I want to run PG-RMC:
out = run_algorithm('MC', 'PG-RMC', M, good_idxs);
yieldswhere the NaNs were replaced by 0's and goodIdxs is a boolean matrix corresponding to whether or not an entry was non-NaN in the original matrix.
How is the function supposed to be used?