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

Solution: Import the 'DecisionTreeRegressor' module

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

from sklearn.tree import DecisionTreeRegressor

 

For more information:
Python sklearn DecisionTreeRegressor