D:\14595\anaconda3\lib\site-packages\sklearn\base.py:439: UserWarning: X does not have valid feature names, but RandomForestRegressor was fitted with feature names warnings.warn(如何将上述warning忽略
时间: 2023-07-13 20:34:34 浏览: 409
Anaconda3-5.3.1-Windows-x86-64.exe.rar
可以使用Python的warning模块来忽略这个warning。可以在代码文件的开头添加以下代码:
```
import warnings
warnings.filterwarnings("ignore", message="X does not have valid feature names")
```
这样就可以忽略这个warning了。
阅读全文