![](/img/trans.png)
[英]How to increase the model accuracy of logistic regression in Scikit python?
[英]How to Increase accuracy and precision for my logistic regression model?
My machine learning model dataset is cleaveland data base with 300 rows and 14 attributes--predicting whether a person has heart disease or not.. But aim is create a classification model on logistic regression... I preprocessed the data and ran the model with x_train,Y_train,X_test,Y_test.. 并获得 82% 的平均准确率...
因此,为了提高准确性,我确实删除了彼此高度相关的特征[因为它们会提供相同的信息]
我做了RFE[递归特征消除]
其次是PCA[principle component analysis]用于降维...
我仍然没有发现数据集的准确性更好..
这是为什么?
另外为什么我的 model 每次都显示不同的精度? 是因为每次都采用不同的 x_train,Y_train,X_test,Y_test 吗?
我应该更改我的 model 以获得更好的精度吗? 80% 的平均准确率是好是坏?
我应该更改我的 model 以获得更好的精度吗?
至少你可以尝试。 正确的 model 的选择高度依赖于具体的用例。 尝试其他方法绝不是一个坏主意:)
另一个想法是通过 PCA 获得方差最大的两个特征。 然后,如果您的数据是线性可分的,那么您可以在 2D 空间中进行 plot 以获得更好的感觉。
另外为什么我的 model 每次都显示不同的精度?
我假设您使用的是 scikit-learn 的train_test_split
方法,所以拆分您的数据? 默认情况下,此方法随机打乱您的数据。 您可以将random_state
参数设置为固定值以获得可重现的结果。
请参阅( https://github.com/dnishimoto/python-deep-learning/blob/master/Credit%20Card%20Defaults%20-%20hyperparameter.ipynb )以提高您进行超调以及降维和缩放的准确性。 超调正在寻找最佳参数。 而降维是删除对精度降低噪声没有贡献的特征。 缩放或归一化可减少分布中的噪声。
查看 GridSearch 以找到最佳参数
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.