poprawny porogram
This commit is contained in:
parent
93ac9d9df5
commit
f9f774ba51
22
Tree1.py
22
Tree1.py
@ -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,
|
||||
|
2
dane.txt
2
dane.txt
@ -273,5 +273,3 @@
|
||||
0, False, 230, 850, 180
|
||||
0, False, 2345, 21, 342
|
||||
0, False, 2561, 244, 532
|
||||
|
||||
|
||||
|
@ -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):
|
||||
|
Loading…
Reference in New Issue
Block a user