擅长:python、mysql、java
<p>@Fawwaz Yusran来处理这个警告。。。</p>
<pre><code>FutureWarning: The handling of integer data will change in version 0.22. Currently, the categories are determined based on the range [0, max(values)], while in the future they will be determined based on the unique values. If you want the future behaviour and silence this warning, you can specify "categories='auto'". In case you used a LabelEncoder before this OneHotEncoder to convert the categories to integers, then you can now use the OneHotEncoder directly. warnings.warn(msg, FutureWarning)
</code></pre>
<p>删除以下内容。。。</p>
<pre><code>labelencoder_X = LabelEncoder()
X[:, 0] = labelencoder_X.fit_transform(X[:, 0])
</code></pre>
<p>因为您直接使用一个hotecoder,所以不需要LabelEncoder。</p>