diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..3b66410 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "git.ignoreLimitWarning": true +} \ No newline at end of file diff --git a/assets/sprites/mines/1.jpg b/assets/sprites/mines/1.jpg new file mode 100644 index 0000000..ccbc870 Binary files /dev/null and b/assets/sprites/mines/1.jpg differ diff --git a/assets/sprites/mines/2.jpg b/assets/sprites/mines/2.jpg new file mode 100644 index 0000000..93342b1 Binary files /dev/null and b/assets/sprites/mines/2.jpg differ diff --git a/assets/sprites/notmines/1.jpg b/assets/sprites/notmines/1.jpg new file mode 100644 index 0000000..db435b8 Binary files /dev/null and b/assets/sprites/notmines/1.jpg differ diff --git a/assets/sprites/notmines/2.jpg b/assets/sprites/notmines/2.jpg new file mode 100644 index 0000000..30112cb Binary files /dev/null and b/assets/sprites/notmines/2.jpg differ diff --git a/classes/minesweeper.py b/classes/minesweeper.py index f42fa50..22d90d3 100644 --- a/classes/minesweeper.py +++ b/classes/minesweeper.py @@ -3,6 +3,7 @@ import pygame from classes import system from random import randrange from classes import decisionTrees +from classes.neuralNetwork import NeuralNetwork pygame.mixer.init() @@ -12,16 +13,18 @@ class NotMine(): position_y: int size: int ismine: bool + image_path: str image: pygame.surface.Surface font: pygame.font.Font done_text: pygame.surface.Surface - def __init__(self, position_x, position_y, size, ismine): + def __init__(self, position_x, position_y, size): self.position_x = position_x self.position_y = position_y self.size = size - self.ismine = ismine - self.image = pygame.image.load("assets/sprites/notmines/" + str(randrange(1, 2)) + ".png") + self.ismine = False + self.image_path = "assets/sprites/notmines/" + str(randrange(1, 3)) + ".jpg" + self.image = pygame.image.load(self.image_path) self.image = pygame.transform.scale(self.image, (self.size, self.size)) self.font = pygame.font.SysFont('Comic Sans MS', int(self.size * 0.3)) self.done_text = self.font.render("", False, (255,0,0)) @@ -37,6 +40,7 @@ class Mine(): position_y: int size: int ismine: bool + image_path: str image: pygame.surface.Surface font: pygame.font.Font image_text: pygame.surface.Surface @@ -47,15 +51,16 @@ class Mine(): weight: float = 1.0 explosion_timer: int = 100 - def __init__(self, position_x, position_y, size, ismine, difficulty=1, weight=1.0, timer=100): + def __init__(self, position_x, position_y, size, difficulty=1, weight=1.0, timer=100): self.position_x = position_x self.position_y = position_y self.size = size - self.ismine = ismine + self.ismine = True self.weight = weight self.explosion_timer = timer self.difficulty = difficulty - self.image = pygame.image.load("assets/sprites/mines/" + str(randrange(1, 2)) + ".png") + self.image_path = "assets/sprites/mines/" + str(randrange(1, 3)) + ".jpg" + self.image = pygame.image.load(self.image_path) self.image = pygame.transform.scale(self.image, (self.size, self.size)) self.font = pygame.font.SysFont('Comic Sans MS', int(self.size * 0.3)) self.image_text = self.font.render(str(self.weight), False, (255, 0, 0)) @@ -192,17 +197,15 @@ class Map: break if ok and randrange(10) == 0 and not (i < 2 and j < 3): #zależnie od wylosowanej liczby mina lub niemina - if randrange(0, 10) > 3: - ismine = True + if randrange(0, 10) > 3: #odpowiednia wartość to > 3 difficulty = randrange(0, 4) + 1 weight = randrange(10, 31) / 10 timer = randrange(100, 200) - mine = Mine(j, i, self.tile_size, ismine, difficulty, weight, timer) + mine = Mine(j, i, self.tile_size, difficulty, weight, timer) self.mines.append(mine) self.encounters.append(mine) else: - ismine = False - notmine = NotMine(j, i, self.tile_size, ismine) + notmine = NotMine(j, i, self.tile_size) self.notmines.append(notmine) self.encounters.append(notmine) @@ -304,6 +307,7 @@ class Minesweeper: self.image = pygame.transform.scale(self.image, (self.size, self.size)) self.rotated_image = self.image self.rotation_degrees = 0 + self.neural_network = NeuralNetwork() def set_map(self, map: Map): self.current_map = map @@ -435,8 +439,8 @@ class Minesweeper: if (self.position_x, self.position_y) == (encounter.position_x, encounter.position_y): #tutaj będzie sprawdzanie zdjęcia i na podstawie tego przypisywane true albo false do decisionismine - decisionismine = encounter.ismine - + decisionismine = self.neural_network.recognize(encounter.image_path) + #wykryto błędnie if decisionismine != encounter.ismine: print("ERROR: Decision was not right") @@ -445,6 +449,7 @@ class Minesweeper: #wykryto poprawnie, że mina elif decisionismine: print("Mine? - Yes") + print("") tree = decisionTrees.DecisionTrees() decision = tree.return_predict(model) print("Decision : ", decision, "\n") @@ -457,6 +462,7 @@ class Minesweeper: #wykryto poprawnie, że niemina else: print("Mine? - No") + print("") encounter.done_text = encounter.font.render("X", False, (255,0,0)) self.current_map.encounters.remove(encounter) pygame.mixer.Channel(3).set_volume(0.01) diff --git a/classes/neuralNetwork.py b/classes/neuralNetwork.py new file mode 100644 index 0000000..885ac8b --- /dev/null +++ b/classes/neuralNetwork.py @@ -0,0 +1,110 @@ +import pandas as pd +import tensorflow as tf +import numpy as np +import warnings +import os +from keras.utils import load_img +import keras +from sklearn.model_selection import train_test_split +from keras.preprocessing.image import ImageDataGenerator +from keras import Sequential +from keras.layers import Conv2D, MaxPool2D, Flatten, Dense +warnings.filterwarnings('ignore') + +create_model = False +learning_sets_path = "data/learning_sets" +save_model_path = "data/models/true_mine_recognizer.model" +load_model_path = "data/models/mine_recognizer.model" +image_size = 128 + +class NeuralNetwork(): + def __init__(self): + if create_model: + input_path = [] + label = [] + + for class_name in os.listdir(learning_sets_path): + for path in os.listdir(learning_sets_path+ "/" +class_name): + if class_name == 'mine': + label.append(0) + else: + label.append(1) + input_path.append(os.path.join(learning_sets_path, class_name, path)) + print(input_path[0], label[0]) + df = pd.DataFrame() + df['images'] = input_path + df['label'] = label + df = df.sample(frac=1).reset_index(drop=True) + df.head() + df['label'] = df['label'].astype('str') + df.head() + + train, test = train_test_split(df, test_size=0.2, random_state=42) + + + train_generator = ImageDataGenerator( + rescale = 1./255, + rotation_range = 40, + shear_range = 0.2, + zoom_range = 0.2, + horizontal_flip = True, + fill_mode = 'nearest' + ) + + val_generator = ImageDataGenerator(rescale = 1./255) + + train_iterator = train_generator.flow_from_dataframe( + train, + x_col='images', + y_col='label', + target_size=(image_size,image_size), + batch_size=512, + class_mode='binary' + ) + + val_iterator = val_generator.flow_from_dataframe( + test, + x_col='images', + y_col='label', + target_size=(image_size,image_size), + batch_size=512, + class_mode='binary' + ) + + self.model = Sequential([ + Conv2D(16, (3,3), activation='relu', input_shape=(image_size,image_size,3)), + MaxPool2D((2,2)), + Conv2D(32, (3,3), activation='relu'), + MaxPool2D((2,2)), + Conv2D(64, (3,3), activation='relu'), + MaxPool2D((2,2)), + Flatten(), + Dense(512, activation='relu'), + Dense(1, activation='sigmoid') + ]) + self.model.compile(optimizer='adam', loss='binary_crossentropy', metrics=['accuracy']) + self.model.summary() + self.model.fit(train_iterator, epochs=10, validation_data=val_iterator) + self.model.save(save_model_path) + else: + self.model = keras.models.load_model(load_model_path, + compile=True + ) + def recognize(self, image_path): + image = keras.utils.load_img(image_path, target_size=(image_size, image_size)) + image_array = keras.utils.img_to_array(image) + image_array = keras.backend.expand_dims(image_array, 0) + + prediction = self.model.predict(image_array) + if prediction[0] > 0.5: + predict = "notmine" + accuracy = prediction[0] * 100 + elif prediction[0] <= 0.5: + predict = "mine" + accuracy = (1 - prediction[0]) * 100 + + print("Image: ",image_path," is classified as: ", predict," with: ", accuracy, " accuracy") + if predict == "mine": + return True + else: + return False \ No newline at end of file diff --git a/data/models/mine_recognizer.model/keras_metadata.pb b/data/models/mine_recognizer.model/keras_metadata.pb new file mode 100644 index 0000000..a9e17bc --- /dev/null +++ b/data/models/mine_recognizer.model/keras_metadata.pb @@ -0,0 +1,15 @@ + +Proot"_tf_keras_sequential*P{"name": "sequential", "trainable": true, "expects_training_arg": true, "dtype": "float32", "batch_input_shape": null, "must_restore_from_config": false, "class_name": "Sequential", "config": {"name": "sequential", "layers": [{"class_name": "InputLayer", "config": {"batch_input_shape": {"class_name": "__tuple__", "items": [null, 128, 128, 3]}, "dtype": "float32", "sparse": false, "ragged": false, "name": "conv2d_input"}}, {"class_name": "Conv2D", "config": {"name": "conv2d", "trainable": true, "batch_input_shape": {"class_name": "__tuple__", "items": [null, 128, 128, 3]}, "dtype": "float32", "filters": 16, "kernel_size": {"class_name": "__tuple__", "items": [3, 3]}, "strides": {"class_name": "__tuple__", "items": [1, 1]}, "padding": "valid", "data_format": "channels_last", "dilation_rate": {"class_name": "__tuple__", "items": [1, 1]}, "groups": 1, "activation": "relu", "use_bias": true, "kernel_initializer": {"class_name": "GlorotUniform", "config": {"seed": null}}, "bias_initializer": {"class_name": "Zeros", "config": {}}, "kernel_regularizer": null, "bias_regularizer": null, "activity_regularizer": null, "kernel_constraint": null, "bias_constraint": null}}, {"class_name": "MaxPooling2D", "config": {"name": "max_pooling2d", "trainable": true, "dtype": "float32", "pool_size": {"class_name": "__tuple__", "items": [2, 2]}, "padding": "valid", "strides": {"class_name": "__tuple__", "items": [2, 2]}, "data_format": "channels_last"}}, {"class_name": "Conv2D", "config": {"name": "conv2d_1", "trainable": true, "dtype": "float32", "filters": 32, "kernel_size": {"class_name": "__tuple__", "items": [3, 3]}, "strides": {"class_name": "__tuple__", "items": [1, 1]}, "padding": "valid", "data_format": "channels_last", "dilation_rate": {"class_name": "__tuple__", "items": [1, 1]}, "groups": 1, "activation": "relu", "use_bias": true, "kernel_initializer": {"class_name": "GlorotUniform", "config": {"seed": null}}, "bias_initializer": {"class_name": "Zeros", "config": {}}, "kernel_regularizer": null, "bias_regularizer": null, "activity_regularizer": null, "kernel_constraint": null, "bias_constraint": null}}, {"class_name": "MaxPooling2D", "config": {"name": "max_pooling2d_1", "trainable": true, "dtype": "float32", "pool_size": {"class_name": "__tuple__", "items": [2, 2]}, "padding": "valid", "strides": {"class_name": "__tuple__", "items": [2, 2]}, "data_format": "channels_last"}}, {"class_name": "Conv2D", "config": {"name": "conv2d_2", "trainable": true, "dtype": "float32", "filters": 64, "kernel_size": {"class_name": "__tuple__", "items": [3, 3]}, "strides": {"class_name": "__tuple__", "items": [1, 1]}, "padding": "valid", "data_format": "channels_last", "dilation_rate": {"class_name": "__tuple__", "items": [1, 1]}, "groups": 1, "activation": "relu", "use_bias": true, "kernel_initializer": {"class_name": "GlorotUniform", "config": {"seed": null}}, "bias_initializer": {"class_name": "Zeros", "config": {}}, "kernel_regularizer": null, "bias_regularizer": null, "activity_regularizer": null, "kernel_constraint": null, "bias_constraint": null}}, {"class_name": "MaxPooling2D", "config": {"name": "max_pooling2d_2", "trainable": true, "dtype": "float32", "pool_size": {"class_name": "__tuple__", "items": [2, 2]}, "padding": "valid", "strides": {"class_name": "__tuple__", "items": [2, 2]}, "data_format": "channels_last"}}, {"class_name": "Flatten", "config": {"name": "flatten", "trainable": true, "dtype": "float32", "data_format": "channels_last"}}, {"class_name": "Dense", "config": {"name": "dense", "trainable": true, "dtype": "float32", "units": 512, "activation": "relu", "use_bias": true, "kernel_initializer": {"class_name": "GlorotUniform", "config": {"seed": null}}, "bias_initializer": {"class_name": "Zeros", "config": {}}, "kernel_regularizer": null, "bias_regularizer": null, "activity_regularizer": null, "kernel_constraint": null, "bias_constraint": null}}, {"class_name": "Dense", "config": {"name": "dense_1", "trainable": true, "dtype": "float32", "units": 1, "activation": "sigmoid", "use_bias": true, "kernel_initializer": {"class_name": "GlorotUniform", "config": {"seed": null}}, "bias_initializer": {"class_name": "Zeros", "config": {}}, "kernel_regularizer": null, "bias_regularizer": null, "activity_regularizer": null, "kernel_constraint": null, "bias_constraint": null}}]}, "shared_object_id": 20, "input_spec": [{"class_name": "InputSpec", "config": {"dtype": null, "shape": {"class_name": "__tuple__", "items": [null, 128, 128, 3]}, "ndim": 4, "max_ndim": null, "min_ndim": null, "axes": {}}}], "build_input_shape": {"class_name": "TensorShape", "items": [null, 128, 128, 3]}, "is_graph_network": true, "full_save_spec": {"class_name": "__tuple__", "items": [[{"class_name": "TypeSpec", "type_spec": "tf.TensorSpec", "serialized": [{"class_name": "TensorShape", "items": [null, 128, 128, 3]}, "float32", "conv2d_input"]}], {}]}, "save_spec": {"class_name": "TypeSpec", "type_spec": "tf.TensorSpec", "serialized": [{"class_name": "TensorShape", "items": [null, 128, 128, 3]}, "float32", "conv2d_input"]}, "keras_version": "2.9.0", "backend": "tensorflow", "model_config": {"class_name": "Sequential", "config": {"name": "sequential", "layers": [{"class_name": "InputLayer", "config": {"batch_input_shape": {"class_name": "__tuple__", "items": [null, 128, 128, 3]}, "dtype": "float32", "sparse": false, "ragged": false, "name": "conv2d_input"}, "shared_object_id": 0}, {"class_name": "Conv2D", "config": {"name": "conv2d", "trainable": true, "batch_input_shape": {"class_name": "__tuple__", "items": [null, 128, 128, 3]}, "dtype": "float32", "filters": 16, "kernel_size": {"class_name": "__tuple__", "items": [3, 3]}, "strides": {"class_name": "__tuple__", "items": [1, 1]}, "padding": "valid", "data_format": "channels_last", "dilation_rate": {"class_name": "__tuple__", "items": [1, 1]}, "groups": 1, "activation": "relu", "use_bias": true, "kernel_initializer": {"class_name": "GlorotUniform", "config": {"seed": null}, "shared_object_id": 1}, "bias_initializer": {"class_name": "Zeros", "config": {}, "shared_object_id": 2}, "kernel_regularizer": null, "bias_regularizer": null, "activity_regularizer": null, "kernel_constraint": null, "bias_constraint": null}, "shared_object_id": 3}, {"class_name": "MaxPooling2D", "config": {"name": "max_pooling2d", "trainable": true, "dtype": "float32", "pool_size": {"class_name": "__tuple__", "items": [2, 2]}, "padding": "valid", "strides": {"class_name": "__tuple__", "items": [2, 2]}, "data_format": "channels_last"}, "shared_object_id": 4}, {"class_name": "Conv2D", "config": {"name": "conv2d_1", "trainable": true, "dtype": "float32", "filters": 32, "kernel_size": {"class_name": "__tuple__", "items": [3, 3]}, "strides": {"class_name": "__tuple__", "items": [1, 1]}, "padding": "valid", "data_format": "channels_last", "dilation_rate": {"class_name": "__tuple__", "items": [1, 1]}, "groups": 1, "activation": "relu", "use_bias": true, "kernel_initializer": {"class_name": "GlorotUniform", "config": {"seed": null}, "shared_object_id": 5}, "bias_initializer": {"class_name": "Zeros", "config": {}, "shared_object_id": 6}, "kernel_regularizer": null, "bias_regularizer": null, "activity_regularizer": null, "kernel_constraint": null, "bias_constraint": null}, "shared_object_id": 7}, {"class_name": "MaxPooling2D", "config": {"name": "max_pooling2d_1", "trainable": true, "dtype": "float32", "pool_size": {"class_name": "__tuple__", "items": [2, 2]}, "padding": "valid", "strides": {"class_name": "__tuple__", "items": [2, 2]}, "data_format": "channels_last"}, "shared_object_id": 8}, {"class_name": "Conv2D", "config": {"name": "conv2d_2", "trainable": true, "dtype": "float32", "filters": 64, "kernel_size": {"class_name": "__tuple__", "items": [3, 3]}, "strides": {"class_name": "__tuple__", "items": [1, 1]}, "padding": "valid", "data_format": "channels_last", "dilation_rate": {"class_name": "__tuple__", "items": [1, 1]}, "groups": 1, "activation": "relu", "use_bias": true, "kernel_initializer": {"class_name": "GlorotUniform", "config": {"seed": null}, "shared_object_id": 9}, "bias_initializer": {"class_name": "Zeros", "config": {}, "shared_object_id": 10}, "kernel_regularizer": null, "bias_regularizer": null, "activity_regularizer": null, "kernel_constraint": null, "bias_constraint": null}, "shared_object_id": 11}, {"class_name": "MaxPooling2D", "config": {"name": "max_pooling2d_2", "trainable": true, "dtype": "float32", "pool_size": {"class_name": "__tuple__", "items": [2, 2]}, "padding": "valid", "strides": {"class_name": "__tuple__", "items": [2, 2]}, "data_format": "channels_last"}, "shared_object_id": 12}, {"class_name": "Flatten", "config": {"name": "flatten", "trainable": true, "dtype": "float32", "data_format": "channels_last"}, "shared_object_id": 13}, {"class_name": "Dense", "config": {"name": "dense", "trainable": true, "dtype": "float32", "units": 512, "activation": "relu", "use_bias": true, "kernel_initializer": {"class_name": "GlorotUniform", "config": {"seed": null}, "shared_object_id": 14}, "bias_initializer": {"class_name": "Zeros", "config": {}, "shared_object_id": 15}, "kernel_regularizer": null, "bias_regularizer": null, "activity_regularizer": null, "kernel_constraint": null, "bias_constraint": null}, "shared_object_id": 16}, {"class_name": "Dense", "config": {"name": "dense_1", "trainable": true, "dtype": "float32", "units": 1, "activation": "sigmoid", "use_bias": true, "kernel_initializer": {"class_name": "GlorotUniform", "config": {"seed": null}, "shared_object_id": 17}, "bias_initializer": {"class_name": "Zeros", "config": {}, "shared_object_id": 18}, "kernel_regularizer": null, "bias_regularizer": null, "activity_regularizer": null, "kernel_constraint": null, "bias_constraint": null}, "shared_object_id": 19}]}}, "training_config": {"loss": "binary_crossentropy", "metrics": [[{"class_name": "MeanMetricWrapper", "config": {"name": "accuracy", "dtype": "float32", "fn": "binary_accuracy"}, "shared_object_id": 22}]], "weighted_metrics": null, "loss_weights": null, "optimizer_config": {"class_name": "Adam", "config": {"name": "Adam", "learning_rate": 0.0010000000474974513, "decay": 0.0, "beta_1": 0.8999999761581421, "beta_2": 0.9990000128746033, "epsilon": 1e-07, "amsgrad": false}}}}2 + +root.layer_with_weights-0"_tf_keras_layer* +{"name": "conv2d", "trainable": true, "expects_training_arg": false, "dtype": "float32", "batch_input_shape": {"class_name": "__tuple__", "items": [null, 128, 128, 3]}, "stateful": false, "must_restore_from_config": false, "class_name": "Conv2D", "config": {"name": "conv2d", "trainable": true, "batch_input_shape": {"class_name": "__tuple__", "items": [null, 128, 128, 3]}, "dtype": "float32", "filters": 16, "kernel_size": {"class_name": "__tuple__", "items": [3, 3]}, "strides": {"class_name": "__tuple__", "items": [1, 1]}, "padding": "valid", "data_format": "channels_last", "dilation_rate": {"class_name": "__tuple__", "items": [1, 1]}, "groups": 1, "activation": "relu", "use_bias": true, "kernel_initializer": {"class_name": "GlorotUniform", "config": {"seed": null}, "shared_object_id": 1}, "bias_initializer": {"class_name": "Zeros", "config": {}, "shared_object_id": 2}, "kernel_regularizer": null, "bias_regularizer": null, "activity_regularizer": null, "kernel_constraint": null, "bias_constraint": null}, "shared_object_id": 3, "input_spec": {"class_name": "InputSpec", "config": {"dtype": null, "shape": null, "ndim": null, "max_ndim": null, "min_ndim": 4, "axes": {"-1": 3}}, "shared_object_id": 23}, "build_input_shape": {"class_name": "TensorShape", "items": [null, 128, 128, 3]}}2 + root.layer-1"_tf_keras_layer*{"name": "max_pooling2d", "trainable": true, "expects_training_arg": false, "dtype": "float32", "batch_input_shape": null, "stateful": false, "must_restore_from_config": false, "class_name": "MaxPooling2D", "config": {"name": "max_pooling2d", "trainable": true, "dtype": "float32", "pool_size": {"class_name": "__tuple__", "items": [2, 2]}, "padding": "valid", "strides": {"class_name": "__tuple__", "items": [2, 2]}, "data_format": "channels_last"}, "shared_object_id": 4, "input_spec": {"class_name": "InputSpec", "config": {"dtype": null, "shape": null, "ndim": 4, "max_ndim": null, "min_ndim": null, "axes": {}}, "shared_object_id": 24}}2 + root.layer_with_weights-1"_tf_keras_layer* {"name": "conv2d_1", "trainable": true, "expects_training_arg": false, "dtype": "float32", "batch_input_shape": null, "stateful": false, "must_restore_from_config": false, "class_name": "Conv2D", "config": {"name": "conv2d_1", "trainable": true, "dtype": "float32", "filters": 32, "kernel_size": {"class_name": "__tuple__", "items": [3, 3]}, "strides": {"class_name": "__tuple__", "items": [1, 1]}, "padding": "valid", "data_format": "channels_last", "dilation_rate": {"class_name": "__tuple__", "items": [1, 1]}, "groups": 1, "activation": "relu", "use_bias": true, "kernel_initializer": {"class_name": "GlorotUniform", "config": {"seed": null}, "shared_object_id": 5}, "bias_initializer": {"class_name": "Zeros", "config": {}, "shared_object_id": 6}, "kernel_regularizer": null, "bias_regularizer": null, "activity_regularizer": null, "kernel_constraint": null, "bias_constraint": null}, "shared_object_id": 7, "input_spec": {"class_name": "InputSpec", "config": {"dtype": null, "shape": null, "ndim": null, "max_ndim": null, "min_ndim": 4, "axes": {"-1": 16}}, "shared_object_id": 25}, "build_input_shape": {"class_name": "TensorShape", "items": [null, 63, 63, 16]}}2 + root.layer-3"_tf_keras_layer*{"name": "max_pooling2d_1", "trainable": true, "expects_training_arg": false, "dtype": "float32", "batch_input_shape": null, "stateful": false, "must_restore_from_config": false, "class_name": "MaxPooling2D", "config": {"name": "max_pooling2d_1", "trainable": true, "dtype": "float32", "pool_size": {"class_name": "__tuple__", "items": [2, 2]}, "padding": "valid", "strides": {"class_name": "__tuple__", "items": [2, 2]}, "data_format": "channels_last"}, "shared_object_id": 8, "input_spec": {"class_name": "InputSpec", "config": {"dtype": null, "shape": null, "ndim": 4, "max_ndim": null, "min_ndim": null, "axes": {}}, "shared_object_id": 26}}2 + root.layer_with_weights-2"_tf_keras_layer* {"name": "conv2d_2", "trainable": true, "expects_training_arg": false, "dtype": "float32", "batch_input_shape": null, "stateful": false, "must_restore_from_config": false, "class_name": "Conv2D", "config": {"name": "conv2d_2", "trainable": true, "dtype": "float32", "filters": 64, "kernel_size": {"class_name": "__tuple__", "items": [3, 3]}, "strides": {"class_name": "__tuple__", "items": [1, 1]}, "padding": "valid", "data_format": "channels_last", "dilation_rate": {"class_name": "__tuple__", "items": [1, 1]}, "groups": 1, "activation": "relu", "use_bias": true, "kernel_initializer": {"class_name": "GlorotUniform", "config": {"seed": null}, "shared_object_id": 9}, "bias_initializer": {"class_name": "Zeros", "config": {}, "shared_object_id": 10}, "kernel_regularizer": null, "bias_regularizer": null, "activity_regularizer": null, "kernel_constraint": null, "bias_constraint": null}, "shared_object_id": 11, "input_spec": {"class_name": "InputSpec", "config": {"dtype": null, "shape": null, "ndim": null, "max_ndim": null, "min_ndim": 4, "axes": {"-1": 32}}, "shared_object_id": 27}, "build_input_shape": {"class_name": "TensorShape", "items": [null, 30, 30, 32]}}2 + root.layer-5"_tf_keras_layer*{"name": "max_pooling2d_2", "trainable": true, "expects_training_arg": false, "dtype": "float32", "batch_input_shape": null, "stateful": false, "must_restore_from_config": false, "class_name": "MaxPooling2D", "config": {"name": "max_pooling2d_2", "trainable": true, "dtype": "float32", "pool_size": {"class_name": "__tuple__", "items": [2, 2]}, "padding": "valid", "strides": {"class_name": "__tuple__", "items": [2, 2]}, "data_format": "channels_last"}, "shared_object_id": 12, "input_spec": {"class_name": "InputSpec", "config": {"dtype": null, "shape": null, "ndim": 4, "max_ndim": null, "min_ndim": null, "axes": {}}, "shared_object_id": 28}}2 + root.layer-6"_tf_keras_layer*{"name": "flatten", "trainable": true, "expects_training_arg": false, "dtype": "float32", "batch_input_shape": null, "stateful": false, "must_restore_from_config": false, "class_name": "Flatten", "config": {"name": "flatten", "trainable": true, "dtype": "float32", "data_format": "channels_last"}, "shared_object_id": 13, "input_spec": {"class_name": "InputSpec", "config": {"dtype": null, "shape": null, "ndim": null, "max_ndim": null, "min_ndim": 1, "axes": {}}, "shared_object_id": 29}}2 +root.layer_with_weights-3"_tf_keras_layer*{"name": "dense", "trainable": true, "expects_training_arg": false, "dtype": "float32", "batch_input_shape": null, "stateful": false, "must_restore_from_config": false, "class_name": "Dense", "config": {"name": "dense", "trainable": true, "dtype": "float32", "units": 512, "activation": "relu", "use_bias": true, "kernel_initializer": {"class_name": "GlorotUniform", "config": {"seed": null}, "shared_object_id": 14}, "bias_initializer": {"class_name": "Zeros", "config": {}, "shared_object_id": 15}, "kernel_regularizer": null, "bias_regularizer": null, "activity_regularizer": null, "kernel_constraint": null, "bias_constraint": null}, "shared_object_id": 16, "input_spec": {"class_name": "InputSpec", "config": {"dtype": null, "shape": null, "ndim": null, "max_ndim": null, "min_ndim": 2, "axes": {"-1": 12544}}, "shared_object_id": 30}, "build_input_shape": {"class_name": "TensorShape", "items": [null, 12544]}}2 + root.layer_with_weights-4"_tf_keras_layer*{"name": "dense_1", "trainable": true, "expects_training_arg": false, "dtype": "float32", "batch_input_shape": null, "stateful": false, "must_restore_from_config": false, "class_name": "Dense", "config": {"name": "dense_1", "trainable": true, "dtype": "float32", "units": 1, "activation": "sigmoid", "use_bias": true, "kernel_initializer": {"class_name": "GlorotUniform", "config": {"seed": null}, "shared_object_id": 17}, "bias_initializer": {"class_name": "Zeros", "config": {}, "shared_object_id": 18}, "kernel_regularizer": null, "bias_regularizer": null, "activity_regularizer": null, "kernel_constraint": null, "bias_constraint": null}, "shared_object_id": 19, "input_spec": {"class_name": "InputSpec", "config": {"dtype": null, "shape": null, "ndim": null, "max_ndim": null, "min_ndim": 2, "axes": {"-1": 512}}, "shared_object_id": 31}, "build_input_shape": {"class_name": "TensorShape", "items": [null, 512]}}2 +root.keras_api.metrics.0"_tf_keras_metric*{"class_name": "Mean", "name": "loss", "dtype": "float32", "config": {"name": "loss", "dtype": "float32"}, "shared_object_id": 32}2 +root.keras_api.metrics.1"_tf_keras_metric*{"class_name": "MeanMetricWrapper", "name": "accuracy", "dtype": "float32", "config": {"name": "accuracy", "dtype": "float32", "fn": "binary_accuracy"}, "shared_object_id": 22}2 \ No newline at end of file diff --git a/data/models/mine_recognizer.model/saved_model.pb b/data/models/mine_recognizer.model/saved_model.pb new file mode 100644 index 0000000..1fa6dbc Binary files /dev/null and b/data/models/mine_recognizer.model/saved_model.pb differ diff --git a/data/models/mine_recognizer.model/variables/variables.data-00000-of-00001 b/data/models/mine_recognizer.model/variables/variables.data-00000-of-00001 new file mode 100644 index 0000000..2975eaf Binary files /dev/null and b/data/models/mine_recognizer.model/variables/variables.data-00000-of-00001 differ diff --git a/data/models/mine_recognizer.model/variables/variables.index b/data/models/mine_recognizer.model/variables/variables.index new file mode 100644 index 0000000..58125cf Binary files /dev/null and b/data/models/mine_recognizer.model/variables/variables.index differ diff --git a/outputs/rules/rules.json b/outputs/rules/rules.json index f45276d..562d000 100644 --- a/outputs/rules/rules.json +++ b/outputs/rules/rules.json @@ -1,31 +1,31 @@ [ -{"current_level": 1, "leaf_id": "657140df-de8d-11ec-9c63-d43d7ef1576e", "parents": "root", "rule": "else: return 'detonate'", "feature_idx": -1, "feature_name": "", "instances": 200, "metric": 0, "return_statement": 0, "tree_id": 0}, -{"current_level": 1, "leaf_id": "6572790a-de8d-11ec-ac91-d43d7ef1576e", "parents": "root", "rule": "if obj[4]<=80.67436609605278:", "feature_idx": 4, "feature_name": "Random_detonation_chance", "instances": 200, "metric": 0.9964625048848765, "return_statement": 0, "tree_id": 0}, -{"current_level": 2, "leaf_id": "6581b986-de8d-11ec-9198-d43d7ef1576e", "parents": "6572790a-de8d-11ec-ac91-d43d7ef1576e", "rule": "else: return 'detonate'", "feature_idx": -1, "feature_name": "", "instances": 161, "metric": 0, "return_statement": 0, "tree_id": 0}, -{"current_level": 2, "leaf_id": "6582f1e8-de8d-11ec-9c53-d43d7ef1576e", "parents": "6572790a-de8d-11ec-ac91-d43d7ef1576e", "rule": "if obj[2]<=0:", "feature_idx": 2, "feature_name": "Protection_from_defuse", "instances": 161, "metric": 0.9203523274205176, "return_statement": 0, "tree_id": 0}, -{"current_level": 3, "leaf_id": "65905ed3-de8d-11ec-b36a-d43d7ef1576e", "parents": "6582f1e8-de8d-11ec-9c53-d43d7ef1576e", "rule": "else: return 'detonate'", "feature_idx": -1, "feature_name": "", "instances": 135, "metric": 0, "return_statement": 0, "tree_id": 0}, -{"current_level": 3, "leaf_id": "659196b8-de8d-11ec-b5e3-d43d7ef1576e", "parents": "6582f1e8-de8d-11ec-9c53-d43d7ef1576e", "rule": "if obj[3]<=7:", "feature_idx": 3, "feature_name": "Meters_under_the_ground", "instances": 135, "metric": 0.7364977795505669, "return_statement": 0, "tree_id": 0}, -{"current_level": 4, "leaf_id": "659b5a72-de8d-11ec-af31-d43d7ef1576e", "parents": "659196b8-de8d-11ec-b5e3-d43d7ef1576e", "rule": "else: return 'defuse'", "feature_idx": -1, "feature_name": "", "instances": 116, "metric": 0, "return_statement": 0, "tree_id": 0}, -{"current_level": 4, "leaf_id": "659c924b-de8d-11ec-ba5c-d43d7ef1576e", "parents": "659196b8-de8d-11ec-b5e3-d43d7ef1576e", "rule": "if obj[1]<=1997.8794790831414:", "feature_idx": 1, "feature_name": "Year(older_more_difficult)", "instances": 116, "metric": 0.3936164041111624, "return_statement": 0, "tree_id": 0}, -{"current_level": 5, "leaf_id": "65a396a0-de8d-11ec-a956-d43d7ef1576e", "parents": "659c924b-de8d-11ec-ba5c-d43d7ef1576e", "rule": "else: return 'defuse'", "feature_idx": -1, "feature_name": "", "instances": 97, "metric": 0, "return_statement": 0, "tree_id": 0}, -{"current_level": 5, "leaf_id": "65a4a8a9-de8d-11ec-8c86-d43d7ef1576e", "parents": "659c924b-de8d-11ec-ba5c-d43d7ef1576e", "rule": "if obj[5]<=2:", "feature_idx": 5, "feature_name": "Detonation_power_in_m", "instances": 97, "metric": 0.445693177722561, "return_statement": 0, "tree_id": 0}, -{"current_level": 6, "leaf_id": "65a851b0-de8d-11ec-ad73-d43d7ef1576e", "parents": "65a4a8a9-de8d-11ec-8c86-d43d7ef1576e", "rule": "else: return 'defuse'", "feature_idx": -1, "feature_name": "", "instances": 65, "metric": 0, "return_statement": 0, "tree_id": 0}, -{"current_level": 6, "leaf_id": "65a9899b-de8d-11ec-af58-d43d7ef1576e", "parents": "65a4a8a9-de8d-11ec-8c86-d43d7ef1576e", "rule": "if obj[0]>3:", "feature_idx": 0, "feature_name": "Size(bigger_more_difficult)", "instances": 65, "metric": 0.33352200393097664, "return_statement": 0, "tree_id": 0}, -{"current_level": 7, "leaf_id": "65a9899c-de8d-11ec-a96c-d43d7ef1576e", "parents": "65a9899b-de8d-11ec-af58-d43d7ef1576e", "rule": "return 'defuse'", "feature_idx": 0, "feature_name": "Size(bigger_more_difficult)", "instances": 65, "metric": 0, "return_statement": 1, "tree_id": 0}, -{"current_level": 6, "leaf_id": "65abfae1-de8d-11ec-aaaa-d43d7ef1576e", "parents": "65a4a8a9-de8d-11ec-8c86-d43d7ef1576e", "rule": "if obj[0]<=3:", "feature_idx": 0, "feature_name": "Size(bigger_more_difficult)", "instances": 65, "metric": 0.33352200393097664, "return_statement": 0, "tree_id": 0}, -{"current_level": 7, "leaf_id": "65abfae2-de8d-11ec-8f35-d43d7ef1576e", "parents": "65abfae1-de8d-11ec-aaaa-d43d7ef1576e", "rule": "return 'defuse'", "feature_idx": 0, "feature_name": "Size(bigger_more_difficult)", "instances": 65, "metric": 0, "return_statement": 1, "tree_id": 0}, -{"current_level": 5, "leaf_id": "65b06753-de8d-11ec-9af2-d43d7ef1576e", "parents": "659c924b-de8d-11ec-ba5c-d43d7ef1576e", "rule": "if obj[5]>2:", "feature_idx": 5, "feature_name": "Detonation_power_in_m", "instances": 97, "metric": 0.445693177722561, "return_statement": 0, "tree_id": 0}, -{"current_level": 6, "leaf_id": "65b41086-de8d-11ec-b9c3-d43d7ef1576e", "parents": "65b06753-de8d-11ec-9af2-d43d7ef1576e", "rule": "else: return 'defuse'", "feature_idx": -1, "feature_name": "", "instances": 32, "metric": 0, "return_statement": 0, "tree_id": 0}, -{"current_level": 6, "leaf_id": "65b548ec-de8d-11ec-8daf-d43d7ef1576e", "parents": "65b06753-de8d-11ec-9af2-d43d7ef1576e", "rule": "if obj[0]<=7:", "feature_idx": 0, "feature_name": "Size(bigger_more_difficult)", "instances": 32, "metric": 0.6252624052234231, "return_statement": 0, "tree_id": 0}, -{"current_level": 7, "leaf_id": "65b548ed-de8d-11ec-a6f9-d43d7ef1576e", "parents": "65b548ec-de8d-11ec-8daf-d43d7ef1576e", "rule": "return 'defuse'", "feature_idx": 0, "feature_name": "Size(bigger_more_difficult)", "instances": 32, "metric": 0, "return_statement": 1, "tree_id": 0}, -{"current_level": 6, "leaf_id": "65b792b4-de8d-11ec-ae1b-d43d7ef1576e", "parents": "65b06753-de8d-11ec-9af2-d43d7ef1576e", "rule": "if obj[0]>7:", "feature_idx": 0, "feature_name": "Size(bigger_more_difficult)", "instances": 32, "metric": 0.6252624052234231, "return_statement": 0, "tree_id": 0}, -{"current_level": 7, "leaf_id": "65b792b5-de8d-11ec-8bb4-d43d7ef1576e", "parents": "65b792b4-de8d-11ec-ae1b-d43d7ef1576e", "rule": "return 'defuse'", "feature_idx": 0, "feature_name": "Size(bigger_more_difficult)", "instances": 32, "metric": 0, "return_statement": 1, "tree_id": 0}, -{"current_level": 4, "leaf_id": "65be48e0-de8d-11ec-b4ae-d43d7ef1576e", "parents": "659196b8-de8d-11ec-b5e3-d43d7ef1576e", "rule": "if obj[1]>1997.8794790831414:", "feature_idx": 1, "feature_name": "Year(older_more_difficult)", "instances": 116, "metric": 0.3936164041111624, "return_statement": 0, "tree_id": 0}, -{"current_level": 5, "leaf_id": "65be48e1-de8d-11ec-9136-d43d7ef1576e", "parents": "65be48e0-de8d-11ec-b4ae-d43d7ef1576e", "rule": "return 'defuse'", "feature_idx": 1, "feature_name": "Year(older_more_difficult)", "instances": 116, "metric": 0, "return_statement": 1, "tree_id": 0}, -{"current_level": 3, "leaf_id": "65c2b4d6-de8d-11ec-89c3-d43d7ef1576e", "parents": "6582f1e8-de8d-11ec-9c53-d43d7ef1576e", "rule": "if obj[3]>7:", "feature_idx": 3, "feature_name": "Meters_under_the_ground", "instances": 135, "metric": 0.7364977795505669, "return_statement": 0, "tree_id": 0}, -{"current_level": 4, "leaf_id": "65c2b4d7-de8d-11ec-8575-d43d7ef1576e", "parents": "65c2b4d6-de8d-11ec-89c3-d43d7ef1576e", "rule": "return 'detonate'", "feature_idx": 3, "feature_name": "Meters_under_the_ground", "instances": 135, "metric": 0, "return_statement": 1, "tree_id": 0}, -{"current_level": 2, "leaf_id": "65c72151-de8d-11ec-adc4-d43d7ef1576e", "parents": "6572790a-de8d-11ec-ac91-d43d7ef1576e", "rule": "if obj[2]>0:", "feature_idx": 2, "feature_name": "Protection_from_defuse", "instances": 161, "metric": 0.9203523274205176, "return_statement": 0, "tree_id": 0}, -{"current_level": 3, "leaf_id": "65c72152-de8d-11ec-8a44-d43d7ef1576e", "parents": "65c72151-de8d-11ec-adc4-d43d7ef1576e", "rule": "return 'detonate'", "feature_idx": 2, "feature_name": "Protection_from_defuse", "instances": 161, "metric": 0, "return_statement": 1, "tree_id": 0}, -{"current_level": 1, "leaf_id": "65cb8dc2-de8d-11ec-b823-d43d7ef1576e", "parents": "root", "rule": "if obj[4]>80.67436609605278:", "feature_idx": 4, "feature_name": "Random_detonation_chance", "instances": 200, "metric": 0.9964625048848765, "return_statement": 0, "tree_id": 0}, -{"current_level": 2, "leaf_id": "65cb8dc3-de8d-11ec-a99c-d43d7ef1576e", "parents": "65cb8dc2-de8d-11ec-b823-d43d7ef1576e", "rule": "return 'detonate'", "feature_idx": 4, "feature_name": "Random_detonation_chance", "instances": 200, "metric": 0, "return_statement": 1, "tree_id": 0} +{"current_level": 1, "leaf_id": "3da5aae2-e008-11ec-95c1-d43d7ef1576e", "parents": "root", "rule": "else: return 'detonate'", "feature_idx": -1, "feature_name": "", "instances": 200, "metric": 0, "return_statement": 0, "tree_id": 0}, +{"current_level": 1, "leaf_id": "3da6bcfb-e008-11ec-ba71-d43d7ef1576e", "parents": "root", "rule": "if obj[4]<=80.67436609605278:", "feature_idx": 4, "feature_name": "Random_detonation_chance", "instances": 200, "metric": 0.9964625048848765, "return_statement": 0, "tree_id": 0}, +{"current_level": 2, "leaf_id": "3db49dc5-e008-11ec-b425-d43d7ef1576e", "parents": "3da6bcfb-e008-11ec-ba71-d43d7ef1576e", "rule": "else: return 'detonate'", "feature_idx": -1, "feature_name": "", "instances": 161, "metric": 0, "return_statement": 0, "tree_id": 0}, +{"current_level": 2, "leaf_id": "3db5af1f-e008-11ec-ba0b-d43d7ef1576e", "parents": "3da6bcfb-e008-11ec-ba71-d43d7ef1576e", "rule": "if obj[2]<=0:", "feature_idx": 2, "feature_name": "Protection_from_defuse", "instances": 161, "metric": 0.9203523274205176, "return_statement": 0, "tree_id": 0}, +{"current_level": 3, "leaf_id": "3dc2a6e1-e008-11ec-ba72-d43d7ef1576e", "parents": "3db5af1f-e008-11ec-ba0b-d43d7ef1576e", "rule": "else: return 'detonate'", "feature_idx": -1, "feature_name": "", "instances": 135, "metric": 0, "return_statement": 0, "tree_id": 0}, +{"current_level": 3, "leaf_id": "3dc39134-e008-11ec-9943-d43d7ef1576e", "parents": "3db5af1f-e008-11ec-ba0b-d43d7ef1576e", "rule": "if obj[3]<=7:", "feature_idx": 3, "feature_name": "Meters_under_the_ground", "instances": 135, "metric": 0.7364977795505669, "return_statement": 0, "tree_id": 0}, +{"current_level": 4, "leaf_id": "3dcd2d59-e008-11ec-9f6f-d43d7ef1576e", "parents": "3dc39134-e008-11ec-9943-d43d7ef1576e", "rule": "else: return 'defuse'", "feature_idx": -1, "feature_name": "", "instances": 116, "metric": 0, "return_statement": 0, "tree_id": 0}, +{"current_level": 4, "leaf_id": "3dce17a5-e008-11ec-acb7-d43d7ef1576e", "parents": "3dc39134-e008-11ec-9943-d43d7ef1576e", "rule": "if obj[1]<=1997.8794790831414:", "feature_idx": 1, "feature_name": "Year(older_more_difficult)", "instances": 116, "metric": 0.3936164041111624, "return_statement": 0, "tree_id": 0}, +{"current_level": 5, "leaf_id": "3dd4f4e4-e008-11ec-9a04-d43d7ef1576e", "parents": "3dce17a5-e008-11ec-acb7-d43d7ef1576e", "rule": "else: return 'defuse'", "feature_idx": -1, "feature_name": "", "instances": 97, "metric": 0, "return_statement": 0, "tree_id": 0}, +{"current_level": 5, "leaf_id": "3dd5df33-e008-11ec-a66b-d43d7ef1576e", "parents": "3dce17a5-e008-11ec-acb7-d43d7ef1576e", "rule": "if obj[5]<=2:", "feature_idx": 5, "feature_name": "Detonation_power_in_m", "instances": 97, "metric": 0.445693177722561, "return_statement": 0, "tree_id": 0}, +{"current_level": 6, "leaf_id": "3dd9615a-e008-11ec-a021-d43d7ef1576e", "parents": "3dd5df33-e008-11ec-a66b-d43d7ef1576e", "rule": "else: return 'defuse'", "feature_idx": -1, "feature_name": "", "instances": 65, "metric": 0, "return_statement": 0, "tree_id": 0}, +{"current_level": 6, "leaf_id": "3dda7234-e008-11ec-bf9b-d43d7ef1576e", "parents": "3dd5df33-e008-11ec-a66b-d43d7ef1576e", "rule": "if obj[0]>3:", "feature_idx": 0, "feature_name": "Size(bigger_more_difficult)", "instances": 65, "metric": 0.33352200393097664, "return_statement": 0, "tree_id": 0}, +{"current_level": 7, "leaf_id": "3dda7235-e008-11ec-bf80-d43d7ef1576e", "parents": "3dda7234-e008-11ec-bf9b-d43d7ef1576e", "rule": "return 'defuse'", "feature_idx": 0, "feature_name": "Size(bigger_more_difficult)", "instances": 65, "metric": 0, "return_statement": 1, "tree_id": 0}, +{"current_level": 6, "leaf_id": "3de6589c-e008-11ec-b9e2-d43d7ef1576e", "parents": "3dd5df33-e008-11ec-a66b-d43d7ef1576e", "rule": "if obj[0]<=3:", "feature_idx": 0, "feature_name": "Size(bigger_more_difficult)", "instances": 65, "metric": 0.33352200393097664, "return_statement": 0, "tree_id": 0}, +{"current_level": 7, "leaf_id": "3de6589d-e008-11ec-ac82-d43d7ef1576e", "parents": "3de6589c-e008-11ec-b9e2-d43d7ef1576e", "rule": "return 'defuse'", "feature_idx": 0, "feature_name": "Size(bigger_more_difficult)", "instances": 65, "metric": 0, "return_statement": 1, "tree_id": 0}, +{"current_level": 5, "leaf_id": "3dfdfd61-e008-11ec-a211-d43d7ef1576e", "parents": "3dce17a5-e008-11ec-acb7-d43d7ef1576e", "rule": "if obj[5]>2:", "feature_idx": 5, "feature_name": "Detonation_power_in_m", "instances": 97, "metric": 0.445693177722561, "return_statement": 0, "tree_id": 0}, +{"current_level": 6, "leaf_id": "3e01a611-e008-11ec-910f-d43d7ef1576e", "parents": "3dfdfd61-e008-11ec-a211-d43d7ef1576e", "rule": "else: return 'defuse'", "feature_idx": -1, "feature_name": "", "instances": 32, "metric": 0, "return_statement": 0, "tree_id": 0}, +{"current_level": 6, "leaf_id": "3e029055-e008-11ec-94d4-d43d7ef1576e", "parents": "3dfdfd61-e008-11ec-a211-d43d7ef1576e", "rule": "if obj[0]<=7:", "feature_idx": 0, "feature_name": "Size(bigger_more_difficult)", "instances": 32, "metric": 0.6252624052234231, "return_statement": 0, "tree_id": 0}, +{"current_level": 7, "leaf_id": "3e029056-e008-11ec-80d0-d43d7ef1576e", "parents": "3e029055-e008-11ec-94d4-d43d7ef1576e", "rule": "return 'defuse'", "feature_idx": 0, "feature_name": "Size(bigger_more_difficult)", "instances": 32, "metric": 0, "return_statement": 1, "tree_id": 0}, +{"current_level": 6, "leaf_id": "3e0e9dd1-e008-11ec-8ed3-d43d7ef1576e", "parents": "3dfdfd61-e008-11ec-a211-d43d7ef1576e", "rule": "if obj[0]>7:", "feature_idx": 0, "feature_name": "Size(bigger_more_difficult)", "instances": 32, "metric": 0.6252624052234231, "return_statement": 0, "tree_id": 0}, +{"current_level": 7, "leaf_id": "3e0e9dd2-e008-11ec-9bd3-d43d7ef1576e", "parents": "3e0e9dd1-e008-11ec-8ed3-d43d7ef1576e", "rule": "return 'defuse'", "feature_idx": 0, "feature_name": "Size(bigger_more_difficult)", "instances": 32, "metric": 0, "return_statement": 1, "tree_id": 0}, +{"current_level": 4, "leaf_id": "3e324f8e-e008-11ec-a2cf-d43d7ef1576e", "parents": "3dc39134-e008-11ec-9943-d43d7ef1576e", "rule": "if obj[1]>1997.8794790831414:", "feature_idx": 1, "feature_name": "Year(older_more_difficult)", "instances": 116, "metric": 0.3936164041111624, "return_statement": 0, "tree_id": 0}, +{"current_level": 5, "leaf_id": "3e324f8f-e008-11ec-b0e5-d43d7ef1576e", "parents": "3e324f8e-e008-11ec-a2cf-d43d7ef1576e", "rule": "return 'defuse'", "feature_idx": 1, "feature_name": "Year(older_more_difficult)", "instances": 116, "metric": 0, "return_statement": 1, "tree_id": 0}, +{"current_level": 3, "leaf_id": "3e4a6970-e008-11ec-82ec-d43d7ef1576e", "parents": "3db5af1f-e008-11ec-ba0b-d43d7ef1576e", "rule": "if obj[3]>7:", "feature_idx": 3, "feature_name": "Meters_under_the_ground", "instances": 135, "metric": 0.7364977795505669, "return_statement": 0, "tree_id": 0}, +{"current_level": 4, "leaf_id": "3e4a6971-e008-11ec-b6a1-d43d7ef1576e", "parents": "3e4a6970-e008-11ec-82ec-d43d7ef1576e", "rule": "return 'detonate'", "feature_idx": 3, "feature_name": "Meters_under_the_ground", "instances": 135, "metric": 0, "return_statement": 1, "tree_id": 0}, +{"current_level": 2, "leaf_id": "3e625c50-e008-11ec-8286-d43d7ef1576e", "parents": "3da6bcfb-e008-11ec-ba71-d43d7ef1576e", "rule": "if obj[2]>0:", "feature_idx": 2, "feature_name": "Protection_from_defuse", "instances": 161, "metric": 0.9203523274205176, "return_statement": 0, "tree_id": 0}, +{"current_level": 3, "leaf_id": "3e625c51-e008-11ec-bcac-d43d7ef1576e", "parents": "3e625c50-e008-11ec-8286-d43d7ef1576e", "rule": "return 'detonate'", "feature_idx": 2, "feature_name": "Protection_from_defuse", "instances": 161, "metric": 0, "return_statement": 1, "tree_id": 0}, +{"current_level": 1, "leaf_id": "3e7da9c6-e008-11ec-9254-d43d7ef1576e", "parents": "root", "rule": "if obj[4]>80.67436609605278:", "feature_idx": 4, "feature_name": "Random_detonation_chance", "instances": 200, "metric": 0.9964625048848765, "return_statement": 0, "tree_id": 0}, +{"current_level": 2, "leaf_id": "3e7da9c7-e008-11ec-81ca-d43d7ef1576e", "parents": "3e7da9c6-e008-11ec-9254-d43d7ef1576e", "rule": "return 'detonate'", "feature_idx": 4, "feature_name": "Random_detonation_chance", "instances": 200, "metric": 0, "return_statement": 1, "tree_id": 0} ] \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index 507bef1..73c4243 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,4 @@ pygame -chefboost \ No newline at end of file +chefboost +tensorflow #--upgrade +sklearn \ No newline at end of file