cosmo anova feature selector hdr

function selected_indices=cosmo_anova_feature_selector(dataset, how_many)
% find the features that show the most variance between classes
%
% selected_indices=cosmo_anova_feature_selector(dataset, how_many)
%
% Inputs:
%  dataset          struct with .samples and .sa.targets
%  how_many         value between 0 and 1 keeps how_many*100% features;
%                   values >=1 keeps how_many features
%
% Output:
%  selected_indices   feature ids in dataset with most variance between
%                     classes.
%
% Example:
%     ds=cosmo_synthetic_dataset();
%     disp(size(ds.samples))
%     %|| [ 6 6 ]
%     cosmo_anova_feature_selector(ds,.45) % find best ~45% of features
%     %|| [ 2 4 5 ]
%     cosmo_anova_feature_selector(ds,4) % find best 4 features
%     %|| [ 2 4 5 3 ]
%
% #   For CoSMoMVPA's copyright information and license terms,   #
% #   see the COPYING file distributed with CoSMoMVPA.           #