ML之分类预测:基于sklearn库的七八种机器学习算法利用糖尿病(diabetes)数据集(8→1)实现二分类预测(一)

输出结果


数据集展示

ML之分类预测:基于sklearn库的七八种机器学习算法利用糖尿病(diabetes)数据集(8→1)实现二分类预测(一)


ML之分类预测:基于sklearn库的七八种机器学习算法利用糖尿病(diabetes)数据集(8→1)实现二分类预测(一)



输出结果


1、k-NN

ML之分类预测:基于sklearn库的七八种机器学习算法利用糖尿病(diabetes)数据集(8→1)实现二分类预测(一)


k-NN:Accuracy of K-NN classifier on training set: 0.79

k-NN:Accuracy of K-NN classifier on test set: 0.78



2、LoR

ML之分类预测:基于sklearn库的七八种机器学习算法利用糖尿病(diabetes)数据集(8→1)实现二分类预测(一)

#


LoR:C1 Training set accuracy: 0.781

LoR:C1 Test set accuracy: 0.771

LoR:C100 Training set accuracy: 0.785

LoR:C100 Test set accuracy: 0.766

LoR:C001 Training set accuracy: 0.700

LoR:C001 Test set accuracy: 0.703



4、DT


ML之分类预测:基于sklearn库的七八种机器学习算法利用糖尿病(diabetes)数据集(8→1)实现二分类预测(一)

ML之分类预测:基于sklearn库的七八种机器学习算法利用糖尿病(diabetes)数据集(8→1)实现二分类预测(一)

DT:Accuracy on training set: 1.000

DT:Accuracy on test set: 0.714

DT:Accuracy on training set: 0.773

DT:Accuracy on test set: 0.740



5、RF

ML之分类预测:基于sklearn库的七八种机器学习算法利用糖尿病(diabetes)数据集(8→1)实现二分类预测(一)



ML之分类预测:基于sklearn库的七八种机器学习算法利用糖尿病(diabetes)数据集(8→1)实现二分类预测(一)


RF:Accuracy on training set: 1.000

RF:Accuracy on test set: 0.786

RF:max_depth=3 Accuracy on training set: 0.800

RF:max_depth=3 Accuracy on test set: 0.755



6、GB


ML之分类预测:基于sklearn库的七八种机器学习算法利用糖尿病(diabetes)数据集(8→1)实现二分类预测(一)


ML之分类预测:基于sklearn库的七八种机器学习算法利用糖尿病(diabetes)数据集(8→1)实现二分类预测(一)


GB:Accuracy on training set: 0.917

GB:Accuracy on test set: 0.792

GB:Accuracy on training set: 0.804

GB:Accuracy on test set: 0.781

GB:Accuracy on training set: 0.802

GB:Accuracy on test set: 0.776



7、SVM


ML之分类预测:基于sklearn库的七八种机器学习算法利用糖尿病(diabetes)数据集(8→1)实现二分类预测(一)






SVM:Accuracy on training set: 1.00

SVM:Accuracy on test set: 0.65

SVM:MinMaxScaler Accuracy on training set: 0.77

SVM:MinMaxScaler Accuracy on test set: 0.77

SVM:C=500 Accuracy on training set: 0.790

SVM:C=500 Accuracy on test set: 0.792

SVM:C=1000 Accuracy on training set: 0.790

SVM:C=1000 Accuracy on test set: 0.797

SVM:C=2000 Accuracy on training set: 0.800

SVM:C=2000 Accuracy on test set: 0.797








上一篇:TCP/IP协议


下一篇:IO通信之多路复用