简体   繁体   English

如果您有两个类 0 和 1 的数字目标,并且所有特征也是数字的,我应该对目标进行编码吗?

[英]if you have a numerical target of two classes 0 and 1 and all the features are numerical as well, should i encode the target?

我正在研究二进制分类问题,我的数据集包含数字特征,目标类也是数字的,在这种情况下我有两个类,0 或 1,在预处理数据集时,我应该通过数据编码步骤还是它是在这种情况下不需要??

You do not need to encode the target variable if it already is encoded.如果目标变量已经编码,则不需要对其进行编码。 The point of encoding is for your machine learning model to be able to interpret the number.编码的目的是让您的机器学习模型能够解释数字。 Whether it is a {-1,1} or {True, False} or {A,B}, the encoding applied will normalize it between 0 and 1 to be digestible by your model.无论是 {-1,1} 还是 {True, False} 或 {A,B},应用的编码都会在01之间对其进行规范化,以便您的模型可以消化。 See sklearn's label encoder查看 sklearn 的标签编码器

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

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