当前位置: 首页 > news >正文

免费的网站开发工具网站挂标 怎么做

免费的网站开发工具,网站挂标 怎么做,手机网站定制 杭州,怎么才能把网站优化做好今日的示例代码包含2个部分 notebook文件夹内的ipynb文件,介绍下今天的思路项目文件夹中其他部分:拆分后的信贷项目,学习下如何拆分的,未来你看到的很多大项目都是类似的拆分方法 知识点回顾 规范的文件命名规范的文件夹管理机器学…

今日的示例代码包含2个部分

  1. notebook文件夹内的ipynb文件,介绍下今天的思路
  2. 项目文件夹中其他部分:拆分后的信贷项目,学习下如何拆分的,未来你看到的很多大项目都是类似的拆分方法

知识点回顾

  1. 规范的文件命名
  2. 规范的文件夹管理
  3. 机器学习项目的拆分
  4. 编码格式和类型注解

作业:尝试针对之前的心脏病项目ipynb,将他按照今天的示例项目整理成规范的形式,思考下哪些部分可以未来复用。

import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns from sklearn.ensemble import RandomForestClassifier from sklearn.tree import DecisionTreeClassifierfrom sklearn.tree import export_graphviz from sklearn.metrics import roc_curve, auc 
from sklearn.metrics import classification_report from sklearn.metrics import confusion_matrix from sklearn.model_selection import train_test_split np.random.seed(123) 
pd.options.mode.chained_assignment = None  %matplotlib inline
sns.set(palette = 'pastel', rc = {"figure.figsize": (10,5), "axes.titlesize" : 14,    "axes.labelsize" : 12,    "xtick.labelsize" : 10,   "ytick.labelsize" : 10 }) 
a = sns.countplot(x = 'target', data = dt)              
a.set_title('Distribution of Presence of Heart Disease') 
a.set_xticklabels(['Absent', 'Present'])                 
plt.xlabel("Presence of Heart Disease")                  plt.show()
g = sns.countplot(x = 'age', data = dt) 
g.set_title('Distribution of Age')      
plt.xlabel('Age')                       
b = sns.countplot(x = 'target', data = dt, hue = 'sex')         
plt.legend(['Female', 'Male'])                                    
b.set_title('Distribution of Presence of Heart Disease by Sex')   
b.set_xticklabels(['Absent', 'Present'])plt.show()
sns.distplot(dt['chol'].dropna(), kde=True, color='darkblue', bins=40)
dt['sex'][dt['sex'] == 0] = 'female'
dt['sex'][dt['sex'] == 1] = 'male'dt['chest_pain_type'][dt['chest_pain_type'] == 1] = 'typical angina'
dt['chest_pain_type'][dt['chest_pain_type'] == 2] = 'atypical angina'
dt['chest_pain_type'][dt['chest_pain_type'] == 3] = 'non-anginal pain'
dt['chest_pain_type'][dt['chest_pain_type'] == 4] = 'asymptomatic'dt['fasting_blood_sugar'][dt['fasting_blood_sugar'] == 0] = 'lower than 120mg/ml'
dt['fasting_blood_sugar'][dt['fasting_blood_sugar'] == 1] = 'greater than 120mg/ml'dt['rest_ecg'][dt['rest_ecg'] == 0] = 'normal'
dt['rest_ecg'][dt['rest_ecg'] == 1] = 'ST-T wave abnormality'
dt['rest_ecg'][dt['rest_ecg'] == 2] = 'left ventricular hypertrophy'dt['exercise_induced_angina'][dt['exercise_induced_angina'] == 0] = 'no'
dt['exercise_induced_angina'][dt['exercise_induced_angina'] == 1] = 'yes'dt['st_slope'][dt['st_slope'] == 1] = 'upsloping'
dt['st_slope'][dt['st_slope'] == 2] = 'flat'
dt['st_slope'][dt['st_slope'] == 3] = 'downsloping'dt['thalassemia'][dt['thalassemia'] == 1] = 'normal'
dt['thalassemia'][dt['thalassemia'] == 2] = 'fixed defect'
dt['thalassemia'][dt['thalassemia'] == 3] = 'reversable defect'
model = RandomForestClassifier(max_depth=5, n_estimators=10)    
model.fit(X_train, y_train)                                     
y_predict = model.predict(X_test)
y_pred_quant = model.predict_proba(X_test)[:, 1]
y_pred_bin = model.predict(X_test)
total=sum(sum(confusion_matrix))sensitivity = confusion_matrix[0,0]/(confusion_matrix[0,0]+confusion_matrix[1,0])
print('灵敏度 : ', sensitivity )specificity = confusion_matrix[1,1]/(confusion_matrix[1,1]+confusion_matrix[0,1])
print('特异度 : ', specificity)

 

http://www.dtcms.com/a/580203.html

相关文章:

  • 科技工作室网站模板网站建设都需要什么资料
  • 农业科技公司网站建设网站缺点
  • 俄罗斯国际空间站微信卖水果链接网站怎么做的
  • 怎么建立一个网站开展业务直播开放平台是什么意思
  • 怎么样黑进网站后台网页美工设计书本
  • 做威士忌的网站做蛋糕视频教学网站
  • 企业网站推广费用绍兴网站建设哪家好
  • 建网站新科网站建设建网站多少
  • 外贸网站建站平台cms做门户网站
  • 西安建公司网站卖货平台有哪些
  • 网站开发开账务处理电子产品网站建设策划方案
  • 不懂英文怎么做英文的seo网站wordpress 商业版权
  • 重庆网站建设营销七牛图床 wordpress
  • 福州网站建设 找燕狂徒 05品牌设计师需要具备什么能力
  • 网站seo链接购买广告网络营销策略
  • 建设高端网站中森网站建设公司
  • 网站开发税收标准中小型互联网企业有哪些
  • 爱网站查询做公司企业网站
  • 贵州城乡建设厅施工员报名网站地方做什么网站
  • 查询网站服务器地址logo设计网站国外
  • 怎么注册自己网站吗网站设计要求
  • 专做教育网站拿站东莞网络网站建设
  • 怎么看别人网站是哪里做的怎么开发自己的商城
  • 高新区免费网站建设广告发布需要许可证吗
  • 网站备案前置审批表格前端做网站要会什么
  • 做任务拿赏金的网站东莞网站建设时间
  • 赤峰市宁城县住房和建设局网站中小企业网络设计与实现
  • 汽车配件生产企业网站模板江苏通力建设官方网站
  • 花钱制作网站有什么好处免费高清大图网站
  • 赣州做公司网站金融网站开发文档下载