Zaktualizuj 'id3.py'

This commit is contained in:
Cezary Adamczak 2021-05-23 23:16:55 +02:00
parent 4c3da838af
commit 8effe0d702

8
id3.py
View File

@ -54,9 +54,6 @@ def E(cases, attribute):
e = 0
values = []
index = cases[0].attributes.index(attribute)
print(attribute)
print(cases[0].values)
print(index)
for case in cases:
if case.values[index] not in values:
values.append(case.values[index])
@ -83,17 +80,12 @@ def treelearn(cases, attributes, default_class):
t = Node(A)
new_default_class = count_classes(cases)
print(attributes, end=" ")
values = []
index = attributes.index(A)
print(index)
for case in cases:
if case.values[index] not in values:
values.append(case.values[index])
print(values, end="")
print(A)
for value in values:
new_cases = []
for case in cases: