import os
import pandas as pd
import seaborn as sns
from hbn.constants import Defaults
from hbn.visualization import visualize
import warnings
"ignore")
warnings.filterwarnings(
%load_ext autoreload
%autoreload 2
%matplotlib inline
# pio.renderers.default = 'iframe'
import ipywidgets as widgets # interactive display
%config InlineBackend.figure_format = 'svg' # other available formats are: 'retina', 'png', 'jpeg', 'pdf'
Child Measures - Language Tasks
# load model data
= os.path.join(Defaults.MODEL_DIR, '2022-11-24_22:47:54.716119')
MODEL_DIR
= pd.read_csv(os.path.join(MODEL_DIR, 'classifier-all-phenotypic-models-performance.csv'))
df_classify 'data'] = df_classify['data'].map({'model-data': 'null', 'model-null': 'data'})
df_classify[= pd.read_csv(os.path.join(MODEL_DIR, 'classifier-feature_importance.csv')) df_feature
# set plotting style
visualize.plotting_style()
# Child Measures - Language Tasks
= df_classify[(df_classify['target']=='DX_01_Cat_binarize') &
df1 'assessment']=='Child Measures') &
(df_classify['domains']=='Language Tasks')]
(df_classify[
=df1) visualize.predictive_modeling(df
Parent Measures - Demographics
= ['Affective Reactivity Index-Parent',
measures 'Autism Spectrum Screening Questionnaire',
'Barratt Simplified Measure of Social Status',
'Child Behavior Checklist', 'Child Mind Institute Symptom Checker',
'Demographics',
'Extended Strengths and Weaknesses Assessment of Normal Behavior-Parent Report',
'Financial Support Questionnaire',
'Inventory of Callous-Unemotional Traits – Parent Report']
= df_classify[(df_classify['target']=='DX_01_Cat_binarize') &
df1 'assessment']=='Parent Measures') &
(df_classify['domains']=='Demographic Questionnaire Measures')]
(df_classify[
= df1[df1['measures'].isin(measures)]
df1 =df1) visualize.predictive_modeling(df
Parent Measures - Demographics
= ['Mood and Feelings Questionnaire', 'Repetitive Behavior Scale',
measures 'Screen for Child Anxiety Related Disorders - Parent report',
'Social Aptitudes Scale', 'Social Communication Questionnaire',
'Social Responsiveness Scale-2',
'Strengths and Difficulties Questionnaire (with impact supplement)',
'Strengths and Weaknesses Assessment of ADHD and Normal Behavior',
'The Columbia Impairment Scale-Parent Report Version',
'WHO Disability Assessment Schedule – Parent Report']
= df_classify[(df_classify['target']=='DX_01_Cat_binarize') &
df1 'assessment']=='Parent Measures') &
(df_classify['domains']=='Demographic Questionnaire Measures')]
(df_classify[
= df1[df1['measures'].isin(measures)]
df1 =df1) visualize.predictive_modeling(df
Parent Measures - Interview of Emotional and Psychological Function
= df_classify[(df_classify['target']=='DX_01_Cat_binarize') &
df1 'assessment']=='Parent Measures') &
(df_classify['domains']=='Interview of Emotional and Psychological Function')]
(df_classify[
=df1) visualize.predictive_modeling(df
Child Measures - Cognitive Testing
= df_classify[(df_classify['target']=='DX_01_Cat_binarize') &
df1 'assessment']=='Child Measures') &
(df_classify['domains']=='Cognitive Testing')]
(df_classify[
=df1) visualize.predictive_modeling(df
Child Measures - Questionnaire_Measures_of_Emotional_and_Cognitive_Status
= df_classify[(df_classify['target']=='DX_01_Cat_binarize') &
df1 'assessment']=='Child Measures') &
(df_classify['domains']=='Questionnaire Measures of Emotional and Cognitive Status')]
(df_classify[
=df1) visualize.predictive_modeling(df
Child Measures : all other domains
= df_classify[(df_classify['target']=='DX_01_Cat_binarize') &
df1 'assessment']=='Child Measures')]
(df_classify[
= ['Physical Fitness and Status', 'Neurologic Function', 'Physiologic Function', 'Vision', 'Motor Skills']
cols
= df1[df1['domains'].isin(cols)]
df1
=df1) visualize.predictive_modeling(df
#import plotly.express as px
# interactive visualization of features
#@widgets.interact(
# feature=df_feature['features'].unique(),
# )
#def visualize_features(feature):
# df = df_feature[df_feature['features']==feature]
# fig = px.line(df, x='feature_names_sum', y='feature_sum', markers=True, title=feature)
# fig.update_xaxes(showticklabels=False)
# fig.update_xaxes(type='category')
# fig.show()