How to Solve NameError: name 'export_text' is not defined -- sklearn

Solution: Import the 'export_text' module

To Solve the error, add the following line to the top of your code.

from sklearn.tree import export_text

 

For more information:
Python sklearn export_text