'DataFrame' object has no attribute 'feature_names'
时间: 2023-10-30 22:51:43 浏览: 160
# Pycharm关于AttributeError: ‘DataFrame’ object has no attribute ‘score’的错误
5星 · 资源好评率100%
The error message "'DataFrame' object has no attribute 'feature_names'" means that you are trying to access an attribute called 'feature_names' on a DataFrame object, but that attribute does not exist.
This error can occur when you are working with machine learning libraries such as scikit-learn, which expect certain attributes to be present in your data. One possible cause of this error could be that you have not properly formatted your data before passing it to a machine learning algorithm.
To fix this error, you should check the documentation of the library you are using and make sure that your data is formatted correctly. You may also want to inspect your DataFrame object to see if there are any missing or incorrectly named columns that could be causing the error.
阅读全文