Python中做线性回归分析

Python中做线性回归分析
建模的流程大三步:数据清理处理,模型选择,检验,下面以线性回归为例:1、导入数据:import matplotlib.pyplot as pltimport numpy as npfrom sklearn import datasets,linear_modeldiabetes=datasets.load_diabetes() #加……继续阅读 »

Haran 8年前 (2016-09-23) 8148浏览 0评论3个赞

Python中做聚类分析

Python中做聚类分析
数据集 ex14.csv 是关于中国各个省份的三项指标数值。请根据这些指标数值,将各个省份分为3类,并尝试归纳出各个类别的特点查看数据图形分布:# coding=utf-8import osimport pandas as pdfrom sklearn.cluster import AgglomerativeClusteringfr……继续阅读 »

Haran 8年前 (2016-09-07) 10336浏览 0评论7个赞

Python中做分类分析(KNN,Bayes,DecisionTree,SVM)

Python中做分类分析(KNN,Bayes,DecisionTree,SVM)

Warning: preg_replace(): Compilation failed: missing closing parenthesis at offset 59 in /www/wwwroot/ichdata/wp-content/themes/git/include/seo.php on line 109

Warning: preg_replace(): Compilation failed: missing closing parenthesis at offset 49 in /www/wwwroot/ichdata/wp-content/themes/git/include/seo.php on line 110

Warning: preg_replace(): Compilation failed: missing closing parenthesis at offset 59 in /www/wwwroot/ichdata/wp-content/themes/git/include/seo.php on line 111

Warning: preg_replace(): Compilation failed: unmatched closing parenthesis at offset 19 in /www/wwwroot/ichdata/wp-content/themes/git/include/seo.php on line 109

Warning: preg_replace(): Compilation failed: unmatched closing parenthesis at offset 16 in /www/wwwroot/ichdata/wp-content/themes/git/include/seo.php on line 110

Warning: preg_replace(): Compilation failed: unmatched closing parenthesis at offset 19 in /www/wwwroot/ichdata/wp-content/themes/git/include/seo.php on line 111
……继续阅读 »

Haran 8年前 (2016-08-28) 5745浏览 0评论2个赞

Python中做广义线性模型

Python中做广义线性模型
data2 是关于重伤病人的一些基本资料。自变量X是病人的住院天数,因变量Y是病人出院后长期恢复的预后指数,指数数值越大表示预后结局越好。尝试对数据拟合合适的线性或非线性模型过程:1、通过散点图可以判断可能可以使用的模型有:线性回归,对数,指数和冥指数回归# -*- coding: utf-8 -*-import pandas as pdfr……继续阅读 »

Haran 8年前 (2016-08-10) 6655浏览 0评论0个赞

Python中做logistic回归模型

Python中做logistic回归模型
data1 是40名癌症病人的一些生存资料,其中,X1表示生活行动能力评分(1~100),X2表示病人的年龄,X3表示由诊断到直入研究时间(月);X4表示肿瘤类型,X5把ISO两种疗法(“1”是常规,“0”是试验新疗法);Y表示病人生存时间(“0”表示生存时间小于200天,“1”表示生存时间大于或等于200天)试建立Y关于X1~X5的logistic回归模……继续阅读 »

Haran 8年前 (2016-06-10) 7255浏览 0评论0个赞