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
|
# return tree made from attributes
|
||||||
def tree():
|
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]
|
x = dataset[attributes]
|
||||||
y = dataset[decisions]
|
y = dataset[decisions]
|
||||||
|
@ -4,12 +4,12 @@
|
|||||||
| | | |--- class: 0
|
| | | |--- class: 0
|
||||||
| | |--- feature_0 > 1.50
|
| | |--- feature_0 > 1.50
|
||||||
| | | |--- feature_3 <= 3.50
|
| | | |--- feature_3 <= 3.50
|
||||||
| | | | |--- feature_2 <= 2.50
|
| | | | |--- feature_4 <= 2.50
|
||||||
| | | | | |--- class: 1
|
| | | | | |--- class: 1
|
||||||
| | | | |--- feature_2 > 2.50
|
| | | | |--- feature_4 > 2.50
|
||||||
| | | | | |--- feature_4 <= 2.50
|
| | | | | |--- feature_2 <= 2.50
|
||||||
| | | | | | |--- class: 1
|
| | | | | | |--- class: 1
|
||||||
| | | | | |--- feature_4 > 2.50
|
| | | | | |--- feature_2 > 2.50
|
||||||
| | | | | | |--- class: 0
|
| | | | | | |--- class: 0
|
||||||
| | | |--- feature_3 > 3.50
|
| | | |--- feature_3 > 3.50
|
||||||
| | | | |--- feature_3 <= 4.50
|
| | | | |--- feature_3 <= 4.50
|
||||||
@ -26,12 +26,12 @@
|
|||||||
| | | | | | | |--- feature_1 > 1.50
|
| | | | | | | |--- feature_1 > 1.50
|
||||||
| | | | | | | | |--- class: 0
|
| | | | | | | | |--- class: 0
|
||||||
| | | | | | |--- feature_0 > 2.50
|
| | | | | | |--- feature_0 > 2.50
|
||||||
| | | | | | | |--- feature_4 <= 2.50
|
| | | | | | | |--- feature_2 <= 2.50
|
||||||
| | | | | | | | |--- class: 1
|
| | | | | | | | |--- class: 1
|
||||||
| | | | | | | |--- feature_4 > 2.50
|
| | | | | | | |--- feature_2 > 2.50
|
||||||
| | | | | | | | |--- feature_2 <= 2.50
|
| | | | | | | | |--- feature_4 <= 2.50
|
||||||
| | | | | | | | | |--- class: 1
|
| | | | | | | | | |--- class: 1
|
||||||
| | | | | | | | |--- feature_2 > 2.50
|
| | | | | | | | |--- feature_4 > 2.50
|
||||||
| | | | | | | | | |--- class: 0
|
| | | | | | | | | |--- class: 0
|
||||||
| | | | | |--- feature_1 > 2.50
|
| | | | | |--- feature_1 > 2.50
|
||||||
| | | | | | |--- feature_0 <= 3.50
|
| | | | | | |--- feature_0 <= 3.50
|
||||||
@ -73,8 +73,8 @@
|
|||||||
| | |--- feature_2 > 1.50
|
| | |--- feature_2 > 1.50
|
||||||
| | | |--- class: 0
|
| | | |--- class: 0
|
||||||
|--- feature_2 > 3.50
|
|--- 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_2 <= 4.50
|
||||||
| | | | |--- feature_3 <= 4.50
|
| | | | |--- feature_3 <= 4.50
|
||||||
| | | | | |--- feature_0 <= 1.50
|
| | | | | |--- feature_0 <= 1.50
|
||||||
@ -85,7 +85,7 @@
|
|||||||
| | | | | |--- class: 0
|
| | | | | |--- class: 0
|
||||||
| | | |--- feature_2 > 4.50
|
| | | |--- feature_2 > 4.50
|
||||||
| | | | |--- class: 0
|
| | | | |--- class: 0
|
||||||
| | |--- feature_4 > 1.50
|
| | |--- feature_1 > 1.50
|
||||||
| | | |--- class: 0
|
| | | |--- class: 0
|
||||||
| |--- feature_1 > 1.50
|
| |--- feature_4 > 1.50
|
||||||
| | |--- class: 0
|
| | |--- 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.
@ -19,6 +19,7 @@ class aiPlayer():
|
|||||||
self.game.draw()
|
self.game.draw()
|
||||||
# print(self.player.get_actual_coords())
|
# print(self.player.get_actual_coords())
|
||||||
|
|
||||||
|
|
||||||
def turn_left(self):
|
def turn_left(self):
|
||||||
change = int(self.player.rotation()) - 1
|
change = int(self.player.rotation()) - 1
|
||||||
if(change == -1):
|
if(change == -1):
|
||||||
|
11
main.py
11
main.py
@ -113,16 +113,17 @@ class Game():
|
|||||||
self.negative_decision.append(i)
|
self.negative_decision.append(i)
|
||||||
self.negative_actions.append(i)
|
self.negative_actions.append(i)
|
||||||
|
|
||||||
# j = 0
|
for i in self.positive_actions:
|
||||||
# for i in self.positive_actions:
|
print('----')
|
||||||
|
print(i)
|
||||||
# print(f"step {j} actions is : {i}")
|
print('----')
|
||||||
# j+=1
|
|
||||||
|
|
||||||
# vec = pg.math.Vector2
|
# vec = pg.math.Vector2
|
||||||
# for i in self.positive_actions:
|
# for i in self.positive_actions:
|
||||||
# self.t.startAiController(i)
|
# self.t.startAiController(i)
|
||||||
|
# self.player.update()
|
||||||
# self.player.pos = vec(32, 32)
|
# self.player.pos = vec(32, 32)
|
||||||
|
# self.player.update()
|
||||||
|
|
||||||
self.t.startAiController(self.positive_actions[0])
|
self.t.startAiController(self.positive_actions[0])
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user