Tree - Final?

This commit is contained in:
Mirrowel 2023-05-26 01:29:28 +02:00
parent 0c34087424
commit 0c096589d7
8 changed files with 606 additions and 304 deletions

3
.gitignore vendored
View File

@ -59,3 +59,6 @@ Pipfile
Pipfile.lock
decision_tree
decision_tree.pdf
Source.gv.pdf
Source.gv
decision_tree.txt

View File

@ -5,35 +5,34 @@ import graphviz
import os
os.environ["PATH"] += os.pathsep + 'C:/Program Files (x86)/Graphviz/bin/'
# Define the training dataset with 8 attributes and corresponding labels
#train_data_m = pd.read_csv("dataset.csv") #importing the dataset from the disk
train_data_m=np.genfromtxt("dataset.csv", delimiter=",",skip_header=1);
#print(train_data_m)
# print(train_data_m) #viewing some row of the dataset
#importing the dataset from the disk
train_data_m=np.genfromtxt("dataset/converted_dataset.csv", delimiter=",",skip_header=1);
# Separate the attributes and labels
#X_train = [data[:-1] for data in training_data]
#y_train = [data[-1] for data in training_data]
X_train = [data[:-1] for data in train_data_m]
y_train = [data[-1] for data in train_data_m]
#X_train = pd.get_dummies(data[:-1] for data in train_data_m)
#print(X_train)
#print(y_train)
# Create the decision tree classifier using the ID3 algorithm
clf = tree.DecisionTreeClassifier(criterion='entropy')
#clf = tree.DecisionTreeClassifier(criterion='gini')
# Train the decision tree on the training data
clf.fit(X_train, y_train)
# Visualize the trained decision tree
dot_data = tree.export_graphviz(clf, out_file=None, feature_names=['Attr1', 'Attr2', 'Attr3', 'Attr4', 'Attr5', 'Attr6', 'Attr7'], class_names=['YES', 'NO'], filled=True)
tree_text = tree.export_text(clf,feature_names=['Battery Charge', 'Fullness', 'Ready orders', 'Waiting tables','Availability', 'Cleanliness', 'Error'])
with open('decision_tree.txt', 'w') as f:
f.write(tree_text) # Save the visualization as a text file
dot_data = tree.export_graphviz(clf, out_file=None, feature_names=['Battery Charge', 'Fullness', 'Ready orders', 'Waiting tables','Availability', 'Cleanliness', 'Error'], class_names=['NO', 'YES'], filled=True,rounded=True)
graph = graphviz.Source(dot_data)
graph.render("decision_tree") # Save the visualization as a PDF file
# Test the decision tree with a new example
#new_example = [1, 0, 0, 1, 1, 0, 0, 1] # Example with 8 attributes
new_example = [2, 0, 0, 1, 1 ,2, 1] # Example with 8 attributes
#Battery Charge,Fullness,Ready orders,Waiting tables,Availability,Cleanliness,Error
new_example = [2, 0, 1, 1, 1 ,2, 0]
predicted_label = clf.predict([new_example])
print("Predicted Label:", predicted_label[0])
if predicted_label[0]>0:
result="YES"
else:
result="NO"
print("Predicted Label:", result)

View File

@ -1,288 +0,0 @@
3,1,1,1,1,3,1,0
3,1,1,1,1,3,0,0
3,1,1,1,1,2,1,0
3,1,1,1,1,2,0,0
3,1,1,1,1,1,1,0
3,1,1,1,1,1,0,0
3,1,1,1,0,3,1,0
3,1,1,1,0,3,0,0
3,1,1,1,0,2,1,0
3,1,1,1,0,2,0,0
3,1,1,1,0,1,1,0
3,1,1,1,0,1,0,0
3,1,1,0,1,3,1,0
3,1,1,0,1,3,0,0
3,1,1,0,1,2,1,0
3,1,1,0,1,2,0,0
3,1,1,0,1,1,1,0
3,1,1,0,1,1,0,0
3,1,1,0,0,3,1,0
3,1,1,0,0,3,0,0
3,1,1,0,0,2,1,0
3,1,1,0,0,2,0,0
3,1,1,0,0,1,1,0
3,1,1,0,0,1,0,0
3,1,0,1,1,3,1,0
3,1,0,1,1,3,0,0
3,1,0,1,1,2,1,0
3,1,0,1,1,2,0,0
3,1,0,1,1,1,1,0
3,1,0,1,1,1,0,0
3,1,0,1,0,3,1,0
3,1,0,1,0,3,0,0
3,1,0,1,0,2,1,0
3,1,0,1,0,2,0,0
3,1,0,1,0,1,1,0
3,1,0,1,0,1,0,0
3,1,0,0,1,3,1,0
3,1,0,0,1,3,0,0
3,1,0,0,1,2,1,0
3,1,0,0,1,2,0,0
3,1,0,0,1,1,1,0
3,1,0,0,1,1,0,0
3,1,0,0,0,3,1,0
3,1,0,0,0,3,0,0
3,1,0,0,0,2,1,0
3,1,0,0,0,2,0,0
3,1,0,0,0,1,1,0
3,1,0,0,0,1,0,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0
129 2 1 0 1 0 2 1 0
130 2 1 0 1 0 2 0 0
131 2 1 0 1 0 1 1 0
132 2 1 0 1 0 1 0 0
133 2 1 0 0 1 3 1 0
134 2 1 0 0 1 3 0 0
135 2 1 0 0 1 2 1 0
136 2 1 0 0 1 2 0 0
137 2 1 0 0 1 1 1 0
138 2 1 0 0 1 1 0 0
139 2 1 0 0 0 3 1 0
140 2 1 0 0 0 3 0 0
141 2 1 0 0 0 2 1 0
142 2 1 0 0 0 2 0 0
143 2 1 0 0 0 1 1 0
144 2 1 0 0 0 1 0 0
145 2 0 1 1 1 3 1 0
146 2 0 1 1 1 3 0 0
147 2 0 1 1 1 2 1 0
148 2 0 1 1 1 2 0 0
149 2 0 1 1 1 1 1 0
150 2 0 1 1 1 1 0 0
151 2 0 1 1 0 3 1 0
152 2 0 1 1 0 3 0 0
153 2 0 1 1 0 2 1 0
154 2 0 1 1 0 2 0 0
155 2 0 1 1 0 1 1 0
156 2 0 1 1 0 1 0 0
157 2 0 1 0 1 3 1 0
158 2 0 1 0 1 3 0 0
159 2 0 1 0 1 2 1 0
160 2 0 1 0 1 2 0 0
161 2 0 1 0 1 1 1 0
162 2 0 1 0 1 1 0 0
163 2 0 1 0 0 3 1 0
164 2 0 1 0 0 3 0 0
165 2 0 1 0 0 2 1 0
166 2 0 1 0 0 2 0 0
167 2 0 1 0 0 1 1 0
168 2 0 1 0 0 1 0 0
169 2 0 0 1 1 3 1 0
170 2 0 0 1 1 3 0 0
171 2 0 0 1 1 2 1 0
172 2 0 0 1 1 2 0 1
173 2 0 0 1 1 1 1 0
174 2 0 0 1 1 1 0 1
175 2 0 0 1 0 3 1 0
176 2 0 0 1 0 3 0 0
177 2 0 0 1 0 2 1 0
178 2 0 0 1 0 2 0 0
179 2 0 0 1 0 1 1 0
180 2 0 0 1 0 1 0 0
181 2 0 0 0 1 3 1 0
182 2 0 0 0 1 3 0 0
183 2 0 0 0 1 2 1 0
184 2 0 0 0 1 2 0 1
185 2 0 0 0 1 1 1 0
186 2 0 0 0 1 1 0 1
187 2 0 0 0 0 3 1 0
188 2 0 0 0 0 3 0 0
189 2 0 0 0 0 2 1 1
190 2 0 0 0 0 2 0 1
191 2 0 0 0 0 1 1 1
192 2 0 0 0 0 1 0 1
193 1 1 1 1 1 3 1 0
194 1 1 1 1 1 3 0 0
195 1 1 1 1 1 2 1 0
196 1 1 1 1 1 2 0 0
197 1 1 1 1 1 1 1 0
198 1 1 1 1 1 1 0 0
199 1 1 1 1 0 3 1 0
200 1 1 1 1 0 3 0 0
201 1 1 1 1 0 2 1 0
202 1 1 1 1 0 2 0 0
203 1 1 1 1 0 1 1 0
204 1 1 1 1 0 1 0 0
205 1 1 1 0 1 3 1 0
206 1 1 1 0 1 3 0 0
207 1 1 1 0 1 2 1 0
208 1 1 1 0 1 2 0 0
209 1 1 1 0 1 1 1 0
210 1 1 1 0 1 1 0 0
211 1 1 1 0 0 3 1 0
212 1 1 1 0 0 3 0 0
213 1 1 1 0 0 2 1 0
214 1 1 1 0 0 2 0 0
215 1 1 1 0 0 1 1 0
216 1 1 1 0 0 1 0 0
217 1 1 0 1 1 3 1 0
218 1 1 0 1 1 3 0 0
219 1 1 0 1 1 2 1 0
220 1 1 0 1 1 2 0 0
221 1 1 0 1 1 1 1 0
222 1 1 0 1 1 1 0 0
223 1 1 0 1 0 3 1 0
224 1 1 0 1 0 3 0 0
225 1 1 0 1 0 2 1 0
226 1 1 0 1 0 2 0 0
227 1 1 0 1 0 1 1 0
228 1 1 0 1 0 1 0 0
229 1 1 0 0 1 3 1 0
230 1 1 0 0 1 3 0 0
231 1 1 0 0 1 2 1 0
232 1 1 0 0 1 2 0 0
233 1 1 0 0 1 1 1 0
234 1 1 0 0 1 1 0 0
235 1 1 0 0 0 3 1 0
236 1 1 0 0 0 3 0 0
237 1 1 0 0 0 2 1 0
238 1 1 0 0 0 2 0 0
239 1 1 0 0 0 1 1 0
240 1 1 0 0 0 1 0 0
241 1 0 1 1 1 3 1 0
242 1 0 1 1 1 3 0 0
243 1 0 1 1 1 2 1 0
244 1 0 1 1 1 2 0 0
245 1 0 1 1 1 1 1 0
246 1 0 1 1 1 1 0 0
247 1 0 1 1 0 3 1 0
248 1 0 1 1 0 3 0 0
249 1 0 1 1 0 2 1 0
250 1 0 1 1 0 2 0 0
251 1 0 1 1 0 1 1 0
252 1 0 1 1 0 1 0 0
253 1 0 1 0 1 3 1 0
254 1 0 1 0 1 3 0 0
255 1 0 1 0 1 2 1 0
256 1 0 1 0 1 2 0 0
257 1 0 1 0 1 1 1 0
258 1 0 1 0 1 1 0 0
259 1 0 1 0 0 3 1 0
260 1 0 1 0 0 3 0 0
261 1 0 1 0 0 2 1 0
262 1 0 1 0 0 2 0 0
263 1 0 1 0 0 1 1 0
264 1 0 1 0 0 1 0 0
265 1 0 0 1 1 3 1 0
266 1 0 0 1 1 3 0 0
267 1 0 0 1 1 2 1 0
268 1 0 0 1 1 2 0 0
269 1 0 0 1 1 1 1 0
270 1 0 0 1 1 1 0 0
271 1 0 0 1 0 3 1 0
272 1 0 0 1 0 3 0 0
273 1 0 0 1 0 2 1 0
274 1 0 0 1 0 2 0 0
275 1 0 0 1 0 1 1 0
276 1 0 0 1 0 1 0 0
277 1 0 0 0 1 3 1 0
278 1 0 0 0 1 3 0 0
279 1 0 0 0 1 2 1 0
280 1 0 0 0 1 2 0 0
281 1 0 0 0 1 1 1 0
282 1 0 0 0 1 1 0 0
283 1 0 0 0 0 3 1 0
284 1 0 0 0 0 3 0 0
285 1 0 0 0 0 2 1 0
286 1 0 0 0 0 2 0 0
287 1 0 0 0 0 1 1 0
288 1 0 0 0 0 1 0 0

201
dataset/Dataset.csv Normal file
View File

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

View File

@ -0,0 +1,200 @@
3,1,0,0,1,0,1,0
1,1,0,0,0,1,1,0
3,1,0,0,0,1,0,0
2,0,0,0,0,0,0,0
3,1,0,0,1,1,0,0
1,1,0,1,0,1,1,0
2,0,0,1,0,2,1,0
2,1,0,1,1,0,1,0
2,1,1,0,0,0,1,0
3,0,0,0,0,1,1,0
2,0,0,1,0,1,1,0
1,0,1,0,1,2,0,0
3,1,1,0,1,0,1,0
2,1,0,1,1,0,0,0
2,1,0,1,1,1,0,1
0,1,0,0,0,2,1,0
1,1,0,0,0,1,0,0
1,1,1,0,0,0,0,0
2,0,0,1,0,1,0,0
1,0,1,1,0,1,0,0
2,0,1,1,0,1,1,0
1,0,0,0,0,2,0,0
2,1,1,1,0,1,1,0
3,0,1,0,1,1,0,1
0,0,1,1,0,0,1,0
3,0,0,0,0,2,1,0
2,0,1,1,1,1,0,1
2,1,1,1,1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 0 1 1 1 0 1 0
133 0 1 0 0 0 0 0 0
134 3 1 0 1 0 1 1 0
135 3 0 1 0 0 1 0 0
136 0 0 1 0 1 2 1 0
137 3 0 1 0 0 1 1 0
138 0 0 0 0 0 1 0 0
139 3 0 0 1 1 2 0 0
140 2 0 0 0 0 0 1 0
141 2 1 1 0 0 2 0 0
142 3 1 0 0 0 0 0 0
143 3 0 0 0 0 1 0 0
144 2 1 1 0 1 0 0 0
145 3 0 0 0 1 2 1 0
146 0 1 1 1 1 2 0 0
147 2 1 1 1 0 0 0 0
148 0 1 1 0 1 1 0 0
149 0 1 1 1 0 1 1 0
150 0 0 1 0 1 2 0 0
151 1 0 0 0 1 2 1 0
152 0 1 0 1 0 1 1 0
153 2 1 0 1 0 1 1 0
154 2 1 1 0 1 0 1 0
155 2 1 1 0 0 2 1 0
156 2 1 1 1 1 2 0 1
157 2 1 0 0 1 0 0 0
158 3 1 0 1 1 2 0 1
159 1 0 1 1 0 0 1 0
160 1 1 0 1 0 2 1 0
161 2 1 1 1 1 2 1 0
162 3 1 1 1 1 0 0 0
163 2 1 0 0 0 2 1 0
164 2 1 0 1 0 2 0 0
165 3 0 0 1 0 2 1 0
166 0 0 0 1 1 1 0 0
167 0 0 1 0 0 2 0 0
168 3 0 1 1 0 2 1 0
169 2 0 1 1 0 0 1 0
170 2 1 0 0 0 0 0 0
171 3 0 0 0 1 0 0 0
172 3 1 1 0 0 1 0 0
173 3 1 1 0 0 0 1 0
174 0 0 1 1 1 0 1 0
175 3 0 0 0 0 0 1 0
176 2 0 0 0 1 0 0 0
177 1 1 0 1 0 1 0 0
178 1 1 0 1 1 2 1 0
179 3 1 0 1 0 2 1 0
180 2 1 0 1 1 1 1 0
181 0 0 0 1 0 2 1 0
182 2 0 1 0 0 1 1 0
183 0 0 0 1 0 0 1 0
184 3 0 0 1 0 1 0 0
185 2 0 1 0 1 0 1 0
186 2 1 1 1 1 1 0 1
187 3 1 1 0 0 1 1 0
188 3 1 1 1 0 1 0 0
189 1 1 1 0 1 1 0 0
190 2 0 1 0 0 2 1 0
191 2 0 1 0 1 1 1 0
192 3 0 0 0 1 2 0 0
193 0 1 1 0 0 2 1 0
194 1 0 1 0 0 0 1 0
195 0 1 1 1 1 0 1 0
196 2 0 1 1 0 1 0 0
197 2 0 0 0 0 2 0 0
198 2 1 1 1 0 1 0 0
199 0 1 1 1 1 1 0 0
200 1 0 1 0 1 0 0 0

View File

@ -0,0 +1,54 @@
import csv
def convert_dataset(input_file, output_file):
attributes = {
1: ["empty", "low", "medium", "high"],
2: ["empty", "full"],
3: ["none", "available"],
4: ["none", "available"],
5: ["unavailable", "available"],
6: ["low", "medium", "high"],
7: ["no", "yes"],
8: ["no", "yes"]
}
# Create a mapping dictionary for attribute values
mapping = {}
for attr, values in attributes.items():
mapping[attr] = {value: index for index, value in enumerate(values)}
converted_dataset = []
# Read the input CSV file
with open(input_file, "r") as csvfile:
reader = csv.reader(csvfile)
header = next(reader) # Skip the header row
# Convert the data rows
for row in reader:
converted_row = []
for i, value in enumerate(row):
# Convert the attribute values
if i + 1 in mapping:
converted_value = mapping[i + 1][value]
else:
converted_value = value
converted_row.append(converted_value)
converted_dataset.append(converted_row)
# Write the converted dataset to a new CSV file
with open(output_file, "w", newline="") as csvfile:
writer = csv.writer(csvfile)
# Write the header row
#writer.writerow(header)
# Write the converted data rows
for row in converted_dataset:
writer.writerow(row)
# Example usage:
convert_dataset("dataset/Dataset.csv", "dataset/converted_dataset.csv")

View File

@ -0,0 +1,57 @@
import random
import csv
attributes = {
1: ["empty", "low", "medium", "high"],
2: ["empty", "full"],
3: ["none", "available"],
4: ["none", "available"],
5: ["unavailable", "available"],
6: ["low", "medium", "high"],
7: ["no", "yes"],
8: ["no", "yes"]
}
dataset = []
while len(dataset) < 200:
data = {}
# Generate random values for attributes 1-7
for attr in range(1, 8):
data[attr] = random.choice(attributes[attr])
# Apply the rules to determine the value of attribute 8
if data[1] in ["empty", "low"]:
data[8] = "no"
elif data[2] == "full" and data[4] == "none":
data[8] = "no"
elif data[2] == "empty" and data[3] == "none":
data[8] = "no"
elif data[3] == "none" and data[4] == "none":
data[8] = "no"
elif data[5] == "unavailable":
data[8] = "no"
elif data[6] == "low":
data[8] = "no"
elif data[7] == "yes":
data[8] = "no"
else:
data[8] = "yes"
# Check if the generated data already exists in the dataset
if data not in dataset:
dataset.append(data)
# Print the generated dataset
for data in dataset:
print(data)
with open("dataset/Dataset.csv", "w", newline="") as csvfile:
writer = csv.writer(csvfile)
# Write the header row
writer.writerow(["Battery Charge", "Fullness", "Ready orders", "Waiting tables","Availability", "Cleanliness", "Error", "To go"])
# Write the data rows
for data in dataset:
row = [data[attr] for attr in range(1, 9)]
writer.writerow(row)

View File

@ -6,6 +6,12 @@ class Waiter(Object):
def __init__(self, position, orientation, square_size, screen_size, basket=[]):
super().__init__("waiter", position, orientation, square_size, screen_size)
self.basket_size = 2
self.battery=2
self.orderReadiness=1
self.waitingTables=1
self.availability=1
self.cleanliness=2
self.error=1
self.basket = basket
self.prev_position = copy.deepcopy(self.position)
self.prev_orientation = copy.copy(self.orientation)
@ -14,8 +20,78 @@ class Waiter(Object):
self.position = copy.deepcopy(state.position)
self.orientation = copy.copy(state.orientation)
self.basket = copy.copy(state.basket)
self.calcTree()
return state
def calcTree(self):
from sklearn import tree
import pandas as pd #for manipulating the csv data
import numpy as np
import os
train_data_m=np.genfromtxt("dataset/converted_dataset.csv", delimiter=",",skip_header=1); #importing the dataset from the disk
X_train = [data[:-1] for data in train_data_m]
y_train = [data[-1] for data in train_data_m]
# Create the decision tree classifier using the ID3 algorithm
clf = tree.DecisionTreeClassifier(criterion='entropy')
# Train the decision tree on the training data
clf.fit(X_train, y_train)
# Visualize the trained decision tree
tree_text = tree.export_text(clf,feature_names=['Battery Charge', 'Fullness', 'Ready orders', 'Waiting tables','Availability', 'Cleanliness', 'Error'])
with open('decision_tree.txt', 'w') as f:
f.write(tree_text) # Save the visualization as a text file
# Test the decision tree with a new example
#Battery Charge,Fullness,Ready orders,Waiting tables,Availability,Cleanliness,Error
new_example = [self.battery, 0,self.orderReadiness,self.waitingTables,self.availability, self.cleanliness, self.error]
predicted_label = clf.predict([new_example])
if predicted_label[0]>0:
result="YES"
else:
result="NO"
print("Predicted Label:", result)
def calcTreePDF(self):
from sklearn import tree
import pandas as pd #for manipulating the csv data
import numpy as np
import graphviz
import os
os.environ["PATH"] += os.pathsep + 'C:/Program Files (x86)/Graphviz/bin/'
train_data_m=np.genfromtxt("dataset/converted_dataset.csv", delimiter=",",skip_header=1); #importing the dataset from the disk
X_train = [data[:-1] for data in train_data_m]
y_train = [data[-1] for data in train_data_m]
# Create the decision tree classifier using the ID3 algorithm
clf = tree.DecisionTreeClassifier(criterion='entropy')
# Train the decision tree on the training data
clf.fit(X_train, y_train)
# Visualize the trained decision tree
tree_text = tree.export_text(clf,feature_names=['Battery Charge', 'Fullness', 'Ready orders', 'Waiting tables','Availability', 'Cleanliness', 'Error'])
with open('decision_tree.txt', 'w') as f:
f.write(tree_text) # Save the visualization as a text file
dot_data = tree.export_graphviz(clf, out_file=None, feature_names=['Battery Charge', 'Fullness', 'Ready orders', 'Waiting tables','Availability', 'Cleanliness', 'Error'], class_names=['NO', 'YES'], filled=True,rounded=True)
graph = graphviz.Source(dot_data)
graph.render("decision_tree") # Save the visualization as a PDF file
# Test the decision tree with a new example
#Battery Charge,Fullness,Ready orders,Waiting tables,Availability,Cleanliness,Error
new_example = [self.battery, 0,self.orderReadiness,self.waitingTables,self.availability, self.cleanliness, self.error]
predicted_label = clf.predict([new_example])
if predicted_label[0]>0:
result="YES"
else:
result="NO"
print("Predicted Label:", result)
def dampState(self):
self.prev_position = copy.deepcopy(self.position)
self.prev_orientation = copy.copy(self.orientation)