Downloads · 30 days
0
nahyun05/bio_app
bio_app is a machine learning model from nahyun05. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
import streamlit as st import pandas as pd import matplotlib.pyplot as plt import seaborn as sns import numpy as np from matplotlib.patches import Ellipse
Downloads · 30 days
0
Access
Public
Updated Apr 12, 2026
Repo size
—
Likes
0
Public
Click a slice to open those files.
.md2.1 KB · 58%
From the Hugging Face model README
import streamlit as st import pandas as pd import matplotlib.pyplot as plt import seaborn as sns import numpy as np from matplotlib.patches import Ellipse
plt.rc('font', family='DejaVu Sans')
st.set_page_config(page_title="뇌 노화 예측 시뮬레이터", layout="wide") st.title("🧠 뇌 노화 및 다중 질환 예측 시뮬레이터")
st.sidebar.header("환자 설정") current_age = st.sidebar.number_input("현재 연령", 40, 90, 60) snp_score = st.sidebar.slider("유전자 활성도", 0, 200, 120) target_age = st.sidebar.slider("미래 시뮬레이션 연령", current_age, 100, 60)
ad_risk = min(99.0, (target_age * 0.6) + (snp_score * 0.15) - 20) pd_risk = min(99.0, 15 + (target_age - 73) * 8.5 + (snp_score * 0.1)) if target_age >= 73 else min(15.0, target_age * 0.1) normal_prob = max(1.0, 100.0 - max(ad_risk, pd_risk))
col1, col2 = st.columns(2)
with col1: st.subheader("📊 질환별 발병 위험도") df = pd.DataFrame({'질환': ['Normal', 'AD', 'PD'], '위험도(%)': [normal_prob, ad_risk, pd_risk]}) fig, ax = plt.subplots() sns.barplot(x='위험도(%)', y='질환', data=df, ax=ax, palette='viridis') st.pyplot(fig)
with col2: st.subheader("🧠 뇌 병변 시뮬레이션") fig_brain, ax_brain = plt.subplots() ax_brain.add_patch(Ellipse((5, 5), 8, 6, color='lightgray', alpha=0.5)) # 병변 시각화 (위험도에 따라 커지는 원) ax_brain.scatter([6], [6], s=ad_risk20, c='red', alpha=0.5, label='AD Lesion') if target_age >= 73: ax_brain.scatter([4], [4], s=pd_risk30, c='purple', alpha=0.7, label='PD Lesion') ax_brain.set_xlim(0, 10); ax_brain.set_ylim(0, 10); ax_brain.axis('off') st.pyplot(fig_brain)
if target_age >= 73: st.error(f"🚨 {target_age}세 기점 파킨슨 위험 급증!")