fix path
This commit is contained in:
parent
ed19e41bc6
commit
f258750c1c
@ -9,7 +9,7 @@ attributes = ["season", "trash_type", "mass", "space", "trash_mass"]
|
||||
|
||||
# return tree made from attributes
|
||||
def tree():
|
||||
dataset = pandas.read_csv('/Users/mac/Desktop/tree_dataset.csv', sep=";")
|
||||
dataset = pandas.read_csv('decision_tree/tree_dataset.csv', sep=";")
|
||||
|
||||
x = dataset[attributes]
|
||||
y = dataset[decisions]
|
||||
|
@ -4,12 +4,12 @@
|
||||
| | | |--- class: 0
|
||||
| | |--- feature_0 > 1.50
|
||||
| | | |--- feature_3 <= 3.50
|
||||
| | | | |--- feature_2 <= 2.50
|
||||
| | | | |--- feature_4 <= 2.50
|
||||
| | | | | |--- class: 1
|
||||
| | | | |--- feature_2 > 2.50
|
||||
| | | | | |--- feature_4 <= 2.50
|
||||
| | | | |--- feature_4 > 2.50
|
||||
| | | | | |--- feature_2 <= 2.50
|
||||
| | | | | | |--- class: 1
|
||||
| | | | | |--- feature_4 > 2.50
|
||||
| | | | | |--- feature_2 > 2.50
|
||||
| | | | | | |--- class: 0
|
||||
| | | |--- feature_3 > 3.50
|
||||
| | | | |--- feature_3 <= 4.50
|
||||
@ -26,12 +26,12 @@
|
||||
| | | | | | | |--- feature_1 > 1.50
|
||||
| | | | | | | | |--- class: 0
|
||||
| | | | | | |--- feature_0 > 2.50
|
||||
| | | | | | | |--- feature_4 <= 2.50
|
||||
| | | | | | | |--- feature_2 <= 2.50
|
||||
| | | | | | | | |--- class: 1
|
||||
| | | | | | | |--- feature_4 > 2.50
|
||||
| | | | | | | | |--- feature_2 <= 2.50
|
||||
| | | | | | | |--- feature_2 > 2.50
|
||||
| | | | | | | | |--- feature_4 <= 2.50
|
||||
| | | | | | | | | |--- class: 1
|
||||
| | | | | | | | |--- feature_2 > 2.50
|
||||
| | | | | | | | |--- feature_4 > 2.50
|
||||
| | | | | | | | | |--- class: 0
|
||||
| | | | | |--- feature_1 > 2.50
|
||||
| | | | | | |--- feature_0 <= 3.50
|
||||
@ -73,8 +73,8 @@
|
||||
| | |--- feature_2 > 1.50
|
||||
| | | |--- class: 0
|
||||
|--- feature_2 > 3.50
|
||||
| |--- feature_1 <= 1.50
|
||||
| | |--- feature_4 <= 1.50
|
||||
| |--- feature_4 <= 1.50
|
||||
| | |--- feature_1 <= 1.50
|
||||
| | | |--- feature_2 <= 4.50
|
||||
| | | | |--- feature_3 <= 4.50
|
||||
| | | | | |--- feature_0 <= 1.50
|
||||
@ -85,7 +85,7 @@
|
||||
| | | | | |--- class: 0
|
||||
| | | |--- feature_2 > 4.50
|
||||
| | | | |--- class: 0
|
||||
| | |--- feature_4 > 1.50
|
||||
| | |--- feature_1 > 1.50
|
||||
| | | |--- class: 0
|
||||
| |--- feature_1 > 1.50
|
||||
| |--- feature_4 > 1.50
|
||||
| | |--- class: 0
|
||||
|
1251
decision_tree/tree_dataset.csv
Normal file
1251
decision_tree/tree_dataset.csv
Normal file
File diff suppressed because it is too large
Load Diff
Binary file not shown.
@ -18,6 +18,7 @@ class aiPlayer():
|
||||
self.player.update()
|
||||
self.game.draw()
|
||||
# print(self.player.get_actual_coords())
|
||||
|
||||
|
||||
def turn_left(self):
|
||||
change = int(self.player.rotation()) - 1
|
||||
|
@ -13,7 +13,7 @@ class Trashbin(Tile):
|
||||
self.trash_type = randrange(5)
|
||||
self.mass = randrange(5)
|
||||
self.space = randrange(5)
|
||||
self.trash_mass = randrange(5)
|
||||
self.trash_mass = randrange(5)
|
||||
|
||||
|
||||
def get_coords(self):
|
||||
|
13
main.py
13
main.py
@ -113,17 +113,18 @@ class Game():
|
||||
self.negative_decision.append(i)
|
||||
self.negative_actions.append(i)
|
||||
|
||||
# j = 0
|
||||
# for i in self.positive_actions:
|
||||
|
||||
# print(f"step {j} actions is : {i}")
|
||||
# j+=1
|
||||
for i in self.positive_actions:
|
||||
print('----')
|
||||
print(i)
|
||||
print('----')
|
||||
|
||||
# vec = pg.math.Vector2
|
||||
# for i in self.positive_actions:
|
||||
# self.t.startAiController(i)
|
||||
# self.player.update()
|
||||
# self.player.pos = vec(32, 32)
|
||||
|
||||
# self.player.update()
|
||||
|
||||
self.t.startAiController(self.positive_actions[0])
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user