diff --git a/mvpa/cosmo_pca.m b/mvpa/cosmo_map_pca.m similarity index 92% rename from mvpa/cosmo_pca.m rename to mvpa/cosmo_map_pca.m index a7b2ff5e..bf2f178e 100644 --- a/mvpa/cosmo_pca.m +++ b/mvpa/cosmo_map_pca.m @@ -1,27 +1,27 @@ -function [ds, pca_params]=cosmo_pca(ds, varargin) +function [ds, pca_params]=cosmo_map_pca(ds, varargin) % normalize dataset either by estimating or applying estimated parameters % -% [ds, pca_params]=cosmo_pca(ds[, pca_params, pca_explained_count, -% pca_explained_ratio]) +% [ds, pca_params]=cosmo_map_pca(ds[, pca_params, pca_explained_count, +% pca_explained_ratio]) % % Inputs % ds a dataset struct with field .samples of size PxQ, or a % numeric array of that size -% pca_params previously estimated pca parameters using the -% 'pca_params' output result from a previous call to this +% pca_params previously estimated pca parameters using the +% 'pca_params' output result from a previous call to this % function -% pca_explained_count retain only the first 'pca_explained_count' +% pca_explained_count retain only the first 'pca_explained_count' % components -% pca_explained_ratio retain the first components that explain +% pca_explained_ratio retain the first components that explain % 'pca_explained_ratio' percent of the variance (value % between 0 and 1, where 1 retains all components) % % Output % ds a dataset struct similar to ds, but with .samples data % transformed using pca. -% params estimated parameters for pca. These can be re-used for a -% second pca step of an independent dataset. For example, -% parameters can be estimated from a training dataset and +% params estimated parameters for pca. These can be re-used for a +% second pca step of an independent dataset. For example, +% parameters can be estimated from a training dataset and % then applied to a testing dataset % % # For CoSMoMVPA's copyright information and license terms, # @@ -32,7 +32,7 @@ apply_params = isfield(opt,'pca_params'); pca_explained_count = isfield(opt,'pca_explained_count'); pca_explained_ratio = isfield(opt,'pca_explained_ratio'); - + %they are mutually exclusive if sum([apply_params,pca_explained_count,pca_explained_ratio])>1 error(['apply_params, pca_explained_count, pca_explained_ratio '... @@ -84,7 +84,7 @@ elseif pca_explained_ratio>1 error('pca_explained_ratio should not be greater than 1'); end - %retain the first components that explain the amount of variance + %retain the first components that explain the amount of variance pca_params.pca_explained_ratio=pca_explained_ratio; retain=cumsum(explained)<=pca_explained_ratio*100; else