Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package octave-forge-nan for openSUSE:Factory checked in at 2021-09-22 22:12:56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/octave-forge-nan (Old) and /work/SRC/openSUSE:Factory/.octave-forge-nan.new.1899 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "octave-forge-nan" Wed Sep 22 22:12:56 2021 rev:13 rq:920809 version:3.6.0 Changes: -------- --- /work/SRC/openSUSE:Factory/octave-forge-nan/octave-forge-nan.changes 2021-03-17 20:20:04.859327858 +0100 +++ /work/SRC/openSUSE:Factory/.octave-forge-nan.new.1899/octave-forge-nan.changes 2021-09-22 22:13:12.780335786 +0200 @@ -1,0 +2,6 @@ +Wed Sep 15 09:14:52 UTC 2021 - Atri Bhattacharya <badshah...@gmail.com> + +- Update to version 3.6.0: + * corrplot, knnsearch <NEW>. + +------------------------------------------------------------------- Old: ---- nan-3.5.3.tar.gz New: ---- nan-3.6.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ octave-forge-nan.spec ++++++ --- /var/tmp/diff_new_pack.0I1fIS/_old 2021-09-22 22:13:13.348336258 +0200 +++ /var/tmp/diff_new_pack.0I1fIS/_new 2021-09-22 22:13:13.352336261 +0200 @@ -1,5 +1,5 @@ # -# spec file for package octave-forge-nan +# spec file # # Copyright (c) 2021 SUSE LLC # @@ -18,7 +18,7 @@ %define octpkg nan Name: octave-forge-%{octpkg} -Version: 3.5.3 +Version: 3.6.0 Release: 0 Summary: A statistics and machine learning toolbox License: GPL-3.0-or-later ++++++ nan-3.5.3.tar.gz -> nan-3.6.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nan-3.5.3/DESCRIPTION new/nan-3.6.0/DESCRIPTION --- old/nan-3.5.3/DESCRIPTION 2021-02-15 07:41:05.000000000 +0100 +++ new/nan-3.6.0/DESCRIPTION 2021-07-26 16:19:19.000000000 +0200 @@ -1,6 +1,6 @@ Name: NaN -Version: 3.5.3 -Date: 2021-02-15 +Version: 3.6.0 +Date: 2021-07-26 Author: Alois Schl??gl <alois.schlo...@gmail.com> Maintainer: Alois Schl??gl Title: The NaN-toolbox diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nan-3.5.3/INDEX new/nan-3.6.0/INDEX --- old/nan-3.5.3/INDEX 2021-02-15 07:41:05.000000000 +0100 +++ new/nan-3.6.0/INDEX 2021-07-26 16:19:19.000000000 +0200 @@ -14,7 +14,7 @@ histo2 histo3 histo4 kolmogorov_smirnov kstest2 roc kappa load_cifar100 load_cifar10 load_mnist fishers_exact_test betapdf betacdf betainv - gini lmom + gini lmom corrplot knnsearch diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nan-3.5.3/NEWS new/nan-3.6.0/NEWS --- old/nan-3.5.3/NEWS 2021-02-15 07:41:05.000000000 +0100 +++ new/nan-3.6.0/NEWS 2021-07-26 16:19:19.000000000 +0200 @@ -1,3 +1,8 @@ +2021-07-26: Release of NaN-toolbox 3.6.0 + +* corrplot, knnsearch <NEW> + + 2021-02-15: Release of NaN-toolbox 3.5.3 * kappa: Youden index (YI), and SSE as return value diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nan-3.5.3/inst/betacdf.m new/nan-3.6.0/inst/betacdf.m --- old/nan-3.5.3/inst/betacdf.m 2021-02-15 07:41:05.000000000 +0100 +++ new/nan-3.6.0/inst/betacdf.m 2021-07-26 16:19:19.000000000 +0200 @@ -31,13 +31,23 @@ end if (~ isscalar (a) || ~ isscalar (b)) - [retval, x, a, b] = common_size (x, a, b); + % [retval, x, a, b] = common_size (x, a, b); + retval = ~isscalar(a) && any(size(x)~=size(a)); + retval = retval || (~isscalar(b) && any(size(x)~=size(b))); + if (retval > 0) error ('betacdf: X, A, and B must be of common size or scalars'); end end + if isscalar(a) + a = repmat(a,size(x)); + end + if isscalar(b) + b = repmat(b,size(x)); + end + - if (iscomplex (x) || iscomplex (a) || iscomplex (b)) + if (~isreal (x) || ~isreal (a) || ~isreal (b)) error ('betacdf: X, A, and B must not be complex'); end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nan-3.5.3/inst/betainv.m new/nan-3.6.0/inst/betainv.m --- old/nan-3.5.3/inst/betainv.m 2021-02-15 07:41:05.000000000 +0100 +++ new/nan-3.6.0/inst/betainv.m 2021-07-26 16:19:19.000000000 +0200 @@ -32,14 +32,22 @@ print_usage (); end - if (! isscalar (a) || ~isscalar (b)) - [retval, x, a, b] = common_size (x, a, b); + if (~isscalar (a) || ~isscalar (b)) + retval = ~isscalar(a) && any(size(x)~=size(a)); + retval = retval || (~isscalar(b) && any(size(x)~=size(b))); + if (retval > 0) error ('betainv: X, A, and B must be of common size or scalars'); end end + if isscalar(a) + a = repmat(a,size(x)); + end + if isscalar(b) + b = repmat(b,size(x)); + end - if (iscomplex (x) || iscomplex (a) || iscomplex (b)) + if (~isreal (x) || ~isreal (a) || ~isreal (b)) error ('betainv: X, A, and B must not be complex'); end @@ -57,7 +65,7 @@ k = find ((x > 0) & (x < 1) & (a > 0) & (b > 0)); if (~ isempty (k)) - if (~ isscalar (a) || ~ isscalar (b)) + if (~isscalar (a) || ~isscalar (b)) a = a(k); b = b(k); y = a ./ (a + b); @@ -83,7 +91,7 @@ y_new = y; loopcnt = 0; - do + while (1), y_old = y_new; h = (betacdf (y_old, a, b) - x) ./ betapdf (y_old, a, b); y_new = y_old - h; @@ -96,12 +104,13 @@ y_new(ind) = 1 - (1 - y_old(ind)) / 10; end h = y_old - y_new; - until (max (abs (h)) < sqrt (myeps) || ++loopcnt == 40) + loopcnt = loopcnt+1; + if ( (max(abs(h)) < sqrt(myeps)) || (loopcnt >= 40)) break; end + end if (loopcnt == 40) warning ('betainv: calculation failed to converge for some values'); end - inv(k) = y_new; end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nan-3.5.3/inst/betapdf.m new/nan-3.6.0/inst/betapdf.m --- old/nan-3.5.3/inst/betapdf.m 2021-02-15 07:41:05.000000000 +0100 +++ new/nan-3.6.0/inst/betapdf.m 2021-07-26 16:19:19.000000000 +0200 @@ -33,13 +33,23 @@ end if (~ isscalar (a) || ~ isscalar (b)) - [retval, x, a, b] = common_size (x, a, b); + % [retval, x, a, b] = common_size (x, a, b); + retval = ~isscalar(a) && any(size(x)~=size(a)); + retval = retval || (~isscalar(b) && any(size(x)~=size(b))); + if (retval > 0) error ('betapdf: X, A, and B must be of common size or scalars'); end end + if isscalar(a) + a = repmat(a,size(x)); + end + if isscalar(b) + b = repmat(b,size(x)); + end + - if (iscomplex (x) || iscomplex (a) || iscomplex (b)) + if (~isreal (x) || ~isreal (a) || ~isreal (b)) error ('betapdf: X, A, and B must not be complex'); end @@ -53,14 +63,10 @@ pdf(k) = NaN; k = (x > 0) & (x < 1) & (a > 0) & (b > 0) & ((a ~= 1) | (b ~= 1)); - if (isscalar (a) && isscalar (b)) - pdf(k) = exp ((a - 1) * log (x(k)) - + (b - 1) * log (1 - x(k)) - + gammaln (a + b) - gammaln (a) - gammaln (b)); + if (isscalar (a) && isscalar (b)), + pdf(k) = exp ((a - 1) * log (x(k)) + (b - 1) * log (1 - x(k)) + gammaln (a + b) - gammaln (a) - gammaln (b)); else - pdf(k) = exp ((a(k) - 1) .* log (x(k)) - + (b(k) - 1) .* log (1 - x(k)) - + gammaln (a(k) + b(k)) - gammaln (a(k)) - gammaln (b(k))); + pdf(k) = exp ((a(k) - 1) .* log (x(k)) + (b(k) - 1) .* log (1 - x(k)) + gammaln (a(k) + b(k)) - gammaln (a(k)) - gammaln (b(k))); end %% Most important special cases when the density is finite. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nan-3.5.3/inst/corrplot.m new/nan-3.6.0/inst/corrplot.m --- old/nan-3.5.3/inst/corrplot.m 1970-01-01 01:00:00.000000000 +0100 +++ new/nan-3.6.0/inst/corrplot.m 2021-07-26 16:19:19.000000000 +0200 @@ -0,0 +1,58 @@ +function RES = corrplot(data, varargin) +% CORRPLOT displays the correlation plot +% +% corrplot(data) +% corrplot(data,'type',TYPE) +% [R,PValue,H] = corrplot(data,Name,Value) +% +% Input: +% data +% TYPE: 'Pearson' (default), 'Kendall', 'Spearman' +% +% +% Copyright (C) 2021 by Alois Schloegl <alois.schlo...@gmail.com> +% This function is part of the NaN-toolbox +% http://pub.ist.ac.at/~schloegl/matlab/NaN/ + +% This program is free software; you can redistribute it and/or +% modify it under the terms of the GNU General Public License +% as published by the Free Software Foundation; either version 3 +% of the License, or (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. + +Mode=[]; +alpha=0.05; + +k=1; +while k<=nargin, + if strcmpi(varargin{k},'type') + Mode=varargin{k+1}; + k=k+1; + elseif strcmpi(varargin{k},'alpha') + alpha=varargin{k+1}; + + end + + k=k+1; +end + +[nr,nc]=size(data); + +for k1=1:nc +for k2=1:nc + subplot(nc,nc,k1*nc+k2-nc) + plot(data(:,k1),data(:,k2),'d') +end +end + +R = corrcoef(data); + + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nan-3.5.3/inst/knnsearch.m new/nan-3.6.0/inst/knnsearch.m --- old/nan-3.5.3/inst/knnsearch.m 1970-01-01 01:00:00.000000000 +0100 +++ new/nan-3.6.0/inst/knnsearch.m 2021-07-26 16:19:19.000000000 +0200 @@ -0,0 +1,166 @@ +function [idx, dist]=knnsearch(X,Y,varargin) +% KNNSEARCH search for K nearest neighbors +% and related statistics +% +% Usage: +% IDX = knnsearch(X,Y); +% finds for each element (row) in Y, the nearest +% of all elements in X, such that +% IDX(k) points to X(IDX(k),:) that is nearest to Y(k,:) +% IDX has as many elements as Y has rows +% [IDX,DIST] = knnsearch(X,Y); +% ... = knnsearch(...,'k',k); +% search for k nearest neighbors (default: k=2) +% ... = knnsearch(...,'Scale',Scale); +% Scaling vector of 'seuclidian' metric +% default value is std(X) +% ... = knnsearch(...,'Cov',Cov); +% Cov is the covariance matrix used for Mahalanobis distance +% default value is cov(X) +% ... = knnsearch(...,'Distance',Distance); +% the following distance metrics are currently supported: +% 'euclidean' [1], +% 'seuclidean', (scaled euclidian) +% 'minkowski' [3], +% 'cityblock' or 'manhattan' [4], +% 'hamming' [5], +% 'mahalanobis' [6], +% 'cosine' [7] +% (one minus the cosine of the angle between the two samples), +% 'correlation' +% (one minus the linear correlation between each pair f data vectors), +% 'spearman' +% (one minus the rank correlation between each pair of data vectors), +% +% SEE ALSO: corrcoef, spearman, rankcorr, cov, std +% +% Reference(s): +% [1] https://en.wikipedia.org/wiki/K-nearest_neighbors_algorithm +% [2] https://en.wikipedia.org/wiki/Euclidean_distance +% [3] https://en.wikipedia.org/wiki/Minkowski_distance +% [4] https://en.wikipedia.org/wiki/Taxicab_geometry +% [5] https://en.wikipedia.org/wiki/Hamming_distance +% [6] https://en.wikipedia.org/wiki/Mahalanobis_distance +% [7] https://en.wikipedia.org/wiki/Cosine_similarity + +% Copyright (C) 2021 by Alois Schloegl <alois.schlo...@gmail.com> +% This function is part of the NaN-toolbox +% http://pub.ist.ac.at/~schloegl/matlab/NaN/ +% +% BioSig is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% BioSig is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with BioSig. If not, see <http://www.gnu.org/licenses/>. + + +if nargin<2 + error('missing input arguments') +end + +if size(X,2)~=size(Y,2) + error('number of rows in X and Y must match') +end + +% default values +K=1; # number of NN +P=2; # exponent for minkowski distance +Distance='euclidean'; +NSMethod='exhaustive'; +Scale = []; +Cov = []; + +k=1; +while (k<length(varargin)) + if strcmpi(varargin{k},'k') + K = varargin{k+1}; + k=k+2; + continue; + elseif strcmp(varargin{k},'P') + P = varargin{k+1}; + k=k+2; + continue; + elseif strcmp(varargin{k},'Scale') + Scale = varargin{k+1}; + if (length(Scale)~=size(X,2)) + error('size of Cov does not match input data'); + end + k=k+2; + continue; + elseif strcmp(varargin{k},'Cov') + Cov = varargin{k+1}; + if ~all(size(Cov)==size(X,2)) + error('size of Cov does not match input data'); + end + k=k+2; + continue; + elseif strcmpi(varargin{k},'Distance') + Distance = varargin{k+1}; + k=k+2; + continue; + elseif strcmpi(varargin{k},'NSMethod') + NSMethod = varargin{k+1}; + k=k+2; + continue; + else + disp(varargin{k}); + fprintf(1,'Warning: input argument is ignored'); + end + k=k+1; +end + +[ix,iy]=meshgrid(1:size(X,1),1:size(Y,1)); +if strcmp(Distance,'euclidean') + D = sqrt(sum((X(ix(:),:)-Y(iy(:),:)).^2,2)); + +elseif strcmp(Distance,'seuclidean') + if isempty(Scale), Scale=std(X,[],1); end; + IS = Scale(:).^(-2); + dxy = X(ix(:),:) - Y(iy(:),:); + D = sqrt((dxy.^2)*IS); + +elseif strcmp(Distance,'mahalanobis') + if isempty(Cov), Cov=cov(X(~any(isnan(X),2),:)); end; + dxy = X(ix(:),:)-Y(iy(:),:); + D = sqrt( sum( (dxy*inv(Cov)).*dxy, 2) ); + +elseif strcmp(Distance,'minkowski') + D = sum(abs(X(ix(:),:)-Y(iy(:),:)).^P,2).^(1/P); + +elseif strcmp(Distance,'cityblock') || strcmp(Distance,'manhattan') + D = sum(abs(X(ix(:),:)-Y(iy(:),:)),2); + +elseif strcmp(Distance,'cosine') + sx = sum(X.^2, 2).^(-1/2); + sy = sum(Y.^2, 2).^(-1/2); + D = 1 - sum(X(ix(:),:).*Y(iy(:),:), 2).*sx(ix(:)).*sy(iy(:)); + +elseif strcmp(Distance,'correlation') + D = 1 - corrcoef(Y', X'); + +elseif strcmp(Distance,'spearman') + D = 1 - corrcoef(Y', X', 'Rank'); + +elseif strcmp(Distance,'hamming') + D = mean(abs(X(ix(:),:)~=Y(iy(:),:)),2); + +elseif 0, % add more +else + error(sprintf('distance metric "%s" not supported yet',Distance)); +end + +D = reshape(D,size(Y,1),size(X,1)); +if K==1, + [dist,idx]=min(D,[],2); +else + [dist,idx]=sort(D,2); + dist=dist(:,1:K); + idx=idx(:,1:K); +end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nan-3.5.3/inst/naninsttest.m new/nan-3.6.0/inst/naninsttest.m --- old/nan-3.5.3/inst/naninsttest.m 2021-02-15 07:41:05.000000000 +0100 +++ new/nan-3.6.0/inst/naninsttest.m 2021-07-26 16:19:19.000000000 +0200 @@ -22,9 +22,9 @@ % along with this program; If not, see <http://www.gnu.org/licenses/>. -r = zeros(38,2); +r = zeros(42,2); -x = [5,NaN,0,1,nan]; +x = [5,NaN,0,1,nan,-1:.4:1]; % run test, k=1: with NaNs, k=2: all NaN's are removed % the result of both should be the same. @@ -32,7 +32,7 @@ %FLAG_WARNING = warning; warning('off'); -funlist = {'sumskipnan','mean','std','var','skewness','kurtosis','sem','median','mad','zscore','coefficient_of_variation','geomean','harmmean','meansq','moment','rms','','corrcoef','rankcorr','spearman','ranks','center','trimean','min','max','tpdf','tcdf','tinv','normpdf','normcdf','norminv','nansum','nanstd','histo_mex','sumskipnan_mex','covm_mex','svmtrain_mex','train','','','','','','','',''}; +funlist = {'sumskipnan','mean','std','var','skewness','kurtosis','sem','median','mad','zscore','coefficient_of_variation','geomean','harmmean','meansq','moment','rms','','corrcoef','rankcorr','spearman','ranks','center','trimean','min','max','tpdf','tcdf','tinv','normpdf','normcdf','norminv','nansum','nanstd','histo_mex','sumskipnan_mex','covm_mex','svmtrain_mex','train','ttest','betapdf','betacdf','betainv','','','',''}; for k=1:2, if k==2, x(isnan(x))=[]; end; r(1,k) =sumskipnan(x(1)); @@ -147,6 +147,16 @@ if exist('ttest','file'), r(39,k)=ttest([x,x,x],10); end; + + if exist('betapdf','file'), + r(40,k)=sum(~isnan(betapdf([x,x,x],10,5))); + end; + if exist('betacdf','file'), + r(41,k)=sum(~isnan(betapdf([x,x,x],10,5))); + end; + if exist('betainv','file'), + r(42,k)=sum(~isnan(betainv([x,x,x],10,5))); + end; end; % check if result is correct