We're thrilled to feature Miray Ozcan in this edition of the Preswald Community Showcase! π Miray has built a health-focused Preswald app that explores the risk factors associated with strokes, allowing users to interact with real medical data and uncover patterns that influence stroke outcomes.
π Project Overview
π Preswald for Healthcare and Risk Modeling
This blog demonstrates how Preswald can power dashboards that visualize and interpret clinical datasets. Mirayβs app provides stroke risk insights using interactive visualizations that help interpret how lifestyle, demographics, and health conditions relate to risk.
Project Name: Stroke Risk Explorer
Built by: Miray Ozcan
Dataset: Stroke Prediction Dataset
Live App: Stroke Risk Explorer
π Description
Miray's app includes:
-
β€οΈ Interactive charts showing stroke risk by gender, age, and smoking status
-
π§ Visual breakdowns of stroke cases vs comorbidities like hypertension
-
π Sliders to filter users by glucose level, BMI, and heart condition
-
π Correlation plots for early stroke prediction features
Preswald enables seamless development of health informatics dashboards, and Mirayβs app is a powerful example of its application in medical data analysis.
π Code Snippets
Load and Filter Stroke Dataset
from preswald import connect, get_df, text, table
connect()
df = get_df('stroke_data')
text("# Stroke Risk Dashboard")
text("Explore risk factors for strokes using demographic and health attributes.")
table(df.head())
Bar Chart: Stroke Cases by Gender
import plotly.express as px
from preswald import plotly
fig = px.bar(df.groupby('gender')['stroke'].sum().reset_index(),
x='gender', y='stroke',
title='Stroke Cases by Gender')
plotly(fig)
Scatter Plot: Age vs Avg Glucose by Stroke
fig = px.scatter(df, x='age', y='avg_glucose_level', color='stroke',
title='Age vs Glucose Level Colored by Stroke Risk')
plotly(fig)
π Key Insights
-
π§ Older individuals have higher stroke occurrence rates
-
π High glucose levels and hypertension correlate with elevated stroke risk
-
π¬ Smoking status plays a significant role in stroke outcomes
π What is Preswald?
Preswald is an open-source framework for building data apps, dashboards, and internal tools with just Python. It enables developers to turn any analysis script into a shareable app, with UI components like tables, charts, and forms.
Key Features
-
Turn healthcare analytics into real-time visual dashboards
-
Automatic reactivity with slider and dropdown inputs
-
Lightweight sharing and deployment
-
Pre-built chart components and filters
π Getting Started
Installation
pip install preswald
Start a Project
preswald init my_project
cd my_project
preswald run
Deploy
preswald deploy --target structured
Huge Thanks to Miray Ozcan!
A huge thank you to Miray Ozcan for creating a health-empowering dashboard that helps people understand stroke risks better. Connect with Miray here:
Want to Contribute?
Got a cool idea for a Preswald app? We'd love to see it! Get started here: https://github.com/StructuredLabs/preswald and get featured in our next Community Showcase.
Happy building! π