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

Solution: Import the 'tree' module

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

from sklearn import tree

 

For more information:
Python sklearn tree