is there any way I can get the feature names of the decision tree model as defined below using sklearn or any other packages in the Anaconda Jupyter Notebook? I'm trying to work on this issue for a long time now, but have not been able to search for exact work through.
Asked
Active
Viewed 50 times
0
-
2Welcome to SO. Please, don't show your error as image, copy it as code in the question. This will make easier to help you. – Alex Serra Marrugat Jun 22 '22 at 12:00
1 Answers
0
You just need to use a Pandas dataframe with the feature names when you train your decision tree model instead of a Numpy array with no feature names.

Pierre-Loic
- 1,524
- 1
- 6
- 12
-
So, I tried using the method you suggested, but it didn't work for me. I used a pandas data frame with the string features names from the dataset on which I want to train the model. I'm posting the latest code snippets in the question above. – Harsh780 Jun 23 '22 at 07:12