poprawny porogram

This commit is contained in:
Paulina J 2019-06-10 11:26:22 +02:00
parent 93ac9d9df5
commit f9f774ba51
3 changed files with 11 additions and 15 deletions

View File

@ -26,19 +26,17 @@ class TreeClass:
#print(com)
def make_tree(self, plant, pl_stats):
features = []
features = []
with open('dane.txt') as data:
for line in data:
elements = line.split(", ")
if elements[1] == "True":
elements[1] = 1
if elements[1] == "False":
elements[1] = 0
with open('dane.txt') as data:
for line in data:
elements = line.split(", ")
for element in elements:
if element == "True":
element = True
elif element == "False":
element = False
else:
element = int(element)
features.append(elements)
features.append(elements)
labels = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,

View File

@ -273,5 +273,3 @@
0, False, 230, 850, 180
0, False, 2345, 21, 342
0, False, 2561, 244, 532

View File

@ -5,7 +5,7 @@ from Graph import Graph
from Cucumber import Cucumber
from Tomato import Tomato
from sklearn import tree
from Tree import TreeClass
from Tree1 import TreeClass
class Tractor(TreeClass):