Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@ cycler==0.10.0
docx2txt==0.8
joblib==0.14.1
kiwisolver==1.2.0
matplotlib==3.1.0
numpy==1.18.4
pandas==1.0.3
matplotlib
numpy
pandas
pdfminer==20191125
Pillow==9.0.1
pycryptodome==3.9.7
pyEDFlib==0.1.17
pyparsing==2.4.7
python-dateutil==2.8.1
pytz==2020.1
scikit-learn==0.22.2.post1
scipy==1.4.1
scikit-learn
scipy
seaborn==0.10.1
six==1.14.0
sklearn==0.0
sklearn
108 changes: 106 additions & 2 deletions source/analysis/analysis_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def figures_mc_sleep_wake():
classifiers = utils.get_classifiers()

feature_sets = utils.get_base_feature_sets()
trial_count = 20
trial_count = 21

for attributed_classifier in classifiers:
if Constants.VERBOSE:
Expand Down Expand Up @@ -181,9 +181,113 @@ def figures_compare_time_based_features():
CurvePlotBuilder.combine_plots_as_grid(classifiers, trial_count, '_time_only_sw_roc')


def figures_train_health_test_disordered():
classifiers = utils.get_classifiers()

feature_sets = utils.get_base_feature_sets()

for attributed_classifier in classifiers:
if Constants.VERBOSE:
print('Running ' + attributed_classifier.name + '...')
classifier_summary = SleepWakeClassifierSummaryBuilder.build_train_healthy_test_disordered(attributed_classifier, feature_sets)

CurvePlotBuilder.make_roc_sw(classifier_summary)
CurvePlotBuilder.make_pr_sw(classifier_summary)
TableBuilder.print_table_sw(classifier_summary)

CurvePlotBuilder.combine_plots_as_grid(classifiers, 1, '_sw_pr')
CurvePlotBuilder.combine_plots_as_grid(classifiers, 1, '_sw_roc')


def figures_mc_sleep_wake_disordered():
classifiers = utils.get_classifiers()

feature_sets = utils.get_base_feature_sets()
trial_count = 20

for attributed_classifier in classifiers:
if Constants.VERBOSE:
print('Running ' + attributed_classifier.name + '...')
classifier_summary = \
SleepWakeClassifierSummaryBuilder.build_monte_carlo_disordered(
attributed_classifier, feature_sets, trial_count)

CurvePlotBuilder.make_roc_sw(classifier_summary)
CurvePlotBuilder.make_pr_sw(classifier_summary)
TableBuilder.print_table_sw(classifier_summary)

CurvePlotBuilder.combine_plots_as_grid(classifiers, trial_count, '_sw_pr')
CurvePlotBuilder.combine_plots_as_grid(classifiers, trial_count, '_sw_roc')

def figures_mc_train_apnea_test_narcolepsy():
classifiers = utils.get_classifiers()

feature_sets = utils.get_base_feature_sets()

for attributed_classifier in classifiers:
if Constants.VERBOSE:
print('Running ' + attributed_classifier.name + '...')
classifier_summary = \
SleepWakeClassifierSummaryBuilder.build_train_apnea_test_narcolepsy(
attributed_classifier, feature_sets)

CurvePlotBuilder.make_roc_sw(classifier_summary)
CurvePlotBuilder.make_pr_sw(classifier_summary)
TableBuilder.print_table_sw(classifier_summary)

CurvePlotBuilder.combine_plots_as_grid(classifiers, trial_count, '_sw_pr')
CurvePlotBuilder.combine_plots_as_grid(classifiers, trial_count, '_sw_roc')

def figures_mc_sleep_wake_disordered_apnea_only():
classifiers = utils.get_classifiers()

feature_sets = utils.get_base_feature_sets()
trial_count = 22

for attributed_classifier in classifiers:
if Constants.VERBOSE:
print('Running ' + attributed_classifier.name + '...')
classifier_summary = \
SleepWakeClassifierSummaryBuilder.build_monte_carlo_apnea_only(
attributed_classifier, feature_sets, trial_count)

CurvePlotBuilder.make_roc_sw(classifier_summary)
CurvePlotBuilder.make_pr_sw(classifier_summary)
TableBuilder.print_table_sw(classifier_summary)

CurvePlotBuilder.combine_plots_as_grid(classifiers, trial_count, '_sw_pr')
CurvePlotBuilder.combine_plots_as_grid(classifiers, trial_count, '_sw_roc')

def figures_mc_disordered_and_healthy_together():
classifiers = utils.get_classifiers()
feature_sets = utils.get_base_feature_sets()
trial_count = 23

for attributed_classifier in classifiers:
if Constants.VERBOSE:
print('Running ' + attributed_classifier.name + '...')
classifier_summary = \
SleepWakeClassifierSummaryBuilder.build_monte_carlo_everyone(
attributed_classifier, feature_sets, trial_count)

CurvePlotBuilder.make_roc_sw(classifier_summary)
CurvePlotBuilder.make_pr_sw(classifier_summary)
TableBuilder.print_table_sw(classifier_summary)

CurvePlotBuilder.combine_plots_as_grid(classifiers, trial_count, '_sw_pr')
CurvePlotBuilder.combine_plots_as_grid(classifiers, trial_count, '_sw_roc')


if __name__ == "__main__":
start_time = time.time()
figure_leave_one_out_roc_and_pr()
# figures_mc_train_apnea_test_narcolepsy()
# figures_train_health_test_disordered()
# figures_mc_sleep_wake_disordered_apnea_only()
# figures_mc_sleep_wake_disordered()
figures_mc_sleep_wake()
# figures_mc_disordered_and_healthy_together()

# figure_leave_one_out_roc_and_pr()
#
# figures_mc_sleep_wake()
# figures_mc_three_class()
Expand Down
Loading