[tengzhenzhen15@lu01 gpor]$ for ((i=0; i<=19; i++)) do ./gpor -S 0.4 X4058_300_gpor/mytask_train.$((i)); done
[yuanhao15@lu01 gpor]$ ./svorex -P 1 -F 1 -Z 0 -Co 10 ../svorim/X4058_300_im/mytask_train.0 [tengzhenzhen15@lu01 gpor]$ ./gpor -S 0.4 X4058_300_gpor/mytask_train.0
% load pyrim % NumTrain = 50; % load machine %NumTrain = 150; % load housing % NumTrain = 300; % load abalone % NumTrain = 1000; % load bank32nh % NumTrain = 3000; % load cpuact % NumTrain = 4000; % load calhousing % NumTrain = 5000; % load census % NumTrain = 6000; load X4058 NumTrainforScaling = [300,400] ; % name='X4058_300_im' name='X4058_300_gpor' i=1; % path= 'C:\Users\hd\Desktop\' path= 'G:\'; NumTrain = NumTrainforScaling(i); % X0=[X,y]; % n0 = size(X0,2); % X0 = sortrows(X0,n0); % X = X0(:,1:end-1); % y = X0(:,end); for k = 1:20 n = size(X,1); NumTest = n - NumTrain; id = id0(k,:); traindata = X(id(1:NumTrain),:); targets = y(id(1:NumTrain)); TestData = X(id(NumTrain+1:n),:); TestTargets = y(id(NumTrain+1:n)); X1=[traindata,targets]; n0 = size(X1,2); X1 = sortrows(X1,n0); fname1 = strcat(path,name,'\mytask_train.',num2str(k-1)); fname2 = strcat(path,name,'\mytask_test.',num2str(k-1)); fname3 = strcat(path,name,'\mytask_targets.',num2str(k-1)); % libsvmwrite(fname1, targets, sparse(traindata)); % libsvmwrite(fname2, TestTargets, sparse(TestData)); fname4 = strcat('E:\MATLAB\R2015a\bin\ADMM\CalOutData\mytask_targets.',num2str(k-1)); save(fname1,'X1','-ascii') save(fname2,'TestData','-ascii') save(fname3,'TestTargets','-ascii') save(fname4,'TestTargets','-ascii') end % load calhousing % NumTrainforScaling = [300,400] ; % % i=1; % NumTrain = NumTrainforScaling(i); % for k=1:20 % k=i; % % for k = 1:10 % n = size(X,1); % NumTest = n - NumTrain; % % id = randperm(n); % id = id0(k,:); % traindata = X(id(1:NumTrain),:); % targets = y(id(1:NumTrain)); % TestData = X(id(NumTrain+1:n),:); % TestTargets = y(id(NumTrain+1:n)); % % % X1=[traindata,targets]; % % % fname1 = strcat('C:\Users\hd\Desktop\machine\mytask_train.',num2str(k-1)); % % fname2 = strcat('C:\Users\hd\Desktop\machine\mytask_test.',num2str(k-1)); % % % fname1 = strcat('C:\Users\hd\Desktop\housing\mytask_train.',num2str(k-1)); % % fname2 = strcat('C:\Users\hd\Desktop\housing\mytask_test.',num2str(k-1)); % % % fname1 = strcat('C:\Users\hd\Desktop\abalone\mytask_train.',num2str(k-1)); % % fname2 = strcat('C:\Users\hd\Desktop\abalone\mytask_test.',num2str(k-1)); % % % fname1 = strcat('C:\Users\hd\Desktop\bank32nh\mytask_train.',num2str(k-1)); % % fname2 = strcat('C:\Users\hd\Desktop\bank32nh\mytask_test.',num2str(k-1)); % % % fname1 = strcat('C:\Users\hd\Desktop\cpuact\mytask_train.',num2str(k-1)); % % fname2 = strcat('C:\Users\hd\Desktop\cpuact\mytask_test.',num2str(k-1)); % % % fname1 = strcat('C:\Users\hd\Desktop\calhousing\mytask_train.',num2str(k-1)); % % fname2 = strcat('C:\Users\hd\Desktop\calhousing\mytask_test.',num2str(k-1)); % % % fname1 = strcat('C:\Users\hd\Desktop\census\mytask_train.',num2str(k-1)); % % fname2 = strcat('C:\Users\hd\Desktop\census\mytask_test.',num2str(k-1)); % % fname1 = strcat('C:\Users\hd\Desktop\',name,'\mytask_train.',num2str(k-1)); % fname2 = strcat('C:\Users\hd\Desktop\',name,'\mytask_test.',num2str(k-1)); % libsvmwrite(fname1, targets, sparse(traindata)); % libsvmwrite(fname2, TestTargets, sparse(TestData)); % % % % save(fname1,'X1','-ascii') % % save(fname2,'TestData','-ascii') % % save(fname3,'TestTargets','-ascii') % % % libsvmwrite(fname1, targets, sparse(traindata)); % % libsvmwrite(fname2, TestTargets, sparse(TestData));
clear Acc=[]; AbsAcc=[]; for k =1:20 fname1 = strcat('E:\MATLAB\R2015a\bin\ADMM\CalOutData\mytask_targets.',num2str(k-1)); % fname2 = strcat('E:\MATLAB\R2015a\bin\ADMM\CalOutData\output_file.',num2str(k-1)); fname2 = strcat('E:\MATLAB\R2015a\bin\ADMM\CalOutData\mytask_cguess.',num2str(k-1)); PredYi=textread(fname1); Yi=textread(fname2); D=PredYi-Yi; TrueD = D; TrueD(abs(TrueD)>0,1)=1; Error(k) = mean(TrueD); AbsErr(k) = mean(abs(D)); end
[tengzhenzhen15@lu01 gpor]$ for ((i=0; i<=19; i++)) do ./gpor -S 0.4 pyrim/mytask_train.$((i)); done [tengzhenzhen15@lu01 gpor]$ for ((i=0; i<=19; i++)) do ./gpor machine/mytask_train.$((i)); done [tengzhenzhen15@lu01 gpor]$ for ((i=0; i<=19; i++)) do ./gpor housing/mytask_train.$((i)); done