Skip to content
Permalink
main
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
function [] = plot_important_feature(dirstring, females, beh_type,...
vars, c)
% This function plots the results of the Pareto analysis.
load(strcat(dirstring, '/', beh_type,'people2.mat'))
data = load(strcat(dirstring, '/', beh_type,'STDs.mat'),'STDs')
data = data.STDs;
categories = ["Weather", "Moon", "Allergen", "Sleep", "BM", "Menses"];
C = colororder;
color_data = zeros(length(vars),3);
st = 0;
for k=1:length(categories)
for i=1:length(vars)
if startsWith(vars(i), categories(k))
st = st + 1;
color_data(st,:) = C(k,:);
end
end
end
above_value = 4
above_2 = data > above_value;
[m, IA, IB] = intersect(eligible_people, females)
above_2_female = data(IA,end) > above_value
sums = sum(above_2, 1);
sums(end) = sum(above_2_female);
[B, I] = sort(sums,'descend')
set(0,'DefaultTextInterpreter','none')
set(gca,'TickLabelInterpreter','none')
sums_over = sums / size(data,1);
sums_over(end) = sums(end) / length(IA); % menses standardized to number of females
FigH = figure('Position', get(0, 'Screensize'));
b = bar(sums_over,'FaceColor','none','EdgeColor','flat','LineWidth',2);
b.CData = color_data;
hold on;
text(length(sums), sums_over(end)+0.1, '*','FontSize',30,'HorizontalAlignment', 'center');
ax = gca;
ax.FontSize = 20;
ax.YLim = [0 1];
title(strcat(beh_type, " Feature Importance Plot"),'FontSize',20)
xticks(1:16)
xticklabels(vars);
xtickangle(45)
ylabel(strcat("% w/ Feature Type Important (> ", string(above_value), ")"))
set(0,'DefaultTextInterpreter','none')
set(gca,'TickLabelInterpreter','none')
fig = 0;
set( findall(fig, '-property', 'fontname'), 'fontname', 'Palatino Linotype')
saveas(FigH, strcat(dirstring,'/',beh_type,c,'_pareto_features.png'),'png');
end