Skip to content

Commit

Permalink
Global running parameter file added along with setup function
Browse files Browse the repository at this point in the history
  • Loading branch information
sarabsethi committed Aug 12, 2016
1 parent 40fe53d commit fc412c1
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 7 deletions.
13 changes: 6 additions & 7 deletions SS_Clustering_main.m
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
% If your code hangs in SS_NormaliseAndFilter remove '-append' from save
% command on line 150 in TS_local_clear_remove

% Load your data matrix then normalise and filter it
SS_NormaliseAndFilter('HCTSA_Empirical1000_Aug2015');
% Set up default run info file
SS_SetupRunInfo;

% % If you have filtered normalised data already
% load('HCTSA_Empirical1000_Aug2015_N_filtered.mat');
% save('HCTSA_N.mat');
% Load your data matrix then normalise and filter it
SS_NormaliseAndFilter;

% Enter values of K you want to calculate
% NB: The largest value of K will automatically be used for the linkage clustering etc
SS_ClusterKMedoids([3,5,10,20]);
SS_ClusterKMedoids;

% Calculates residual variance for above clusters
SS_ResidVariance;
Expand All @@ -25,7 +24,7 @@
SS_CorrOpsWithClusters;

% Output final clusters to a text file
SS_OutputBestOpsTxtFile('cluster_info.txt');
SS_OutputBestOpsTxtFile;

% Cluster the time series in the reduced operation space to visualise
% effectiveness of selected operations
Expand Down
37 changes: 37 additions & 0 deletions SS_SetupRunInfo.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
function SS_SetupRunInfo( ks , kToUse , op_km_repeats , ts_km_repeats , ...
inMatFileName , outTxtFileName , corr_dist_threshold)

if nargin < 1
ks = [5,7,10,20:20:100,200,500,1000];
end
if nargin < 2
kToUse = 40;
end
if nargin < 3
op_km_repeats = 50;
end
if nargin < 4
ts_km_repeats = 500;
end
if nargin < 5
inMatFileName = 'HCTSA_new_data';
end
if nargin < 6
outTxtFileName = 'cluster_info.txt';
end
if nargin < 7
corr_dist_threshold = 0.2;
end

kIdx = find(ks == kToUse);
if isempty(kIdx)
fprintf('Could not find K = %i in ks - setting kToUse to %i',...
kToUse , ks(length(ks)));
kIdx = length(ks);
end

save('run_options.mat','ks','kIdx','op_km_repeats','ts_km_repeats',...
'inMatFileName','outTxtFileName','corr_dist_threshold');

end

0 comments on commit fc412c1

Please sign in to comment.