added alternate dataset
This commit is contained in:
parent
0c096589d7
commit
255e45fd93
33
src/decisionTree/dataset_generator.py
Normal file
33
src/decisionTree/dataset_generator.py
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
import csv
|
||||||
|
import random
|
||||||
|
|
||||||
|
battery_values = ['high', 'medium', 'low']
|
||||||
|
distance_values = ['far', 'medium', 'close']
|
||||||
|
mood_values = ['good', 'medium', 'bad']
|
||||||
|
other = ['yes', 'no']
|
||||||
|
|
||||||
|
|
||||||
|
training_data = []
|
||||||
|
|
||||||
|
for _ in range(200):
|
||||||
|
battery = random.choice(battery_values)
|
||||||
|
distance = random.choice(distance_values)
|
||||||
|
mood = random.choice(mood_values)
|
||||||
|
memory = random.randint(0,4)
|
||||||
|
dishes_held = random.randint(0,4)
|
||||||
|
"""empty_basket = random.choice(other)
|
||||||
|
if empty_basket == 'yes':
|
||||||
|
dish_in_basket = 'no'
|
||||||
|
else:
|
||||||
|
dish_in_basket = random.choice(other)
|
||||||
|
dish_in_basket = random.choice(other)"""
|
||||||
|
waiting_for_order = random.choice(other)
|
||||||
|
waiting_for_dish = random.choice(other)
|
||||||
|
|
||||||
|
example = [battery, distance, mood, memory, dishes_held, waiting_for_order, waiting_for_dish]
|
||||||
|
training_data.append(example)
|
||||||
|
|
||||||
|
with open('data.csv', 'w', newline='') as file:
|
||||||
|
writer = csv.writer(file)
|
||||||
|
writer.writerows(training_data)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user