diff --git a/src/decisionTree/dataset_generator.py b/src/decisionTree/dataset_generator.py new file mode 100644 index 0000000..99b7a1f --- /dev/null +++ b/src/decisionTree/dataset_generator.py @@ -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) +