This commit is contained in:
s481818 2024-05-30 15:54:34 +02:00
parent 50b8b85bdc
commit ecc3534227
3 changed files with 225 additions and 0 deletions

Binary file not shown.

201
ai-wozek/paczki.csv Normal file
View File

@ -0,0 +1,201 @@
Height,Width,Depth,Weight,Damage,Label_State,Content,Value,Acceptance
medium,big,medium,medium,yes,no,fruit,cheap,no
small,small,small,heavy,no,yes,clothes,cheap,yes
medium,big,medium,light,no,yes,car_parts,expensive,yes
medium,big,small,heavy,yes,yes,nuclear_waste,expensive,no
medium,big,medium,heavy,yes,yes,nuclear_waste,cheap,no
big,medium,medium,medium,yes,yes,car_parts,expensive,no
big,small,medium,medium,no,yes,fruit,cheap,yes
big,small,medium,medium-heavy,no,yes,car_parts,expensive,yes
medium,big,medium,medium,no,no,clothes,cheap,no
small,big,medium,medium,no,yes,nuclear_waste,expensive,yes
medium,medium,small,light,yes,no,clothes,expensive,no
big,small,big,medium,no,yes,car_parts,cheap,yes
medium,small,small,medium-heavy,yes,no,fruit,expensive,no
big,big,medium,heavy,yes,no,fruit,expensive,no
big,medium,small,medium-heavy,no,no,fruit,expensive,no
medium,medium,big,heavy,no,no,nuclear_waste,cheap,no
medium,small,big,medium-heavy,yes,no,car_parts,expensive,no
small,medium,medium,light,no,yes,car_parts,expensive,yes
medium,small,small,heavy,yes,yes,nuclear_waste,cheap,no
small,big,small,medium,yes,yes,car_parts,expensive,no
medium,small,big,medium-heavy,no,yes,car_parts,cheap,yes
big,medium,medium,medium,yes,no,car_parts,cheap,no
big,small,small,medium,no,yes,clothes,expensive,yes
medium,big,big,light,yes,no,car_parts,expensive,no
medium,big,medium,medium,yes,no,clothes,expensive,no
big,big,medium,light,no,no,nuclear_waste,cheap,no
big,small,big,medium-heavy,yes,yes,fruit,expensive,no
medium,small,small,medium,yes,no,car_parts,cheap,no
small,big,big,medium-heavy,no,yes,car_parts,expensive,yes
medium,medium,big,medium,yes,yes,car_parts,expensive,no
medium,medium,big,light,no,no,fruit,expensive,no
medium,medium,medium,medium,no,yes,nuclear_waste,expensive,yes
big,small,big,medium-heavy,no,yes,car_parts,cheap,yes
medium,medium,big,light,no,yes,clothes,expensive,yes
medium,small,small,light,yes,yes,fruit,expensive,no
big,medium,medium,light,yes,yes,nuclear_waste,expensive,no
big,small,small,medium-heavy,no,no,nuclear_waste,expensive,no
big,big,big,medium-heavy,no,yes,fruit,cheap,yes
medium,small,small,medium,yes,yes,nuclear_waste,expensive,no
small,small,medium,medium-heavy,yes,yes,clothes,cheap,yes
big,small,big,medium,no,yes,fruit,cheap,yes
medium,small,small,light,yes,yes,nuclear_waste,expensive,no
medium,big,big,medium-heavy,no,no,car_parts,cheap,no
medium,big,small,light,no,yes,car_parts,expensive,yes
small,medium,medium,heavy,yes,yes,fruit,cheap,yes
big,small,big,heavy,no,no,clothes,cheap,no
big,big,big,heavy,no,yes,car_parts,cheap,yes
medium,big,big,light,no,yes,car_parts,cheap,yes
small,small,big,light,yes,no,fruit,expensive,no
medium,medium,small,medium,yes,yes,clothes,expensive,no
small,medium,big,medium,yes,yes,fruit,expensive,no
small,big,medium,heavy,yes,yes,clothes,cheap,no
small,small,big,heavy,no,no,fruit,expensive,no
small,small,big,medium,yes,yes,car_parts,cheap,no
small,small,big,medium,yes,no,clothes,expensive,no
medium,small,big,light,yes,no,car_parts,cheap,no
big,medium,medium,medium,no,yes,nuclear_waste,expensive,yes
small,big,small,light,no,no,car_parts,cheap,no
medium,medium,big,heavy,yes,no,fruit,expensive,no
small,big,small,medium,no,no,fruit,cheap,no
big,medium,big,light,yes,yes,nuclear_waste,expensive,no
small,medium,big,light,yes,no,clothes,cheap,no
medium,small,big,heavy,yes,no,nuclear_waste,cheap,no
big,medium,small,medium,yes,no,car_parts,expensive,no
big,medium,big,medium,no,no,nuclear_waste,expensive,no
medium,big,medium,medium,no,yes,clothes,cheap,yes
medium,big,big,light,yes,yes,clothes,cheap,no
small,medium,medium,light,yes,no,nuclear_waste,cheap,yes
medium,medium,big,medium,yes,no,nuclear_waste,expensive,no
small,medium,small,medium-heavy,yes,no,clothes,cheap,yes
medium,medium,small,medium-heavy,yes,no,car_parts,expensive,no
medium,small,small,light,no,no,car_parts,expensive,no
small,medium,medium,light,no,yes,fruit,expensive,yes
small,big,big,medium,no,yes,clothes,expensive,yes
small,medium,small,heavy,no,no,car_parts,cheap,yes
small,big,small,heavy,yes,no,clothes,expensive,no
medium,big,big,medium-heavy,yes,no,fruit,expensive,no
medium,medium,small,medium-heavy,yes,yes,clothes,expensive,no
small,medium,big,medium-heavy,yes,yes,clothes,expensive,no
medium,big,medium,heavy,yes,no,clothes,expensive,no
medium,medium,small,medium,yes,no,nuclear_waste,expensive,no
small,big,medium,medium,no,no,nuclear_waste,cheap,no
small,medium,medium,light,yes,yes,car_parts,cheap,yes
big,small,small,light,yes,yes,fruit,expensive,no
medium,medium,big,heavy,no,yes,clothes,cheap,yes
big,small,big,medium-heavy,yes,no,car_parts,expensive,no
big,medium,medium,light,yes,no,fruit,expensive,no
big,medium,small,medium,yes,yes,clothes,cheap,no
medium,medium,small,heavy,no,no,nuclear_waste,cheap,no
small,small,big,heavy,yes,no,fruit,cheap,no
medium,big,big,heavy,yes,no,car_parts,expensive,no
small,small,small,medium,no,yes,clothes,expensive,yes
small,big,medium,medium,yes,yes,car_parts,expensive,no
big,small,medium,medium-heavy,yes,yes,nuclear_waste,cheap,no
medium,small,small,heavy,yes,no,nuclear_waste,expensive,no
small,medium,medium,medium,no,yes,clothes,cheap,yes
medium,medium,small,medium-heavy,no,yes,fruit,cheap,yes
medium,small,big,heavy,yes,yes,fruit,expensive,no
big,small,medium,medium,no,yes,nuclear_waste,expensive,yes
big,medium,medium,medium-heavy,yes,yes,nuclear_waste,expensive,no
big,small,small,light,no,no,clothes,expensive,no
medium,medium,medium,medium-heavy,yes,yes,car_parts,cheap,no
big,big,big,heavy,no,no,fruit,expensive,no
small,big,big,medium-heavy,yes,no,fruit,cheap,no
medium,medium,big,medium,yes,yes,fruit,expensive,no
big,big,medium,heavy,yes,no,fruit,expensive,no
big,small,small,heavy,no,no,fruit,cheap,no
medium,medium,big,light,yes,no,clothes,expensive,no
big,big,medium,heavy,yes,yes,clothes,expensive,no
small,medium,medium,medium-heavy,yes,no,nuclear_waste,expensive,yes
medium,medium,medium,medium-heavy,no,yes,fruit,cheap,yes
small,small,medium,medium-heavy,yes,yes,car_parts,expensive,yes
small,medium,small,heavy,no,yes,fruit,cheap,yes
big,small,big,medium-heavy,yes,yes,nuclear_waste,expensive,no
medium,medium,big,heavy,yes,yes,nuclear_waste,cheap,no
small,big,medium,medium-heavy,yes,yes,clothes,cheap,no
big,medium,big,medium,no,yes,car_parts,expensive,yes
big,small,big,heavy,no,yes,nuclear_waste,expensive,yes
big,small,big,medium-heavy,no,no,nuclear_waste,cheap,no
small,medium,medium,light,no,yes,car_parts,expensive,yes
big,medium,small,light,yes,yes,nuclear_waste,expensive,no
small,medium,big,medium,yes,no,fruit,cheap,no
big,small,small,medium-heavy,yes,yes,fruit,cheap,no
small,big,small,light,no,yes,fruit,expensive,yes
small,big,medium,light,yes,no,clothes,expensive,no
big,medium,big,heavy,yes,no,nuclear_waste,cheap,no
big,small,small,light,yes,no,car_parts,cheap,no
big,small,medium,medium-heavy,yes,no,fruit,cheap,no
big,medium,medium,heavy,yes,no,clothes,cheap,no
medium,big,big,light,no,no,car_parts,expensive,no
big,small,big,light,yes,yes,nuclear_waste,expensive,no
medium,small,small,medium-heavy,yes,yes,car_parts,cheap,no
small,big,small,heavy,no,yes,nuclear_waste,cheap,yes
small,big,big,medium,no,yes,fruit,cheap,yes
medium,medium,medium,medium-heavy,no,yes,clothes,expensive,yes
big,small,big,light,no,yes,car_parts,expensive,yes
medium,medium,medium,heavy,yes,yes,nuclear_waste,cheap,no
small,medium,big,heavy,no,no,car_parts,expensive,no
big,small,small,medium-heavy,no,no,fruit,cheap,no
medium,small,medium,medium-heavy,yes,yes,nuclear_waste,expensive,no
small,small,big,light,no,yes,car_parts,expensive,yes
medium,big,small,medium-heavy,yes,no,car_parts,cheap,no
big,medium,small,medium,no,no,car_parts,cheap,no
medium,big,big,light,no,no,clothes,cheap,no
big,big,small,medium-heavy,no,yes,nuclear_waste,expensive,yes
medium,medium,small,medium-heavy,no,yes,nuclear_waste,cheap,yes
small,small,medium,heavy,no,no,nuclear_waste,cheap,yes
medium,medium,big,medium-heavy,no,yes,fruit,cheap,yes
medium,big,medium,heavy,no,no,nuclear_waste,expensive,no
medium,small,big,light,no,yes,car_parts,cheap,yes
small,small,small,heavy,yes,yes,clothes,cheap,yes
small,small,big,heavy,yes,yes,nuclear_waste,expensive,no
medium,big,big,medium,yes,yes,car_parts,expensive,no
medium,small,medium,medium,no,no,fruit,expensive,no
big,small,small,medium-heavy,no,no,fruit,cheap,no
big,medium,small,light,yes,no,nuclear_waste,expensive,no
small,medium,small,heavy,yes,yes,fruit,cheap,yes
medium,medium,big,medium-heavy,no,yes,nuclear_waste,cheap,yes
big,medium,medium,medium,yes,yes,car_parts,cheap,no
big,big,small,medium-heavy,yes,yes,nuclear_waste,expensive,no
medium,small,medium,light,no,no,clothes,expensive,no
big,big,small,medium-heavy,yes,no,nuclear_waste,expensive,no
big,big,small,light,yes,no,clothes,cheap,no
small,small,medium,medium-heavy,yes,yes,nuclear_waste,cheap,yes
small,big,small,medium,no,yes,fruit,expensive,yes
big,medium,medium,medium-heavy,yes,no,fruit,cheap,no
small,big,small,heavy,no,yes,clothes,expensive,yes
big,big,small,heavy,no,yes,clothes,cheap,yes
big,medium,small,medium,no,yes,nuclear_waste,expensive,yes
small,big,big,light,yes,yes,clothes,expensive,no
big,big,medium,medium,no,no,car_parts,cheap,no
big,medium,big,light,no,no,car_parts,expensive,no
big,small,small,light,no,yes,fruit,expensive,yes
small,big,medium,medium-heavy,yes,no,fruit,expensive,no
small,big,big,medium,yes,no,clothes,expensive,no
medium,small,big,light,yes,no,fruit,expensive,no
small,medium,small,medium-heavy,yes,no,nuclear_waste,expensive,yes
medium,big,medium,heavy,no,yes,clothes,expensive,yes
medium,small,small,medium-heavy,no,no,nuclear_waste,cheap,no
small,small,medium,medium-heavy,yes,yes,clothes,expensive,yes
small,big,small,medium-heavy,yes,no,clothes,cheap,no
big,big,medium,medium,yes,no,fruit,expensive,no
small,small,medium,light,yes,no,clothes,cheap,yes
small,small,small,medium-heavy,yes,yes,car_parts,expensive,yes
big,medium,small,medium,yes,yes,fruit,expensive,no
medium,small,big,medium-heavy,no,no,fruit,cheap,no
small,big,big,heavy,yes,no,clothes,expensive,no
small,medium,medium,medium-heavy,yes,yes,nuclear_waste,cheap,yes
big,medium,medium,heavy,no,yes,nuclear_waste,cheap,yes
medium,big,big,heavy,yes,no,nuclear_waste,expensive,no
medium,medium,small,medium-heavy,no,no,car_parts,cheap,no
small,big,big,medium-heavy,yes,no,clothes,expensive,no
small,big,big,heavy,no,no,clothes,expensive,no
big,big,small,medium,no,no,clothes,expensive,no
medium,small,medium,light,no,yes,car_parts,expensive,yes
big,medium,big,heavy,yes,yes,car_parts,expensive,no
small,big,medium,medium-heavy,no,yes,car_parts,expensive,yes
medium,medium,small,medium-heavy,no,yes,fruit,cheap,yes
big,small,medium,medium,yes,no,nuclear_waste,expensive,no
small,big,small,light,yes,yes,fruit,expensive,no
1 Height Width Depth Weight Damage Label_State Content Value Acceptance
2 medium big medium medium yes no fruit cheap no
3 small small small heavy no yes clothes cheap yes
4 medium big medium light no yes car_parts expensive yes
5 medium big small heavy yes yes nuclear_waste expensive no
6 medium big medium heavy yes yes nuclear_waste cheap no
7 big medium medium medium yes yes car_parts expensive no
8 big small medium medium no yes fruit cheap yes
9 big small medium medium-heavy no yes car_parts expensive yes
10 medium big medium medium no no clothes cheap no
11 small big medium medium no yes nuclear_waste expensive yes
12 medium medium small light yes no clothes expensive no
13 big small big medium no yes car_parts cheap yes
14 medium small small medium-heavy yes no fruit expensive no
15 big big medium heavy yes no fruit expensive no
16 big medium small medium-heavy no no fruit expensive no
17 medium medium big heavy no no nuclear_waste cheap no
18 medium small big medium-heavy yes no car_parts expensive no
19 small medium medium light no yes car_parts expensive yes
20 medium small small heavy yes yes nuclear_waste cheap no
21 small big small medium yes yes car_parts expensive no
22 medium small big medium-heavy no yes car_parts cheap yes
23 big medium medium medium yes no car_parts cheap no
24 big small small medium no yes clothes expensive yes
25 medium big big light yes no car_parts expensive no
26 medium big medium medium yes no clothes expensive no
27 big big medium light no no nuclear_waste cheap no
28 big small big medium-heavy yes yes fruit expensive no
29 medium small small medium yes no car_parts cheap no
30 small big big medium-heavy no yes car_parts expensive yes
31 medium medium big medium yes yes car_parts expensive no
32 medium medium big light no no fruit expensive no
33 medium medium medium medium no yes nuclear_waste expensive yes
34 big small big medium-heavy no yes car_parts cheap yes
35 medium medium big light no yes clothes expensive yes
36 medium small small light yes yes fruit expensive no
37 big medium medium light yes yes nuclear_waste expensive no
38 big small small medium-heavy no no nuclear_waste expensive no
39 big big big medium-heavy no yes fruit cheap yes
40 medium small small medium yes yes nuclear_waste expensive no
41 small small medium medium-heavy yes yes clothes cheap yes
42 big small big medium no yes fruit cheap yes
43 medium small small light yes yes nuclear_waste expensive no
44 medium big big medium-heavy no no car_parts cheap no
45 medium big small light no yes car_parts expensive yes
46 small medium medium heavy yes yes fruit cheap yes
47 big small big heavy no no clothes cheap no
48 big big big heavy no yes car_parts cheap yes
49 medium big big light no yes car_parts cheap yes
50 small small big light yes no fruit expensive no
51 medium medium small medium yes yes clothes expensive no
52 small medium big medium yes yes fruit expensive no
53 small big medium heavy yes yes clothes cheap no
54 small small big heavy no no fruit expensive no
55 small small big medium yes yes car_parts cheap no
56 small small big medium yes no clothes expensive no
57 medium small big light yes no car_parts cheap no
58 big medium medium medium no yes nuclear_waste expensive yes
59 small big small light no no car_parts cheap no
60 medium medium big heavy yes no fruit expensive no
61 small big small medium no no fruit cheap no
62 big medium big light yes yes nuclear_waste expensive no
63 small medium big light yes no clothes cheap no
64 medium small big heavy yes no nuclear_waste cheap no
65 big medium small medium yes no car_parts expensive no
66 big medium big medium no no nuclear_waste expensive no
67 medium big medium medium no yes clothes cheap yes
68 medium big big light yes yes clothes cheap no
69 small medium medium light yes no nuclear_waste cheap yes
70 medium medium big medium yes no nuclear_waste expensive no
71 small medium small medium-heavy yes no clothes cheap yes
72 medium medium small medium-heavy yes no car_parts expensive no
73 medium small small light no no car_parts expensive no
74 small medium medium light no yes fruit expensive yes
75 small big big medium no yes clothes expensive yes
76 small medium small heavy no no car_parts cheap yes
77 small big small heavy yes no clothes expensive no
78 medium big big medium-heavy yes no fruit expensive no
79 medium medium small medium-heavy yes yes clothes expensive no
80 small medium big medium-heavy yes yes clothes expensive no
81 medium big medium heavy yes no clothes expensive no
82 medium medium small medium yes no nuclear_waste expensive no
83 small big medium medium no no nuclear_waste cheap no
84 small medium medium light yes yes car_parts cheap yes
85 big small small light yes yes fruit expensive no
86 medium medium big heavy no yes clothes cheap yes
87 big small big medium-heavy yes no car_parts expensive no
88 big medium medium light yes no fruit expensive no
89 big medium small medium yes yes clothes cheap no
90 medium medium small heavy no no nuclear_waste cheap no
91 small small big heavy yes no fruit cheap no
92 medium big big heavy yes no car_parts expensive no
93 small small small medium no yes clothes expensive yes
94 small big medium medium yes yes car_parts expensive no
95 big small medium medium-heavy yes yes nuclear_waste cheap no
96 medium small small heavy yes no nuclear_waste expensive no
97 small medium medium medium no yes clothes cheap yes
98 medium medium small medium-heavy no yes fruit cheap yes
99 medium small big heavy yes yes fruit expensive no
100 big small medium medium no yes nuclear_waste expensive yes
101 big medium medium medium-heavy yes yes nuclear_waste expensive no
102 big small small light no no clothes expensive no
103 medium medium medium medium-heavy yes yes car_parts cheap no
104 big big big heavy no no fruit expensive no
105 small big big medium-heavy yes no fruit cheap no
106 medium medium big medium yes yes fruit expensive no
107 big big medium heavy yes no fruit expensive no
108 big small small heavy no no fruit cheap no
109 medium medium big light yes no clothes expensive no
110 big big medium heavy yes yes clothes expensive no
111 small medium medium medium-heavy yes no nuclear_waste expensive yes
112 medium medium medium medium-heavy no yes fruit cheap yes
113 small small medium medium-heavy yes yes car_parts expensive yes
114 small medium small heavy no yes fruit cheap yes
115 big small big medium-heavy yes yes nuclear_waste expensive no
116 medium medium big heavy yes yes nuclear_waste cheap no
117 small big medium medium-heavy yes yes clothes cheap no
118 big medium big medium no yes car_parts expensive yes
119 big small big heavy no yes nuclear_waste expensive yes
120 big small big medium-heavy no no nuclear_waste cheap no
121 small medium medium light no yes car_parts expensive yes
122 big medium small light yes yes nuclear_waste expensive no
123 small medium big medium yes no fruit cheap no
124 big small small medium-heavy yes yes fruit cheap no
125 small big small light no yes fruit expensive yes
126 small big medium light yes no clothes expensive no
127 big medium big heavy yes no nuclear_waste cheap no
128 big small small light yes no car_parts cheap no
129 big small medium medium-heavy yes no fruit cheap no
130 big medium medium heavy yes no clothes cheap no
131 medium big big light no no car_parts expensive no
132 big small big light yes yes nuclear_waste expensive no
133 medium small small medium-heavy yes yes car_parts cheap no
134 small big small heavy no yes nuclear_waste cheap yes
135 small big big medium no yes fruit cheap yes
136 medium medium medium medium-heavy no yes clothes expensive yes
137 big small big light no yes car_parts expensive yes
138 medium medium medium heavy yes yes nuclear_waste cheap no
139 small medium big heavy no no car_parts expensive no
140 big small small medium-heavy no no fruit cheap no
141 medium small medium medium-heavy yes yes nuclear_waste expensive no
142 small small big light no yes car_parts expensive yes
143 medium big small medium-heavy yes no car_parts cheap no
144 big medium small medium no no car_parts cheap no
145 medium big big light no no clothes cheap no
146 big big small medium-heavy no yes nuclear_waste expensive yes
147 medium medium small medium-heavy no yes nuclear_waste cheap yes
148 small small medium heavy no no nuclear_waste cheap yes
149 medium medium big medium-heavy no yes fruit cheap yes
150 medium big medium heavy no no nuclear_waste expensive no
151 medium small big light no yes car_parts cheap yes
152 small small small heavy yes yes clothes cheap yes
153 small small big heavy yes yes nuclear_waste expensive no
154 medium big big medium yes yes car_parts expensive no
155 medium small medium medium no no fruit expensive no
156 big small small medium-heavy no no fruit cheap no
157 big medium small light yes no nuclear_waste expensive no
158 small medium small heavy yes yes fruit cheap yes
159 medium medium big medium-heavy no yes nuclear_waste cheap yes
160 big medium medium medium yes yes car_parts cheap no
161 big big small medium-heavy yes yes nuclear_waste expensive no
162 medium small medium light no no clothes expensive no
163 big big small medium-heavy yes no nuclear_waste expensive no
164 big big small light yes no clothes cheap no
165 small small medium medium-heavy yes yes nuclear_waste cheap yes
166 small big small medium no yes fruit expensive yes
167 big medium medium medium-heavy yes no fruit cheap no
168 small big small heavy no yes clothes expensive yes
169 big big small heavy no yes clothes cheap yes
170 big medium small medium no yes nuclear_waste expensive yes
171 small big big light yes yes clothes expensive no
172 big big medium medium no no car_parts cheap no
173 big medium big light no no car_parts expensive no
174 big small small light no yes fruit expensive yes
175 small big medium medium-heavy yes no fruit expensive no
176 small big big medium yes no clothes expensive no
177 medium small big light yes no fruit expensive no
178 small medium small medium-heavy yes no nuclear_waste expensive yes
179 medium big medium heavy no yes clothes expensive yes
180 medium small small medium-heavy no no nuclear_waste cheap no
181 small small medium medium-heavy yes yes clothes expensive yes
182 small big small medium-heavy yes no clothes cheap no
183 big big medium medium yes no fruit expensive no
184 small small medium light yes no clothes cheap yes
185 small small small medium-heavy yes yes car_parts expensive yes
186 big medium small medium yes yes fruit expensive no
187 medium small big medium-heavy no no fruit cheap no
188 small big big heavy yes no clothes expensive no
189 small medium medium medium-heavy yes yes nuclear_waste cheap yes
190 big medium medium heavy no yes nuclear_waste cheap yes
191 medium big big heavy yes no nuclear_waste expensive no
192 medium medium small medium-heavy no no car_parts cheap no
193 small big big medium-heavy yes no clothes expensive no
194 small big big heavy no no clothes expensive no
195 big big small medium no no clothes expensive no
196 medium small medium light no yes car_parts expensive yes
197 big medium big heavy yes yes car_parts expensive no
198 small big medium medium-heavy no yes car_parts expensive yes
199 medium medium small medium-heavy no yes fruit cheap yes
200 big small medium medium yes no nuclear_waste expensive no
201 small big small light yes yes fruit expensive no

View File

@ -6,6 +6,9 @@ import time
from collections import deque from collections import deque
import heapq import heapq
from classes import * from classes import *
import numpy as np
import pandas as pd
import math
class Node(): class Node():
def __init__(self,position,rotation,action,parent,cost): def __init__(self,position,rotation,action,parent,cost):
@ -331,6 +334,27 @@ def astar(isstate,final):
p=new_cost+distance(successor,final) p=new_cost+distance(successor,final)
heapq.heappush(fringe,(p,successor)) heapq.heappush(fringe,(p,successor))
#drzewko
tree_data_base = pd.read_csv('paczki.csv')
def entropy(data):
labels = data.iloc[:, -1] # Ostatnia kolumna zawiera etykiety klas i pomija 1 wiersz bo jest tytulowy
counts = labels.value_counts() #tu zlicza wszystkie opcje
probabilities = counts / len(labels)
entropy = -sum(probabilities * np.log2(probabilities))
return entropy
def information_gain(data, attribute):
total_entropy = entropy(data)
values = data[attribute].unique() #przypisujemy wszystkie opcje danego atrybutu np wyoski/niski/sredni
weighted_entropy = 0
for value in values:
subset = data[data[attribute] == value] # przypisujesz wszystkie wiersze danego value do subset
subset_entropy = entropy(subset)
weighted_entropy += (len(subset) / len(data)) * subset_entropy
return (total_entropy - weighted_entropy)
# Main game loop # Main game loop
def game_loop(): def game_loop():