How to use LLSimpute in MatLab

3 views (last 30 days)
Daniel
Daniel on 11 Oct 2011
Answered: yaya wu on 31 Jul 2018
I was trying to use the LLSimpute software ( http://www.cc.gatech.edu/~hpark/softwareMVE.html) in MATLAB. But got difficulties with lots of MATLAB's complain. It worked fine with the example data given with this software. I removed (in my data) the column and row names and changed missing values as requested in the program. Copied my data in the same directory where these LLSimpute programs are. Then, even tried to convert the csv file into a .mat file and trying to execute the first program,'main missing value code'(mpute_llsq_l2.m) like
E=impute_llsq_l2(0,1);
  • Even after renaming my new matrix with missing values with the same file name as in the training data, miss0.mat.
  • After loading the data ('load miss0.mat') i changed 'data' in the workspace of MATLAB into 'miss_matrix' - as this is needed by the program,mpute_llsq_l2.m.
But i am still getting an error message like the following
>> E=impute_llsq_l2(0,1);
??? Undefined function or method 'eq' for input arguments of type 'struct'.
Error in ==> impute_llsq_l2 at 69
if (f_rowaverage==1) | (m-length(find(miss_matrix==big))) < 400
I am new to MATLAB, can anyone please help me how I can use this LLSimpute software, impute_llsq_l2.m, to impute my missing data which is in csv file format?
Thank you

Answers (3)

Walter Roberson
Walter Roberson on 11 Oct 2011
Exactly how did you load the data? The complete command?
If you had
miss_matrix = load('miss0.mat');
then miss_matrix would be returned as a structure that had fields whose names were the names of the variables in the .mat file.
You might instead need to
miss_load = load('miss0.mat');
miss_matrix = miss_load.miss_matrix;
  2 Comments
Daniel
Daniel on 14 Oct 2011
Hello Walter,
Thanks for your solution. But here is how I did try to load it and your solution when I apply it in MATLAB.
My way:
load('my_data.csv'); % this loads my data in to the MATLAB % workspace as 'my_data<743*743 double>'
miss_matrix = my_data;
Your way:
miss_load = load('miss0.mat'); % <1*1 struct>
miss_matrix = miss_load.miss_matrix;
??? Reference to non-existent field 'miss_matrix'.
But anyways, I just continued with just the 'miss_matrix' i got and MATLAB was still complaining about other error sources (which were not there when i used the sample data)and i tried to fix them by reading and looking for help from the internet. But finally i got a zero output. i.e an empty matrix!
I suspect that the other parameters like the 'minexp=2;'in line 58 0f 'impute_llsq_l2.m' need to be changed,like '%minexp=n*0.3;' as commented and correspondingly in 'kestimate_12.m'code for the plot in 'plot(xk, nrmse,'k^-'); axis([0 k_max 0 2.0]);'. But even then, I still not getting an output. Help, help, help....pls
Thank you
Daniel
Daniel on 14 Oct 2011
Walter, what was your 'miss_matrix'? Did you assume mine or anything else?

Sign in to comment.


yaya wu
yaya wu on 31 Jul 2018
Hello,do you solve this problem?

yaya wu
yaya wu on 31 Jul 2018
May I know that why can't I open this website" http://www.cc.gatech.edu/~hpark/softwareMVE.html"? Thanks for your reply!

Categories

Find more on Get Started with MATLAB in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!