Skip to content

Commit

Permalink
Minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
sarabsethi committed Aug 18, 2016
1 parent fba3026 commit c5ec326
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 484 deletions.
4 changes: 2 additions & 2 deletions SS_Clustering_main.m
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
SS_SetupRunOptions;

% Load your data matrix then normalise and filter it
SS_NormaliseAndFilter;
%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
Expand All @@ -24,7 +24,7 @@
SS_CorrOpsWithClusters;

% Output final clusters to a text file
SS_OutputBestOpsTxtFile;
SS_IdentifyBestOps;

% Cluster the time series in the reduced operation space to visualise
% effectiveness of selected operations
Expand Down
5 changes: 3 additions & 2 deletions SS_CorrOpsWithClusters.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@

kmedoidsClusters = km(kIdx);

allClusters = cluster_Groupi{1};
allClusters = cluster_Groupi;

fprintf('Calculating correlations of operations to their linkage clustered centres\n');

for i = 1:length(allClusters)
% Within linkage clusters take the mean of members to find cluster centre
cluster = cell2mat(allClusters(i));
Expand All @@ -33,7 +34,7 @@
linkageClusters(i).memDists = memDists;
end

save(strcat('linkage_clusters_with_member_corrs.mat'),'linkageClusters',...
save('linkage_clusters_with_member_corrs.mat','linkageClusters',...
'kmedoidsClusters');
end

3 changes: 2 additions & 1 deletion SS_IdentifyBestOps → SS_IdentifyBestOps.m
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,12 @@

kmCentreOps = Operations(kmedoidsClusters.CCi(kmedCentres));
kmCentreNames = {kmCentreOps.Name};
kmCentreKeys = {kmCentreOps.Keywords};

% Print all centres associated with cluster
fprintf(fID,'CLUSTER %i: ',i);
for j = 1:length(kmCentreNames)
fprintf(fID,'%s , ',kmCentreNames{j});
fprintf(fID,'%s (%s), ',kmCentreNames{j},kmCentreKeys{j});
end
fprintf(fID,'\n');

Expand Down
5 changes: 2 additions & 3 deletions SS_LinkageClusterOps.m
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
load('clusters_kmedoids.mat');
load('resid_variance.mat');


kmed = km(kIdx);

% Find best operations
Expand All @@ -17,8 +16,8 @@
% Cluster linkages using a cutoff value for minimum inter-cluster distance
[distMat_cl,cluster_Groupi,ord] = BF_ClusterDown(distVec,...
'clusterThreshold',corr_dist_threshold,'whatDistance','general',...
'linkageMeth','complete');
colormap(BF_getcmap('redyellowgreen',10));
'linkageMeth','average');
colormap(BF_getcmap('redyellowblue',10));

fprintf(['Linkage clustering reduced %i operations to %i groups using '...
'a distance threshold of %.2f \n'],...
Expand Down
4 changes: 2 additions & 2 deletions SS_SetupRunOptions.m
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ function SS_SetupRunInfo( ks , kToUse , op_km_repeats , ts_km_repeats , ...
inMatFileName , outTxtFileName , corr_dist_threshold , av_ts_cluster_size)

if ~exist('ks','var')
ks = [5042];
ks = [30];
end
if ~exist('kToUse','var')
kToUse = 5042;
kToUse = 30;
end
if ~exist('op_km_repeats','var')
op_km_repeats = 10;
Expand Down
Loading

0 comments on commit c5ec326

Please sign in to comment.