Create a Decision tree classifier in sci-kit learn using the 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
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
Geography,
23 days ago
English,
23 days ago
Psychology,
1 month ago
Math,
8 months ago
English,
8 months ago