diff --git a/src/__pycache__/tree.cpython-38.pyc b/src/__pycache__/tree.cpython-38.pyc new file mode 100644 index 0000000..91a1ba7 Binary files /dev/null and b/src/__pycache__/tree.cpython-38.pyc differ diff --git a/src/main.py b/src/main.py index 47e3f5a..a8db1e0 100644 --- a/src/main.py +++ b/src/main.py @@ -1,31 +1,33 @@ import pygame import random import time - -from src.a_star import a_star_search, WAREHOUSE_MAP, St -from src.bfs import breadth_first_search - + +from src.a_star import a_star_search, WAREHOUSE_MAP +from src.training_data.scripts.gen_data_id3 import generate_size, generate_weight, generate_price, generate_flammability, generate_explosiveness +from src.tree import predict_result, load_tree_from_structure + pygame.init() - + WIDTH = 675 HEIGHT = 675 size = 75 QTY_OF_PACKAGES = 8 RECT_SIZE = 9 - +data_tree = load_tree_from_structure('tree/tree_model') + IMAGE = pygame.image.load('img/wozek2.png') BACKGROUND = pygame.transform.scale(pygame.image.load('img/background.png'), (WIDTH, HEIGHT)) DOCK = pygame.transform.scale(pygame.image.load('img/dock_left.png'), (75, 75)) get_pix_from_position = {} - - + + def get_position_from_pix(pix_pos): for key, value in get_pix_from_position.items(): if pix_pos == value: return key print("ERROR: THERE IS NO POSITION LIKE THIS (get_position_from_pix)") - - + + def create_positions(): size_agent = 40 x_position_pix = size_agent @@ -36,27 +38,53 @@ def create_positions(): y_position_pix += size y_position_pix = size_agent x_position_pix += size - - + + def generate_package(a, b): - rand_y = random.randint(1, 4) - rand_x = random.randint(10, 150) - name_list = ['Grocery', 'Explosive', 'Electronic', 'Builders'] - image_list = ['img/package_grocery.png', 'img/package_explosive.png', 'img/package.png', 'img/package_builders.png'] - p1 = Package((a, b), rand_x, name_list[rand_y - 1], image_list[rand_y - 1]) + name_list = ['Grocery', 'Builders', 'Electronic', 'Explosive'] + image_list = ['img/package_grocery.png', 'img/package_builders.png', 'img/package.png', 'img/package_explosive.png'] + rand_type = random.randint(1, 4) + #rand_weight = generate_weight() + rand_weight = random.randint(1, 10) + #rand_size = generate_size() + rand_size = random.randint(1, 10) + rand_flammability = generate_flammability(name_list[rand_type - 1]) + rand_explosiveness = generate_explosiveness(name_list[rand_type - 1]) + #rand_price = generate_price() + rand_price = random.randint(1, 10) + + p1 = Package((a, b), rand_weight, rand_type, rand_size, rand_flammability, rand_explosiveness, rand_price, + image_list[rand_type - 1]) return p1 - + +# class Package: +# def __init__(self, pos, content, content_size, pack_image): +# self.pos = pos +# self.content = content +# self.content_size = content_size +# self.image = pygame.transform.scale(pygame.image.load(pack_image), (50, 50)) +# self.rect = self.image.get_rect(center=pos) +# self.is_package_up = False + class Package: - def __init__(self, pos, content, content_size, pack_image): + def __init__(self, pos, package_weight, package_type, package_size, flammability, explosiveness, price, image): self.pos = pos - self.content = content - self.content_size = content_size - self.image = pygame.transform.scale(pygame.image.load(pack_image), (50, 50)) + self.package_weight = package_weight + self.package_type = package_type + name_list = ['Grocery', 'Builders', 'Electronic', 'Explosive'] + self.package_type_name = name_list[package_type - 1] + self.package_size = package_size + self.flammability = flammability + self.explosiveness = explosiveness + self.price = price + self.image = pygame.transform.scale(pygame.image.load(image), (50, 50)) + self.is_accepted = predict_result(data_tree, self.package_weight, self.package_type, self.package_size, self.flammability, self.explosiveness, self.price)[0] + #self.is_accepted = 0 self.rect = self.image.get_rect(center=pos) self.is_package_up = False - - + + class Shelf: def __init__(self, pos, content, content_size): self.pos_pix = get_pix_from_position[pos] @@ -64,15 +92,15 @@ class Shelf: self.content_size = content_size self.image = pygame.transform.scale(pygame.image.load('img/shelf.png'), (60, 60)) self.rect = self.image.get_rect(center=self.pos_pix) - - + + class Stain: def __init__(self, pos): self.pos_pix = get_pix_from_position[pos] self.image = pygame.transform.scale(pygame.image.load("img/stain.png"), (60, 60)) self.rect = self.image.get_rect(center=self.pos_pix) - - + + class Agent: def __init__(self, pos, agent_direction="right"): self.pos = pos @@ -83,101 +111,103 @@ class Agent: self.path = None self.goal_achieved = False self.agent_direction = agent_direction - + self.image_left = pygame.transform.flip(IMAGE, True, False) self.image_right = IMAGE self.image_down = pygame.transform.rotate(self.image_right, -90) self.image_up = pygame.transform.rotate(self.image_left, -90) - + def move_bfs(self): if self.path is None or not self.path: self.goal_achieved = True - + else: move = self.path.pop(0) - + if move == "rotate_left": if self.agent_direction == "right": self.agent_direction = "up" self.image = self.image_up - + elif self.agent_direction == "left": self.agent_direction = "down" self.image = self.image_down - + elif self.agent_direction == "up": self.agent_direction = "left" self.image = self.image_left - + elif self.agent_direction == "down": self.agent_direction = "right" self.image = self.image_right - + elif move == "rotate_right": if self.agent_direction == "right": self.agent_direction = "down" self.image = self.image_down - + elif self.agent_direction == "left": self.agent_direction = "up" self.image = self.image_up - + elif self.agent_direction == "up": self.agent_direction = "right" self.image = self.image_right - + elif self.agent_direction == "down": self.agent_direction = "left" self.image = self.image_left - + elif move == "move": if self.agent_direction == "right": self.rect.move_ip(size, 0) self.pos = (self.pos[0] + size, self.pos[1]) self.pos_coord = get_position_from_pix(self.pos) - + elif self.agent_direction == "left": self.rect.move_ip(-size, 0) self.pos = (self.pos[0] - size, self.pos[1]) self.pos_coord = get_position_from_pix(self.pos) - + elif self.agent_direction == "up": self.rect.move_ip(0, -size) self.pos = (self.pos[0], self.pos[1] - size) self.pos_coord = get_position_from_pix(self.pos) - + elif self.agent_direction == "down": self.rect.move_ip(0, size) self.pos = (self.pos[0], self.pos[1] + size) self.pos_coord = get_position_from_pix(self.pos) - + def lift_package_bfs(self): for package in Package_list: if package.is_package_up: package.is_package_up = False elif package.pos == agent.pos: package.is_package_up = True - + print("TYP: {}, WAGA: {}, ROZMIAR: {}, LATWOPALNOSC: {}, WYBUCHOWOSC: {}, CENA: {}, CZY PRZYJETA: {}" + .format(package.package_type_name, package.package_weight, package.package_size, + package.flammability, + package.explosiveness, package.price, package.is_accepted)) + def goal_test(self, state): if state == self.goal: return True else: return False - - + + board = pygame.Surface((WIDTH, HEIGHT), pygame.SRCALPHA) # transparently surface - - + create_positions() - - + # Rysowanie lini for x in range(9): for y in range(9): pygame.draw.rect(board, (0, 0, 0), (x * size, y * size, size, size), 3) - + agent = Agent((40, 640)) - + Shelf_list = [ Shelf((5, 2), 'Explosive', 5), Shelf((6, 2), 'Explosive', 5), Shelf((7, 2), 'Explosive', 5), Shelf((8, 2), 'Explosive', 5), @@ -186,77 +216,88 @@ Shelf_list = [ Shelf((8, 6), 'Builders', 5), Shelf((5, 8), 'Electronic', 5), Shelf((6, 8), 'Electronic', 5), Shelf((7, 8), 'Electronic', 5), Shelf((8, 8), 'Electronic', 5)] - -coord_goals = [(8, 0), (0, 0), (5, 8), (0, 0), (8, 0), (0, 0), (8, 8), (0, 0), - (5, 6), (0, 0), (6, 6), (0, 0), (7, 6), (0, 0), (8, 6), (0, 8)] - + +coord_goals = [(0, 0)] +free_shelf = [(5, 8), (6, 8), (7, 8), (8, 8), (5, 6), (6, 6), (7, 6), (8, 6)] + screen = pygame.display.set_mode([WIDTH, HEIGHT]) - + Package_list = [ - generate_package(40, 40) + Package((40, 40), 3, 4, 6, 3, 3, 6, 'img/package_explosive.png') ] - - -#print(a_star_search((6, 8), (0, 0), "down")) -agent.path = a_star_search((agent.pos_coord[1], agent.pos_coord[0]), (0, 0), agent.agent_direction) - + +agent.path = a_star_search((agent.pos_coord[1], agent.pos_coord[0]), coord_goals.pop(0), agent.agent_direction) + + # Pętla służąca do tworzenia plam oleju na podstawie mapy magazynu Stain_list = [] - + for index_x in range(9): for index_y in range(9): - if WAREHOUSE_MAP[index_x][index_y] == St: + if WAREHOUSE_MAP[index_x][index_y] == 10: Stain_list.append(Stain((index_y, index_x))) - running = True - + while running: for event in pygame.event.get(): if event.type == pygame.QUIT: running = False - + if event.type == pygame.KEYDOWN: pass - + if len(Package_list) < QTY_OF_PACKAGES: - + is_dock_empty = True - + for package in Package_list: if package.pos == (40, 40): is_dock_empty = False + elif package.pos == get_pix_from_position[(8, 0)] and not package.is_package_up: print("Paczka wyrzucona") Package_list.remove(package) - + is_dock_empty = False + elif get_position_from_pix(package.pos) in free_shelf: + Package_list.remove(package) + is_dock_empty = False + if is_dock_empty: Package_list.append(generate_package(40, 40)) - + # PATHING if not agent.goal_achieved: # print(agent.path) agent.move_bfs() - + else: - agent.lift_package_bfs() - if coord_goals: - agent.goal = coord_goals.pop(0) - agent.goal_achieved = False - - #agent.path = breadth_first_search(agent.pos_coord, agent.goal, agent.agent_direction) - agent.path = a_star_search((agent.pos_coord[1], agent.pos_coord[0]), (agent.goal[1], agent.goal[0]), agent.agent_direction) - + + if agent.pos_coord == (0, 0): + + if Package_list[-1].is_accepted == 1: + coord_goals.append(free_shelf[random.randint(0, 7)]) + coord_goals.append((0, 0)) + else: + coord_goals.append((8, 0)) + coord_goals.append((0, 0)) + + agent.goal = coord_goals.pop(0) + agent.goal_achieved = False + + agent.path = a_star_search((agent.pos_coord[1], agent.pos_coord[0]), (agent.goal[1], agent.goal[0]), + agent.agent_direction) + for package in Package_list: if package.is_package_up: package.rect.move_ip(agent.pos[0] - package.pos[0], agent.pos[1] - package.pos[1]) package.pos = agent.pos - + # DRAWING screen.blit(BACKGROUND, [0, 0]) screen.blit(DOCK, [0, 0]) - screen.blit(pygame.transform.flip(DOCK, True, False), [8*size, 0]) + screen.blit(pygame.transform.flip(DOCK, True, False), [8 * size, 0]) screen.blit(board, board.get_rect()) for shelf in Shelf_list: screen.blit(shelf.image, shelf.rect) @@ -265,9 +306,9 @@ while running: screen.blit(agent.image, agent.rect) for package in Package_list: screen.blit(package.image, package.rect) - - time.sleep(0.15) - + + time.sleep(0.05) + pygame.display.update() - + pygame.quit() \ No newline at end of file diff --git a/src/training_data/scripts/__pycache__/gen_data_id3.cpython-38.pyc b/src/training_data/scripts/__pycache__/gen_data_id3.cpython-38.pyc new file mode 100644 index 0000000..4a74379 Binary files /dev/null and b/src/training_data/scripts/__pycache__/gen_data_id3.cpython-38.pyc differ diff --git a/src/training_data/scripts/data/training_list_id3.csv b/src/training_data/scripts/data/training_list_id3.csv index 3465b91..1071bf5 100644 --- a/src/training_data/scripts/data/training_list_id3.csv +++ b/src/training_data/scripts/data/training_list_id3.csv @@ -1,3 +1,5 @@ +3,4,6,2,3,8,0 +3,4,6,2,3,8,1 10,2,2,0,0,4,0 1,1,4,0,0,5,1 5,1,10,0,0,10,0 @@ -65,7 +67,7 @@ 2,3,8,3,0,1,1 9,4,2,5,4,5,0 8,3,5,0,0,3,1 -9,4,3,3,4,1,1 +9,4,3,3,4,1,0 7,4,6,3,3,2,1 1,2,2,4,0,5,0 3,1,3,0,0,10,0 @@ -89,7 +91,7 @@ 10,3,5,0,0,2,1 4,2,7,5,0,2,0 4,4,10,4,2,9,0 -9,3,6,0,0,5,1 +9,3,6,0,0,5,0 4,2,1,0,0,3,1 2,2,1,1,2,8,1 10,4,4,4,4,4,0 @@ -101,7 +103,7 @@ 2,1,2,0,0,1,1 2,3,3,0,0,2,1 4,1,7,0,0,3,1 -9,3,7,0,0,1,1 +9,3,7,0,0,1,0 3,3,6,0,0,4,1 8,4,4,3,5,2,0 5,3,3,0,0,3,1 @@ -115,7 +117,7 @@ 3,1,4,0,0,1,1 1,3,3,0,0,4,1 6,1,6,0,0,2,1 -10,1,2,0,0,5,1 +10,1,2,0,0,5,0 7,1,3,0,0,4,1 7,3,4,0,0,8,1 1,3,7,0,0,2,1 @@ -143,19 +145,19 @@ 4,4,7,3,5,4,0 5,2,5,0,0,3,1 1,3,7,0,0,4,1 -10,3,6,1,0,7,1 +10,3,6,1,0,7,0 3,2,5,5,0,8,0 1,1,1,0,0,1,1 3,3,6,0,0,3,1 2,3,3,0,0,5,1 -4,2,3,0,1,10,1 +4,2,3,0,1,10,0 4,2,2,0,0,5,1 3,3,7,0,0,5,1 3,2,6,5,0,2,0 9,2,1,5,1,3,0 7,1,8,0,0,1,0 -2,1,9,0,0,3,0 -6,3,1,4,0,9,1 +2,1,9,0,0,3,1 +6,3,1,4,0,9,0 4,3,5,0,0,4,1 5,4,6,3,3,5,1 1,2,10,2,0,3,0 @@ -191,10 +193,10 @@ 3,2,2,3,2,2,1 2,1,7,0,0,5,1 1,2,3,0,2,4,1 -9,2,5,0,0,2,0 +9,2,5,0,0,2,1 4,3,8,5,0,5,0 2,2,6,4,0,1,1 3,3,4,0,2,3,1 1,3,5,0,0,4,1 2,4,4,3,3,9,0 -1,2,6,0,0,2,1 \ No newline at end of file +1,2,6,0,0,2,1 diff --git a/src/tree.py b/src/tree.py index 39c121d..d1847a5 100644 --- a/src/tree.py +++ b/src/tree.py @@ -4,8 +4,8 @@ import pandas from sklearn import tree from sklearn.tree import DecisionTreeClassifier -columns = ["weight", "type", "size", "inflammability", "explosiveness", "prize", "allowed_in"] -attributes = ["weight", "type", "size", "inflammability", "explosiveness", "prize"] +columns = ["weight", "type", "size", "inflammability", "explosiveness", "price", "allowed_in"] +attributes = ["weight", "type", "size", "inflammability", "explosiveness", "price"] decisions = ["allowed_in"] @@ -21,8 +21,8 @@ def learning_tree(): return decision_tree -def making_decision(decision_tree, weight, type, size, inflammability, explosiveness, prize): - decision = decision_tree.predict([[weight, type, size, inflammability, explosiveness, prize]]) +def predict_result(decision_tree, weight, type, size, inflammability, explosiveness, price): + decision = decision_tree.predict([[weight, type, size, inflammability, explosiveness, price]]) return decision @@ -50,3 +50,9 @@ def save_tree_to_structure(decision_tree): def load_tree_from_structure(file): return joblib.load(file) + +if __name__ == "__main__": + tree_data = learning_tree() + save_all(tree_data) + + diff --git a/src/tree/decision_tree.png b/src/tree/decision_tree.png index 8577b06..d2da2d6 100644 Binary files a/src/tree/decision_tree.png and b/src/tree/decision_tree.png differ diff --git a/src/tree/tree_in_txt.txt b/src/tree/tree_in_txt.txt index 012f0fa..9b7771d 100644 --- a/src/tree/tree_in_txt.txt +++ b/src/tree/tree_in_txt.txt @@ -1,6 +1,6 @@ -|--- feature_3 <= 2.50 -| |--- feature_5 <= 9.50 -| | |--- feature_0 <= 8.50 +|--- feature_0 <= 8.50 +| |--- feature_5 <= 8.50 +| | |--- feature_3 <= 1.50 | | | |--- feature_2 <= 7.50 | | | | |--- feature_5 <= 7.50 | | | | | |--- feature_2 <= 2.50 @@ -13,130 +13,106 @@ | | | | | | | | |--- feature_5 <= 3.00 | | | | | | | | | |--- class: 1 | | | | | | | | |--- feature_5 > 3.00 -| | | | | | | | | |--- feature_3 <= 1.00 -| | | | | | | | | | |--- class: 0 -| | | | | | | | | |--- feature_3 > 1.00 -| | | | | | | | | | |--- class: 1 +| | | | | | | | | |--- class: 0 | | | | | |--- feature_2 > 2.50 | | | | | | |--- class: 1 | | | | |--- feature_5 > 7.50 -| | | | | |--- feature_3 <= 0.50 -| | | | | | |--- feature_2 <= 2.50 -| | | | | | | |--- class: 0 -| | | | | | |--- feature_2 > 2.50 -| | | | | | | |--- feature_0 <= 3.50 -| | | | | | | | |--- feature_2 <= 5.50 -| | | | | | | | | |--- class: 0 -| | | | | | | | |--- feature_2 > 5.50 -| | | | | | | | | |--- class: 1 -| | | | | | | |--- feature_0 > 3.50 -| | | | | | | | |--- class: 1 -| | | | | |--- feature_3 > 0.50 +| | | | | |--- feature_1 <= 2.50 | | | | | | |--- class: 1 +| | | | | |--- feature_1 > 2.50 +| | | | | | |--- feature_0 <= 4.50 +| | | | | | | |--- class: 0 +| | | | | | |--- feature_0 > 4.50 +| | | | | | | |--- class: 1 | | | |--- feature_2 > 7.50 -| | | | |--- feature_1 <= 2.50 -| | | | | |--- feature_2 <= 9.50 -| | | | | | |--- class: 0 -| | | | | |--- feature_2 > 9.50 -| | | | | | |--- feature_5 <= 2.00 +| | | | |--- feature_0 <= 5.00 +| | | | | |--- feature_2 <= 8.50 +| | | | | | |--- class: 1 +| | | | | |--- feature_2 > 8.50 +| | | | | | |--- feature_2 <= 9.50 +| | | | | | | |--- feature_1 <= 1.50 +| | | | | | | | |--- feature_5 <= 3.50 +| | | | | | | | | |--- class: 1 +| | | | | | | | |--- feature_5 > 3.50 +| | | | | | | | | |--- class: 0 +| | | | | | | |--- feature_1 > 1.50 +| | | | | | | | |--- class: 0 +| | | | | | |--- feature_2 > 9.50 | | | | | | | |--- class: 1 -| | | | | | |--- feature_5 > 2.00 -| | | | | | | |--- class: 0 -| | | | |--- feature_1 > 2.50 -| | | | | |--- feature_2 <= 9.00 -| | | | | | |--- class: 1 -| | | | | |--- feature_2 > 9.00 -| | | | | | |--- class: 0 -| | |--- feature_0 > 8.50 -| | | |--- feature_5 <= 1.50 -| | | | |--- class: 1 -| | | |--- feature_5 > 1.50 -| | | | |--- feature_5 <= 6.50 -| | | | | |--- feature_2 <= 4.50 -| | | | | | |--- feature_1 <= 1.50 -| | | | | | | |--- feature_0 <= 9.50 -| | | | | | | | |--- class: 0 -| | | | | | | |--- feature_0 > 9.50 -| | | | | | | | |--- class: 1 -| | | | | | |--- feature_1 > 1.50 -| | | | | | | |--- class: 0 -| | | | | |--- feature_2 > 4.50 -| | | | | | |--- feature_1 <= 2.50 -| | | | | | | |--- class: 0 -| | | | | | |--- feature_1 > 2.50 -| | | | | | | |--- feature_4 <= 1.00 -| | | | | | | | |--- class: 1 -| | | | | | | |--- feature_4 > 1.00 -| | | | | | | | |--- class: 0 -| | | | |--- feature_5 > 6.50 -| | | | | |--- class: 1 -| |--- feature_5 > 9.50 -| | |--- feature_4 <= 0.50 -| | | |--- class: 0 -| | |--- feature_4 > 0.50 -| | | |--- class: 1 -|--- feature_3 > 2.50 -| |--- feature_3 <= 4.50 -| | |--- feature_2 <= 8.50 -| | | |--- feature_0 <= 1.50 -| | | | |--- feature_1 <= 3.50 -| | | | | |--- feature_5 <= 3.00 -| | | | | | |--- class: 1 -| | | | | |--- feature_5 > 3.00 -| | | | | | |--- class: 0 -| | | | |--- feature_1 > 3.50 +| | | | |--- feature_0 > 5.00 | | | | | |--- class: 0 -| | | |--- feature_0 > 1.50 -| | | | |--- feature_0 <= 6.50 -| | | | | |--- feature_0 <= 4.50 -| | | | | | |--- feature_5 <= 7.00 -| | | | | | | |--- feature_0 <= 2.50 +| | |--- feature_3 > 1.50 +| | | |--- feature_4 <= 3.50 +| | | | |--- feature_2 <= 9.00 +| | | | | |--- feature_3 <= 4.50 +| | | | | | |--- feature_1 <= 3.50 +| | | | | | | |--- feature_3 <= 3.50 | | | | | | | | |--- class: 1 -| | | | | | | |--- feature_0 > 2.50 -| | | | | | | | |--- feature_2 <= 6.00 -| | | | | | | | | |--- feature_4 <= 2.50 -| | | | | | | | | | |--- feature_1 <= 3.00 -| | | | | | | | | | | |--- class: 1 -| | | | | | | | | | |--- feature_1 > 3.00 +| | | | | | | |--- feature_3 > 3.50 +| | | | | | | | |--- feature_5 <= 4.00 +| | | | | | | | | |--- class: 1 +| | | | | | | | |--- feature_5 > 4.00 +| | | | | | | | | |--- class: 0 +| | | | | | |--- feature_1 > 3.50 +| | | | | | | |--- feature_3 <= 3.50 +| | | | | | | | |--- feature_2 <= 3.50 +| | | | | | | | | |--- class: 0 +| | | | | | | | |--- feature_2 > 3.50 +| | | | | | | | | |--- feature_0 <= 4.50 +| | | | | | | | | | |--- feature_5 <= 2.50 | | | | | | | | | | | |--- class: 0 -| | | | | | | | | |--- feature_4 > 2.50 +| | | | | | | | | | |--- feature_5 > 2.50 +| | | | | | | | | | | |--- truncated branch of depth 3 +| | | | | | | | | |--- feature_0 > 4.50 | | | | | | | | | | |--- class: 1 -| | | | | | | | |--- feature_2 > 6.00 -| | | | | | | | | |--- feature_3 <= 3.50 -| | | | | | | | | | |--- class: 0 -| | | | | | | | | |--- feature_3 > 3.50 -| | | | | | | | | | |--- feature_0 <= 3.50 -| | | | | | | | | | | |--- class: 0 -| | | | | | | | | | |--- feature_0 > 3.50 -| | | | | | | | | | | |--- class: 1 -| | | | | | |--- feature_5 > 7.00 -| | | | | | | |--- class: 0 -| | | | | |--- feature_0 > 4.50 -| | | | | | |--- class: 1 -| | | | |--- feature_0 > 6.50 -| | | | | |--- feature_5 <= 2.50 -| | | | | | |--- feature_4 <= 4.50 +| | | | | | | |--- feature_3 > 3.50 +| | | | | | | | |--- feature_0 <= 2.00 +| | | | | | | | | |--- class: 0 +| | | | | | | | |--- feature_0 > 2.00 +| | | | | | | | | |--- class: 1 +| | | | | |--- feature_3 > 4.50 +| | | | | | |--- feature_2 <= 2.50 | | | | | | | |--- class: 1 -| | | | | | |--- feature_4 > 4.50 -| | | | | | | |--- class: 0 -| | | | | |--- feature_5 > 2.50 -| | | | | | |--- class: 0 -| | |--- feature_2 > 8.50 -| | | |--- class: 0 -| |--- feature_3 > 4.50 -| | |--- feature_0 <= 2.50 -| | | |--- feature_2 <= 2.50 -| | | | |--- class: 1 -| | | |--- feature_2 > 2.50 -| | | | |--- class: 0 -| | |--- feature_0 > 2.50 -| | | |--- feature_4 <= 0.50 -| | | | |--- feature_0 <= 5.50 +| | | | | | |--- feature_2 > 2.50 +| | | | | | | |--- feature_0 <= 5.50 +| | | | | | | | |--- class: 0 +| | | | | | | |--- feature_0 > 5.50 +| | | | | | | | |--- class: 1 +| | | | |--- feature_2 > 9.00 | | | | | |--- class: 0 -| | | | |--- feature_0 > 5.50 -| | | | | |--- feature_0 <= 8.00 +| | | |--- feature_4 > 3.50 +| | | | |--- feature_3 <= 3.50 +| | | | | |--- feature_4 <= 4.50 | | | | | | |--- class: 1 -| | | | | |--- feature_0 > 8.00 -| | | | | | |--- class: 0 -| | | |--- feature_4 > 0.50 +| | | | | |--- feature_4 > 4.50 +| | | | | | |--- feature_2 <= 3.50 +| | | | | | | |--- feature_2 <= 1.50 +| | | | | | | | |--- class: 0 +| | | | | | | |--- feature_2 > 1.50 +| | | | | | | | |--- class: 1 +| | | | | | |--- feature_2 > 3.50 +| | | | | | | |--- class: 0 +| | | | |--- feature_3 > 3.50 +| | | | | |--- class: 0 +| |--- feature_5 > 8.50 +| | |--- feature_0 <= 1.50 +| | | |--- class: 1 +| | |--- feature_0 > 1.50 +| | | |--- feature_2 <= 1.50 +| | | | |--- feature_0 <= 3.00 +| | | | | |--- class: 1 +| | | | |--- feature_0 > 3.00 +| | | | | |--- class: 0 +| | | |--- feature_2 > 1.50 | | | | |--- class: 0 +|--- feature_0 > 8.50 +| |--- feature_5 <= 2.50 +| | |--- feature_1 <= 2.50 +| | | |--- class: 1 +| | |--- feature_1 > 2.50 +| | | |--- feature_0 <= 9.50 +| | | | |--- class: 0 +| | | |--- feature_0 > 9.50 +| | | | |--- class: 1 +| |--- feature_5 > 2.50 +| | |--- class: 0 diff --git a/src/tree/tree_model b/src/tree/tree_model index 4d057f3..a79ed12 100644 Binary files a/src/tree/tree_model and b/src/tree/tree_model differ