Computer Science, asked by pcs20405, 2 months ago

Create a decision tree classifier in scikit learn using data given below
Features =[[2,100],[6,25],[1,300],[1,1000],[4,100],[10,100]
Label=[1,2,1,1,2,2]
Note :1 - sports/race car and 2 - family car

Answers

Answered by pandalamani11
0

Answer:

from sklearn.tree import DecisionTreeClassifier

feature=[[2,100],[6,25],[1,300],[1,1000],[4,100],[10,100]]

Label=[1,2,1,1,2,2]

clf=DecisionTreeClassifier(random_state=0)

clf.fit(features,Label)

x1,x2=input().split()

print(clf.predict([[x1,x2]]))

Similar questions