Search code examples
pythonimporterror

Error when trying to import decision tree classifier


This is the error I am getting.

this is the error I am getting:
ImportError: cannot import name 'DecesionTreeClassifier' from 'sklearn.tree' (C:\Users\Shrey\anaconda3\lib\site-packages\sklearn\tree_init_.py)

ImportError: cannot import name 'DecesionTreeClassifier' from 'sklearn.tree' (C:\Users\Shrey  
\anaconda3\lib\site-packages\sklearn\tree\__init__.py)

Solution

  • The right import statement:

    from sklearn.tree import DecisionTreeClassifier
    

    There is a typo error in your import statement: DecesionTreeClassifier