import itertools as it
from harness import AppNotebookHarness, create_subplots
text_cells = False
harness = AppNotebookHarness()
analyzer = harness.get_analyzer()
24 hour events, addendum, history hospital: this is what patient's time in hospital--their story asses and plan, and hosptial course are more overview of treatment plan
sec_comb = 0
analyzer = harness.get_analyzer(
plot_components=3,
outlier_proportion=0.001,
calc_per_section=False,
tfidf_threshold = 0.000001,
tfidf_sections = set({0: 'past-medical-history past-surgical-history',
1: 'past-surgical-history',
2: 'past-medical-history',
6: 'code-status assessment-and-plan',
7: 'wet-read indication',
8: 'medication-history past-medical-history',
9: 'disposition labs-imaging',
10: 'impression image-type',
11: 'findings image-type',
12: 'chief-complaint discharge-condition',
13: 'patient-test-information procedure',
14: 'flowsheet-data-vitals indication',
15: '24-hour-events patient-test-information',
16: 'clinical-implications code-status',
17: 'infusions last-dose-of-antibiotics other-medications',
18: 'flowsheet-data-vitals infusions last-dose-of-antibiotics',
19: 'clinical-implications infusions last-dose-of-antibiotics',
20: 'clinical-implications contrast last-dose-of-antibiotics',
21: 'clinical-implications disposition patient-test-information',
22: 'facility image-type indication',
23: 'clinical-implications image-type indication',
24: 'flowsheet-data-vitals indication infusions',
}[sec_comb].split()))
#analyzer.set_tfidf_section_by_index(-1)
#analyzer.dim_reduction_meth = 'svd'
#analyzer.height = 800
if 1:
# analyzer.normalize = 'unit'
# analyzer.normalize = 'standardize'
analyzer.axis_range = 2.7
else:
analyzer.plot_type = 'rand'
analyzer.axis_range = 200
analyzer.tfidf_sections = {'past-medical-history'}
analyzer.section_plot_3d()
for dr in analyzer.dim_reducers:
dr.write()
dim: 3 reduction_meth: pca normalize: None model_args: description: components: 3 explained_varainces: 0.15547815062157622 0.0437924327973983 0.034508676123682136 noise: 0.03109838247584281 total_variance: 0.23377925954265666 n_points: 3713
analyzer = harness.get_analyzer(
plot_type='age'
#normalize = True
)
analyzer.section_plot_3d()
import itertools as it
from harness import AppNotebookHarness, create_subplots
text_cells = False
harness = AppNotebookHarness()
analyzer = harness.get_analyzer(
dim_reduction_meth = 'tsne',
tfidf_threshold = 0.1,
outlier_significance=0.3,
# normalize='unit',
)
#analyzer.tfidf_sections = {'labs-imaging', 'past-surgical-history', 'physical-examination'}
#analyzer.tfidf_sections = {'past-medical-history', 'past-surgical-history'}
analyzer.section_plot_3d()
analyzer = harness.get_analyzer(
plot_type='shared',
tfidf_threshold = 0.1,
outlier_significance=0.1,
)
analyzer.section_plot_3d()