Beispiel #1
0
    def __init__(self, parent, controller):
        """
        Parameters
        ----------

        :param parent: window
        :param controller: GUI controller
        """

        tk.Frame.__init__(self, parent)

        # Page init
        self.controller = controller
        self.menubar = Menubar(controller)
        # Disables ability to tear menu bar into own window
        self.controller.option_add('*tearOff', 'FALSE')
        system_logo = CROSS_WINDOWS_SETTINGS.get('LOGO')
        photo_location = os.path.join(system_logo)
        global logo_img
        logo_img = tk.PhotoImage(file=photo_location)

        # Page header
        self.logo_png = tk.Button(self)
        self.logo_png.place(relx=0.28, rely=0.029, height=172, width=300)
        set_logo_configuration(self.logo_png, image=logo_img)

        self.instructions = tk.Label(self)
        self.instructions.place(relx=0.015, rely=0.3, height=32, width=635)
        self.instructions.configure(
            text=
            '''Please select the algorithms for which you want to build anomaly detection models.'''
        )
        set_widget_to_left(self.instructions)

        # Page body
        self.anomaly_detection_methods = Checkbar(
            self,
            picks=load_anomaly_detection_list(),
            editButtons=True,
            checkCallback=self.set_algorithm_checked)
        self.anomaly_detection_methods.place(relx=0.1,
                                             rely=0.35,
                                             height=400,
                                             width=700)

        # Page footer
        self.next_button = HoverButton(self, command=self.next_window)
        self.next_button.place(relx=0.813, rely=0.839, height=25, width=81)
        set_button_configuration(self.next_button, text='''Next''')

        self.back_button = HoverButton(
            self, command=lambda: controller.show_frame("NewModel"))
        self.back_button.place(relx=0.017, rely=0.839, height=25, width=81)
        set_button_configuration(self.back_button, text='''Back''')

        self.copyright = tk.Label(self)
        self.copyright.place(relx=0, rely=0.958, height=25, width=750)
        set_copyright_configuration(self.copyright)
    def __init__(self, parent, controller):
        """
        Parameters
        ----------

        :param parent: window
        :param controller: GUI controller
        """

        tk.Frame.__init__(self, parent)

        # Page init
        self.controller = controller
        self.menubar = Menubar(controller)
        # Disables ability to tear menu bar into own window
        self.controller.option_add('*tearOff', 'FALSE')
        system_logo = CROSS_WINDOWS_SETTINGS.get('LOGO')
        photo_location = os.path.join(system_logo)
        global logo_img
        logo_img = tk.PhotoImage(file=photo_location)

        # Page header
        self.logo_png = tk.Button(self)
        self.logo_png.place(relx=0.28, rely=0.029, height=172, width=300)
        set_logo_configuration(self.logo_png, image=logo_img)

        self.instructions = tk.Label(self)
        self.instructions.place(relx=0.015, rely=0.3, height=32, width=635)
        self.instructions.configure(
            text='''Please select your choice for parameters tuning:''')
        set_widget_to_left(self.instructions)

        # Page body
        self.reinitialize()

        # Page footer
        self.next_button = HoverButton(self, command=self.next_window)
        self.next_button.place(relx=0.813, rely=0.839, height=25, width=81)
        set_button_configuration(self.next_button, text='''Next''')

        self.back_button = HoverButton(self, command=self.back_window)
        self.back_button.place(relx=0.017, rely=0.839, height=25, width=81)
        set_button_configuration(self.back_button, text='''Back''')

        self.copyright = tk.Label(self)
        self.copyright.place(relx=0, rely=0.958, height=25, width=750)
        set_copyright_configuration(self.copyright)
Beispiel #3
0
    def __init__(self, parent, controller):
        """
        Parameters
        ----------

        :param parent: window
        :param controller: GUI controller
        """

        tk.Frame.__init__(self, parent)

        # Page init
        self.controller = controller
        self.menubar = Menubar(controller)
        # Disables ability to tear menu bar into own window
        self.controller.option_add('*tearOff', 'FALSE')
        system_logo = CROSS_WINDOWS_SETTINGS.get('LOGO')
        photo_location = os.path.join(system_logo)
        global logo_img
        logo_img = tk.PhotoImage(file=photo_location)

        # Page header
        self.logo_png = tk.Button(self)
        self.logo_png.place(relx=0.28, rely=0.029, height=172, width=300)
        set_logo_configuration(self.logo_png, image=logo_img)

        self.instructions = tk.Label(self)
        self.instructions.place(relx=0.015, rely=0.3, height=32, width=635)
        self.instructions.configure(
            text='''Please choose both input and target features:''')
        set_widget_to_left(self.instructions)

        # Page body

        # initialize features columns options
        self.features_columns_options = {}
        self.features_columns_options = self.get_features_columns_options()

        self.csv_features = tk.StringVar()
        self.csv_features.set(self.features_columns_options)

        self.features_instructions = tk.Label(self)
        self.features_instructions.place(relx=0.05,
                                         rely=0.34,
                                         height=22,
                                         width=100)
        self.features_instructions.configure(text='''Input features:''')
        set_widget_to_left(self.features_instructions)

        self.features_listbox = tk.Listbox(
            self,
            font=tkfont.Font(size=9),
            listvariable=self.csv_features,
            selectmode=tk.MULTIPLE,
            exportselection=
            0,  # Fix : ComboBox clears unrelated ListBox selection
            width=120,
            height=180,
            bd=3,
            bg='antique white',
            selectbackground='sandy brown')
        self.features_listbox.place(relx=0.05,
                                    rely=0.42,
                                    height=230,
                                    width=140)

        self.target_instructions = tk.Label(self)
        self.target_instructions.place(relx=0.35,
                                       rely=0.34,
                                       height=22,
                                       width=100)
        self.target_instructions.configure(text='''Target features:''')
        set_widget_to_left(self.target_instructions)

        self.target_features_listbox = tk.Listbox(
            self,
            font=tkfont.Font(size=9),
            listvariable=self.csv_features,
            selectmode=tk.MULTIPLE,
            exportselection=0,
            # Fix : ComboBox clears unrelated ListBox selection
            width=120,
            height=180,
            bd=3,
            bg='antique white',
            selectbackground='sandy brown')
        self.target_features_listbox.place(relx=0.35,
                                           rely=0.42,
                                           height=230,
                                           width=140)

        # Side logo
        feature_selection_logo = CROSS_WINDOWS_SETTINGS.get(
            'FEATURE_SELECTION')
        feature_selection_photo_location = os.path.join(feature_selection_logo)
        global fs_logo_img
        fs_logo_img = tk.PhotoImage(file=feature_selection_photo_location)

        self.features_logo_png = tk.Button(self)
        self.features_logo_png.place(relx=0.6,
                                     rely=0.28,
                                     height=200,
                                     width=200)
        set_logo_configuration(self.features_logo_png, image=fs_logo_img)

        # Page footer
        self.next_button = HoverButton(self, command=self.next_window)
        self.next_button.place(relx=0.813, rely=0.839, height=25, width=81)
        set_button_configuration(self.next_button, text='''Next''')

        self.back_button = HoverButton(self, command=self.back_window)
        self.back_button.place(relx=0.017, rely=0.839, height=25, width=81)
        set_button_configuration(self.back_button, text='''Back''')

        self.copyright = tk.Label(self)
        self.copyright.place(relx=0, rely=0.958, height=25, width=750)
        set_copyright_configuration(self.copyright)
Beispiel #4
0
    def __init__(self, parent, controller):
        """
        Parameters
        ----------

        :param parent: window
        :param controller: GUI controller
        """

        tk.Frame.__init__(self, parent)

        # Page init
        self.controller = controller
        self.menubar = Menubar(controller)
        # Disables ability to tear menu bar into own window
        self.controller.option_add('*tearOff', 'FALSE')
        system_logo = CROSS_WINDOWS_SETTINGS.get('LOGO')
        photo_location = os.path.join(system_logo)
        global logo_img
        logo_img = tk.PhotoImage(file=photo_location)

        # Page header
        self.logo_png = tk.Button(self)
        self.logo_png.place(relx=0.28, rely=0.029, height=172, width=300)
        set_logo_configuration(self.logo_png, image=logo_img)

        self.instructions = tk.Label(self)
        self.instructions.place(relx=0.015, rely=0.3, height=32, width=635)
        self.instructions.configure(
            text=
            '''Please choose similarity functions from the following options.'''
        )
        set_widget_to_left(self.instructions)

        # Page body
        self.similarity_functions = Checkbar(
            self,
            load_similarity_list(),
            checkCallback=self.set_similarity_score)
        self.similarity_functions.place(relx=0.1,
                                        rely=0.36,
                                        height=400,
                                        width=700)

        self.save_model_var = tk.IntVar()
        self.save_model_check_button = tk.Checkbutton(
            self,
            text="Save model",
            variable=self.save_model_var,
            command=self.set_saving_model)

        self.note = tk.Label(self)
        self.note.place(relx=0.015, rely=0.7, height=32, width=635)
        self.note.configure(
            text=
            '''Note: Similarity function is used for calculating a score for each record''',
            font=Font(size=9, weight=BOLD))
        set_widget_to_left(self.note)

        # Page footer
        self.next_button = HoverButton(self, command=self.next_window)
        self.next_button.place(relx=0.813, rely=0.839, height=25, width=81)
        set_button_configuration(self.next_button, text='''Run''')

        self.back_button = HoverButton(self, command=self.back_window)
        self.back_button.place(relx=0.017, rely=0.839, height=25, width=81)
        set_button_configuration(self.back_button, text='''Back''')

        self.copyright = tk.Label(self)
        self.copyright.place(relx=0, rely=0.958, height=25, width=750)
        set_copyright_configuration(self.copyright)
    def __init__(self, parent, controller):

        """
        Parameters
        ----------

        :param parent: window
        :param controller: GUI controller
        """

        tk.Frame.__init__(self, parent)

        # Page init
        self.controller = controller
        self.menubar = Menubar(controller)
        # Disables ability to tear menu bar into own window
        self.controller.option_add('*tearOff', 'FALSE')
        system_logo = CROSS_WINDOWS_SETTINGS.get('LOGO')
        photo_location = os.path.join(system_logo)
        global logo_img
        logo_img = tk.PhotoImage(file=photo_location)

        # Page header
        self.logo_png = tk.Button(self)
        self.logo_png.place(relx=0.28, rely=0.029, height=172, width=300)
        set_logo_configuration(self.logo_png, image=logo_img)

        self.instructions = tk.Label(self)
        self.instructions.place(relx=0.015, rely=0.3, height=32, width=635)
        self.instructions.configure(
            text='''Please insert input files for existing model.''')
        set_widget_to_left(self.instructions)

        # Page body

        # Testing input directory
        self.test_label = tk.Label(self)
        self.test_label.place(relx=0.015, rely=0.4, height=32, width=146)
        self.test_label.configure(text='''Test directory''')
        set_widget_to_left(self.test_label)

        self.test_input = tk.Entry(self)
        self.test_input.place(relx=0.195, rely=0.4, height=25, relwidth=0.624)

        self.test_btn = HoverButton(self, command=self.set_test_path)
        self.test_btn.place(relx=0.833, rely=0.4, height=25, width=60)
        set_button_configuration(self.test_btn, text='''Browse''')

        # Results output directory
        self.results_label = tk.Label(self)
        self.results_label.place(relx=0.015, rely=0.5, height=32, width=146)
        self.results_label.configure(text='''Results directory''')
        set_widget_to_left(self.results_label)

        self.results_input = tk.Entry(self)
        self.results_input.place(relx=0.195, rely=0.5, height=25, relwidth=0.624)

        self.results_btn = HoverButton(self, command=self.set_results_path)
        self.results_btn.place(relx=0.833, rely=0.5, height=25, width=60)
        set_button_configuration(self.results_btn, text='''Browse''')

        # Page footer
        self.next_button = HoverButton(self, command=self.next_window)
        self.next_button.place(relx=0.813, rely=0.839, height=25, width=81)
        set_button_configuration(self.next_button, text='''Next''')

        self.back_button = HoverButton(self, command=self.back_window)
        self.back_button.place(relx=0.017, rely=0.839, height=25, width=81)
        set_button_configuration(self.back_button, text='''Back''')

        self.copyright = tk.Label(self)
        self.copyright.place(relx=0, rely=0.958, height=25, width=750)
        set_copyright_configuration(self.copyright)
    def __init__(self, parent, controller):

        """
        Parameters
        ----------

        :param parent: window
        :param controller: GUI controller
        """

        tk.Frame.__init__(self, parent)

        # Page init
        self.controller = controller
        self.menubar = Menubar(controller)
        # Disables ability to tear menu bar into own window
        self.controller.option_add('*tearOff', 'FALSE')
        system_logo = CROSS_WINDOWS_SETTINGS.get('LOGO')
        photo_location = os.path.join(system_logo)
        global logo_img
        logo_img = tk.PhotoImage(file=photo_location)

        # Page header
        self.logo_png = tk.Button(self)
        self.logo_png.place(relx=0.28, rely=0.029, height=172, width=300)
        set_logo_configuration(self.logo_png, image=logo_img)

        self.instructions = tk.Label(self)
        self.instructions.place(relx=0.015, rely=0.3, height=32, width=635)
        self.instructions.configure(
            text='''Please insert paths for existing models.''')
        set_widget_to_left(self.instructions)

        # Page body
        self.algorithms = dict()
        self.browse_buttons = dict()
        self.input_entries = dict()

        # LSTM existing algorithm
        self.lstm_var = tk.IntVar()
        self.lstm_check_button = tk.Checkbutton(self)
        self.lstm_check_button.place(relx=0.015, rely=0.38, height=32, width=146)
        self.lstm_check_button.configure(text="LSTM",
                                         variable=self.lstm_var,
                                         command=lambda: self.set_input_entry("LSTM", self.lstm_var.get()))
        set_widget_to_left(self.lstm_check_button)

        self.lstm_input = tk.Entry(self)
        self.lstm_input.place(relx=0.195, rely=0.38, height=25, relwidth=0.624)
        self.lstm_input.configure(state='disabled')

        self.lstm_btn = HoverButton(self, command=lambda: self.set_algorithm_path("LSTM"))
        self.lstm_btn.place(relx=0.833, rely=0.38, height=25, width=60)
        self.lstm_btn.configure(state='disabled')
        set_button_configuration(self.lstm_btn, text='''Browse''')

        self.browse_buttons["LSTM"] = self.lstm_btn
        self.input_entries["LSTM"] = self.lstm_input

        # SVR existing algorithm
        self.svr_var = tk.IntVar()
        self.svr_check_button = tk.Checkbutton(self)
        self.svr_check_button.place(relx=0.015, rely=0.47, height=32, width=146)
        self.svr_check_button.configure(text="SVR",
                                        variable=self.svr_var,
                                        command=lambda: self.set_input_entry("SVR", self.svr_var.get()))
        set_widget_to_left(self.svr_check_button)

        self.svr_input = tk.Entry(self)
        self.svr_input.place(relx=0.195, rely=0.47, height=25, relwidth=0.624)
        self.svr_input.configure(state='disabled')

        self.svr_btn = HoverButton(self, command=lambda: self.set_algorithm_path("SVR"))
        self.svr_btn.place(relx=0.833, rely=0.47, height=25, width=60)
        self.svr_btn.configure(state='disabled')
        set_button_configuration(self.svr_btn, text='''Browse''')

        self.browse_buttons["SVR"] = self.svr_btn
        self.input_entries["SVR"] = self.svr_input

        # MLP existing algorithm
        self.mlp_var = tk.IntVar()
        self.mlp_check_button = tk.Checkbutton(self)
        self.mlp_check_button.place(relx=0.015, rely=0.56, height=32, width=146)
        self.mlp_check_button.configure(text="MLP",
                                        variable=self.mlp_var,
                                        command=lambda: self.set_input_entry("MLP",
                                                                             self.mlp_var.get()))
        set_widget_to_left(self.mlp_check_button)

        self.mlp_input = tk.Entry(self)
        self.mlp_input.place(relx=0.195, rely=0.56, height=25, relwidth=0.624)
        self.mlp_input.configure(state='disabled')

        self.mlp_btn = HoverButton(self, command=lambda: self.set_algorithm_path("MLP"))
        self.mlp_btn.place(relx=0.833, rely=0.56, height=25, width=60)
        self.mlp_btn.configure(state='disabled')
        set_button_configuration(self.mlp_btn, text='''Browse''')

        self.browse_buttons["MLP"] = self.mlp_btn
        self.input_entries["MLP"] = self.mlp_input

        # Random Forest existing algorithm
        self.random_forest_var = tk.IntVar()
        self.random_forest_check_button = tk.Checkbutton(self)
        self.random_forest_check_button.place(relx=0.015, rely=0.65, height=32, width=146)
        self.random_forest_check_button.configure(text="Random Forest",
                                                  variable=self.random_forest_var,
                                                  command=lambda: self.set_input_entry("Random Forest",
                                                                                       self.random_forest_var.get()))
        set_widget_to_left(self.random_forest_check_button)

        self.random_forest_input = tk.Entry(self)
        self.random_forest_input.place(relx=0.195, rely=0.65, height=25, relwidth=0.624)
        self.random_forest_input.configure(state='disabled')

        self.random_forest_btn = HoverButton(self, command=lambda: self.set_algorithm_path("Random Forest"))
        self.random_forest_btn.place(relx=0.833, rely=0.65, height=25, width=60)
        self.random_forest_btn.configure(state='disabled')
        set_button_configuration(self.random_forest_btn, text='''Browse''')

        self.browse_buttons["Random Forest"] = self.random_forest_btn
        self.input_entries["Random Forest"] = self.random_forest_input

        # Page footer
        self.next_button = HoverButton(self, command=self.next_window)
        self.next_button.place(relx=0.813, rely=0.839, height=25, width=81)
        set_button_configuration(self.next_button, text='''Next''')

        self.back_button = HoverButton(self, command=self.back_window)
        self.back_button.place(relx=0.017, rely=0.839, height=25, width=81)
        set_button_configuration(self.back_button, text='''Back''')

        self.copyright = tk.Label(self)
        self.copyright.place(relx=0, rely=0.958, height=25, width=750)
        set_copyright_configuration(self.copyright)