擅长:python、mysql、java
<p>对于机器学习,有许多不同的编码分类变量的方法,我们在scikit learn contrib包中实现了其中的一些(包括一个Hot):category_encoders:</p>
<p><a href="https://github.com/scikit-learn-contrib/categorical-encoding" rel="nofollow noreferrer">https://github.com/scikit-learn-contrib/categorical-encoding</a></p>
<p>如果您已经在使用scikit learn和/或pandas,这可能是一个简单的解决方案。像你提到的高维性,以及你不一定事先知道所有类别的情况下,使用HashingEncoder这样的东西可能会有更好的运气。在</p>