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

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


输出结果

数据集展示

输出结果

1、k-NN

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

#

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

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

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

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

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

8、NN

利用多层神经网络

NN:Data standardization—Accuracy on training set: 0.823
NN:Data standardization—Accuracy on test set: 0.802
NN:Data standardization(max_iter=1000)—Accuracy on training set: 0.877
NN:Data standardization(max_iter=1000)—Accuracy on test set: 0.755
NN:Data standardization(max_iter=1000,alpha=1)—Accuracy on training set: 0.795
NN:Data standardization(max_iter=1000,alpha=1)—Accuracy on test set: 0.792

设计思路

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

(0)

相关推荐