简体   繁体   English

Python sklearn 中的训练集

[英]Training Set in Python sklearn

如果我在子组大小方面有一个有偏见的数据集,例如,如果我试图预测 'a','b','c' 标签,但我的数据集有 1000 个 'a' 标签、500 个 'b' 标签和 250 个 ' c' 标签,sklearn 是否对此有任何解决方法,还是会自动考虑到这一点?

Sklearn provides the funtionality to deal with imbalanced data itself, you have to check out with the different metrics avalaible here and use it to find the best metric for which your model have higher accuracy rates. Sklearn 提供了处理不平衡数据本身的功能,您必须查看此处可用的不同指标并使用它来找到模型具有更高准确率的最佳指标。 Scroing metrics is the parameter which can help you with imbalanced datasets.评分指标是可以帮助您处理不平衡数据集的参数。 Just choose your scoring while training the model according to your problem and it will considerably help to deal it with.只需根据您的问题在训练模型时选择您的评分,这将大大有助于处理它。

When dealing with imbalanced data you can always do oversampling for the classes.在处理不平衡数据时,您始终可以对类进行过采样。 This process can be done in data preprocessing.这个过程可以在数据预处理中完成。

More about dealing with imbalanced data you can read here and here您可以在此处此处阅读有关处理不平衡数据的更多信息

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM