基于神经网络rnn模型心脏病特征预测心脏病

预备准备:

import tensorflow        as tf
 
gpus = tf.config.list_physical_devices("GPU")
 
if gpus:
    gpu0 = gpus[0]                                        #如果有多个GPU,仅使用第0个GPU
    tf.config.experimental.set_memory_growth(gpu0, True)  #设置GPU显存用量按需使用
    tf.config.set_visible_devices([gpu0],"GPU")
    
gpus

数据准备:

数据介绍:

数据介绍:

age:1) 年龄
sex:2) 性别
cp:3) 胸痛类型 (4 values)
trestbps:4) 静息血压
chol:5) 血清胆甾醇 (mg/dl
fbs:6) 空腹血糖 > 120 mg/dl
restecg:7) 静息心电图结果 (值 0,1 ,2)
thalach:8) 达到的最大心率
exang:9) 运动诱发的心绞痛
oldpeak:10)  相对于静止状态,运动引起的ST段压低
slope:11) 运动峰值 ST 段的斜率
ca:12) 荧光透视着色的主要血管数量 (0-3)
thal:13) 0 = 正常;1 = 固定缺陷;2 = 可逆转的缺陷
target:14) 0 = 心脏病发作的几率较小 1 = 心脏病发作的几率更大
import pandas as
经验分享 程序员 微信小程序 职场和发展