Skip to content

Commit

Permalink
MSC: rename cosmo_pca -> cosmo_map_pca
Browse files Browse the repository at this point in the history
  • Loading branch information
nno committed Aug 31, 2016
1 parent bcdcc0a commit f83544a
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions mvpa/cosmo_pca.m → 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, #
Expand All @@ -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 '...
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit f83544a

Please sign in to comment.