Я пытаюсь создать игру «Угадай животных» с классификатором дерева решений sklearn. В нем, при вводе пользователя, он скажет, является ли животное пауком или фантастикой sh. Когда я ввожу количество ног и их положение, появляется сообщение, что животное - это fi sh, и наоборот. Это код, есть идеи?
from sklearn.tree import DecisionTreeClassifier
clf = DecisionTreeClassifier()
features=[[6,0],
[6,0], #0 is spider and 1 is fish
[0,1], #6 = 4 legs and 8=stays in land ( this is a spider)
[0,1]] #4=no legs and 7 is stays in water (this is a fish)
outcomes=[1,1,0,0]
clf.fit(features, outcomes)
legs=int(input("Enter the number of legs your animal has: "))
land_water=input("Enter whether you animal stays in land or water: ")
if land_water=="land":
land_water=0
else:
land_water=1
sa=clf.predict([[legs, land_water]])
if sa==[0]:
print("Animal is a spider")
else:
print('Animal is a fish')