Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added script to plot response surfaces #11

Merged
merged 2 commits into from
Apr 10, 2024
Merged

Conversation

Olivier-tl
Copy link
Owner

This PR adds a standalone script to compute physio response surfaces to stimulations for every patients.

Copy link
Collaborator

@elvijs elvijs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!


# Compute 95% confidence intervals
ci = df.groupby([x_col, y_col])[z_col].agg(["mean", "std"]).reset_index()
ci["ci_low"] = ci["mean"] - 1.96 * ci["std"]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: might make sense to expose the confidence interval level as an argument. We might want to use different values in different cases.


patient_to_hr_changes = defaultdict(list)
patient_to_bp_changes = defaultdict(list)
patient_to_respiratory_rate_changes = defaultdict(list)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we should start a discussion with Justin and Man on how we store features back into the dataset. It feels expensive to recompute every time anyone wants to visualise them.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, definitively something we should bring up! I'd say let's formalize the features on the first patient drop first though.

@Olivier-tl Olivier-tl merged commit dc95dce into main Apr 10, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants