Classify and count adherence.

Add statsmodels.
communication
junos 2021-06-08 16:40:01 +02:00
parent 7177c8429f
commit de32241d51
2 changed files with 18 additions and 1 deletions

View File

@ -17,4 +17,5 @@ dependencies:
- pytz - pytz
- seaborn - seaborn
- sqlalchemy - sqlalchemy
- statsmodels
- tabulate - tabulate

View File

@ -19,6 +19,8 @@ import sys
import datetime import datetime
import seaborn as sns import seaborn as sns
import pandas as pd import pandas as pd
import statsmodels.api as sm
from statsmodels.formula.api import ols
nb_dir = os.path.split(os.getcwd())[0] nb_dir = os.path.split(os.getcwd())[0]
if nb_dir not in sys.path: if nb_dir not in sys.path:
@ -40,5 +42,19 @@ baseline_inactive = baseline[baseline["Gebruikersnaam"].isin(participants_inacti
# %% # %%
df_esm_inactive = get_esm_data(participants_inactive_usernames) df_esm_inactive = get_esm_data(participants_inactive_usernames)
df_esm_preprocessed = preprocess_esm(df_esm_inactive)
# %%
df_esm_preprocessed = preprocess_esm(df_esm_inactive)
df_session_counts = classify_sessions_adherence(df_esm_preprocessed)
# %%
tbl_session_outcomes = df_session_counts.reset_index()["session_response"].value_counts()
# %%
print("All sessions:", len(df_session_counts))
print("-------------------------------------")
print(tbl_session_outcomes)
print("-------------------------------------")
print(tbl_session_outcomes/len(df_session_counts))
# %%