Python
--
Questions
--
Followers
Top Experts
I am using Jupyter notebook for the some basic machine learning code developed in python. I am stangely getting the following error. Even though I have imported the class "DecisionTreeClassifier" as shown in the code I am still getting the error "NameError: name 'DecisionTreeClassfier' is not defined" when I try to instantiate the class as follows. PFA is the screenshot for error message.
import pandas as pd
from sklearn.tree import DecisionTreeClassifier
music_data = pd.read_csv('music.csv')
X = music_data.drop(columns = ['genre'])
y = music_data['genre']
music_data
model = DecisionTreeClassfier()
#model.fit(X, y)
#predictions = model.predict([ [21, 1], [20, 0] ])
#predictions
Screen-Shot-2020-05-04-at-11.11.01-P.png
Zero AI Policy
We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.






EARN REWARDS FOR ASKING, ANSWERING, AND MORE.
Earn free swag for participating on the platform.
Python
--
Questions
--
Followers
Top Experts
Python is a widely used general-purpose, high-level programming language. Its design philosophy emphasizes code readability, and its syntax allows programmers to express concepts in fewer lines of code than would be possible in other languages. Python supports multiple programming paradigms, including object-oriented, imperative and functional programming or procedural styles. It features a dynamic type system and automatic memory management and has a large and comprehensive set of standard libraries, including NumPy, SciPy, Django, PyQuery, and PyLibrary.