在建模阶段处理我的ml项目时,我想首先尝试所有可能的模型,然后选择最好的优化模型。最后,我想我会得到最好的数据库模型,但在此过程中,我发现了一个有趣的结果。
对于多模型培训阶段,为了节省时间,我想使用大约3500行,而在我的整个70692行中,这仅仅是4.9%的数据。最后,当训练结束时,我得到了所有模型的结果:
=================================== Accuracy ===================================
name accuracy
3 Support Vector Machines 0.752571
0 Logistic Regression 0.751429
9 Bagging Classifier 0.746857
1 Random Forest 0.742857
2 LightGBM 0.742857
6 Bernoulli Naive Bayes 0.726857
4 XGBoost 0.724571
5 Gaussian Naive Bayes 0.721143
7 KNN 0.674857
8 Decision Tree 0.661143
================================== Precision ===================================
name precision
0 Logistic Regression 0.761427
9 Bagging Classifier 0.747583
3 Support Vector Machines 0.745568
6 Bernoulli Naive Bayes 0.743151
1 Random Forest 0.743041
2 LightGBM 0.739451
5 Gaussian Naive Bayes 0.737986
4 XGBoost 0.728355
7 KNN 0.69409
8 Decision Tree 0.677714
============================== True Positive Rate ==============================
name true_positive_rate
3 Support Vector Machines 0.790929
2 LightGBM 0.775442
9 Bagging Classifier 0.769912
1 Random Forest 0.767699
0 Logistic Regression 0.755531
4 XGBoost 0.744469
6 Bernoulli Naive Bayes 0.720133
5 Gaussian Naive Bayes 0.713496
7 KNN 0.662611
8 Decision Tree 0.655973
================================= Specificity ==================================
name specificity
3 Support Vector Machines 0.790929
2 LightGBM 0.775442
9 Bagging Classifier 0.769912
1 Random Forest 0.767699
0 Logistic Regression 0.755531
4 XGBoost 0.744469
6 Bernoulli Naive Bayes 0.720133
5 Gaussian Naive Bayes 0.713496
7 KNN 0.662611
8 Decision Tree 0.655973
=================================== F1 Score ===================================
name score
3 Support Vector Machines 0.767579
9 Bagging Classifier 0.758583
0 Logistic Regression 0.758468
2 LightGBM 0.757019
1 Random Forest 0.755169
4 XGBoost 0.736324
6 Bernoulli Naive Bayes 0.731461
5 Gaussian Naive Bayes 0.725534
7 KNN 0.677985
8 Decision Tree 0.666667现在,我不知道该使用什么型号,所以我决定尝试7000行几乎加倍。起初,我告诉大家,结果将保持不变,只有准确性会增加,但是瞧,顺序发生了变化,这是我的结果,有7000行:
=================================== Accuracy ===================================
name accuracy
9 Bagging Classifier 0.736571
2 LightGBM 0.735429
3 Support Vector Machines 0.734
0 Logistic Regression 0.732857
1 Random Forest 0.730571
4 XGBoost 0.721714
6 Bernoulli Naive Bayes 0.72
5 Gaussian Naive Bayes 0.711429
7 KNN 0.674
8 Decision Tree 0.625429
================================== Precision ===================================
name precision
0 Logistic Regression 0.727174
6 Bernoulli Naive Bayes 0.726908
5 Gaussian Naive Bayes 0.725281
9 Bagging Classifier 0.719153
1 Random Forest 0.717895
3 Support Vector Machines 0.716049
2 LightGBM 0.714576
4 XGBoost 0.712533
7 KNN 0.674612
8 Decision Tree 0.63009
============================== True Positive Rate ==============================
name true_positive_rate
2 LightGBM 0.794466
9 Bagging Classifier 0.786561
3 Support Vector Machines 0.785997
1 Random Forest 0.770186
0 Logistic Regression 0.755505
4 XGBoost 0.754376
6 Bernoulli Naive Bayes 0.715415
5 Gaussian Naive Bayes 0.6917
7 KNN 0.687182
8 Decision Tree 0.629023
================================= Specificity ==================================
name specificity
2 LightGBM 0.794466
9 Bagging Classifier 0.786561
3 Support Vector Machines 0.785997
1 Random Forest 0.770186
0 Logistic Regression 0.755505
4 XGBoost 0.754376
6 Bernoulli Naive Bayes 0.715415
5 Gaussian Naive Bayes 0.6917
7 KNN 0.687182
8 Decision Tree 0.629023
=================================== F1 Score ===================================
name score
2 LightGBM 0.752406
9 Bagging Classifier 0.751348
3 Support Vector Machines 0.749394
1 Random Forest 0.743122
0 Logistic Regression 0.741069
4 XGBoost 0.732858
6 Bernoulli Naive Bayes 0.721116
5 Gaussian Naive Bayes 0.708092
7 KNN 0.680839
8 Decision Tree 0.629556顺序发生了变化,这让我感到惊讶,所以我的问题是,更多的训练数据会改变模型与其他模型的相对准确性吗?或者,根据我自己的理解,为什么会发生上述模式排名的变化?
还有一个问题是。有没有任何方法来绘制所有这些数据,以便更容易地找到全面的最佳模型?现在,我有所有这些数据在3种不同的熊猫数据绘制,我只是不知道做什么/哪个情节,甚至如何制作的情节。
否则,仅此而已,并提前感谢您。:)
确实注意到,当我说3500和7000时,我的意思是我使用的行总数,包括培训和测试。我把全部分成75%和25%,使用75%用于训练,25%用于测试
。
发布于 2022-06-09 06:53:58
Q1。数据化结果模型与其他模型的比较精度是否有变化?
答:有的时候是,有的时候不是
是的可能性
如果数据的变化很大,那么,除非添加的数据没有随机性,否则在模型性能度量顺序中洗牌的可能性更高。如果添加更多的数据意味着添加更多的异常值,包括具有更多随机独立值的样本,第3和第4标准差中存在的样本数量增加,以及数据分布的变化。在这种情况下,在这个场景中,您已经将100%的数据添加到以前的数据中(3500是3500的100% ),让我们假设它有100个异常值,而且正如您所提到的,数据集也增加了一倍。
。
无的可能性
如果数据的变化很小,那么除非添加的数据具有很大的随机性,否则在模型性能度量顺序中洗牌的可能性较低。
备注:同样在你的情况下,支持向量机、LR、BC和LightGBM在前50%的准确性上没有太大的差异,因此,通过添加另外50%的数据,更多的机会在排行榜上洗牌。
https://stackoverflow.com/questions/72555108
复制相似问题