From 1ceb3dac2a888f9e3e07a55b3c7b2c9d0287e68e Mon Sep 17 00:00:00 2001
From: atla8167 <athanasio.lakes@dsv.su.se>
Date: Tue, 7 Jan 2025 14:55:34 +0200
Subject: [PATCH] Fixed home.js bug on radio buttons

---
 .../src/gc_latentcf_search_1dcnn_function.py  |   4 +-
 .../src/glacier_compute_counterfactuals.py    |   3 +-
 base/handlers/ajaxCounterfactualsHandler.py   | 133 +++++-----
 .../trained_models/lr/counterfactuals.csv     |  10 +-
 .../trained_models/lr/tsne_cfs.sav            | Bin 12085 -> 12085 bytes
 base/static/js/home.js                        |  10 +-
 base/static/js/main.js                        |  56 ++--
 create_requeirements.py                       |  27 ++
 extremum_web/settings.py                      |  19 +-
 requirements.txt                              | 204 +--------------
 requirements_temp.txt                         | 243 ++++++++++++++++++
 11 files changed, 402 insertions(+), 307 deletions(-)
 create mode 100644 create_requeirements.py
 create mode 100644 requirements_temp.txt

diff --git a/base/glacier/src/gc_latentcf_search_1dcnn_function.py b/base/glacier/src/gc_latentcf_search_1dcnn_function.py
index 73b85c50c..2f1b2add5 100644
--- a/base/glacier/src/gc_latentcf_search_1dcnn_function.py
+++ b/base/glacier/src/gc_latentcf_search_1dcnn_function.py
@@ -5,11 +5,9 @@ import os
 from argparse import ArgumentParser
 import numpy as np
 import pandas as pd
-import tensorflow as tf
 from sklearn.metrics import balanced_accuracy_score, confusion_matrix
 from sklearn.model_selection import train_test_split, StratifiedKFold
-from tensorflow import keras
-from keras.utils import to_categorical
+from tensorflow.keras.utils import to_categorical
 from wildboar.datasets import load_dataset
 import pickle
 from wildboar.explain import *
diff --git a/base/glacier/src/glacier_compute_counterfactuals.py b/base/glacier/src/glacier_compute_counterfactuals.py
index 4caf3d39d..5031b2ac9 100644
--- a/base/glacier/src/glacier_compute_counterfactuals.py
+++ b/base/glacier/src/glacier_compute_counterfactuals.py
@@ -3,8 +3,7 @@
 
 import numpy as np
 import pandas as pd
-from tensorflow import keras
-from keras.utils import to_categorical
+from tensorflow.keras.utils import to_categorical
 from sklearn.metrics import balanced_accuracy_score, confusion_matrix
 
 from .help_functions import (
diff --git a/base/handlers/ajaxCounterfactualsHandler.py b/base/handlers/ajaxCounterfactualsHandler.py
index 8ce97890d..c277bb29a 100644
--- a/base/handlers/ajaxCounterfactualsHandler.py
+++ b/base/handlers/ajaxCounterfactualsHandler.py
@@ -9,7 +9,7 @@ from .. import methods
 from ..methods import PIPELINE_PATH
 import math
 import numpy as np
-from .. glacier.src.glacier_compute_counterfactuals import gc_compute_counterfactuals
+# from .. glacier.src.glacier_compute_counterfactuals import gc_compute_counterfactuals
 import base.pipeline as pipeline
 import concurrent.futures
 import json
@@ -502,81 +502,82 @@ def handler(action, request):
                 "fig": fig.to_html(),
                 "dataset_type": dataset_type,
             }
-    elif action == "compute_cf":
-        model_name = request.POST.get("model_name")
-        if model_name == "glacier":
-            constraint_type = request.POST.get("constraint")
-            w_value = request.POST.get("w_value")
-            df_name = request.session.get("df_name")
+    # elif action == "compute_cf":
+    #     model_name = request.POST.get("model_name")
+    #     if model_name == "glacier":
+    #         print("EDWWW EIMAIIIII") 
+    #         constraint_type = request.POST.get("constraint")
+    #         w_value = request.POST.get("w_value")
+    #         df_name = request.session.get("df_name")
 
-            model_name_path = os.path.join(
-                PIPELINE_PATH + f"{df_name}/" + "trained_models/" + f"{model_name}/"
-            )
-            model_name_path_constraint = model_name_path + f"{constraint_type}/"
-            if not os.path.exists(model_name_path_constraint):
-                os.makedirs(model_name_path_constraint)
+    #         model_name_path = os.path.join(
+    #             PIPELINE_PATH + f"{df_name}/" + "trained_models/" + f"{model_name}/"
+    #         )
+    #         model_name_path_constraint = model_name_path + f"{constraint_type}/"
+    #         if not os.path.exists(model_name_path_constraint):
+    #             os.makedirs(model_name_path_constraint)
 
-            # https://github.com/wildboar-foundation/wildboar/blob/master/docs/guide/explain/counterfactuals.rst#id27
-            classifier = joblib.load(model_name_path + "/classifier.sav")
+    #         # https://github.com/wildboar-foundation/wildboar/blob/master/docs/guide/explain/counterfactuals.rst#id27
+    #         classifier = joblib.load(model_name_path + "/classifier.sav")
 
-            # pipeline path
-            json_path = os.path.join(PIPELINE_PATH, f"{df_name}" + "/pipeline.json")
-            # load pipeline data
-            jsonFile = pipeline.PipelineJSON(json_path)
-            autoencoder = jsonFile.read_from_json(
-                ["classifier", model_name, "autoencoder"]
-            )
+    #         # pipeline path
+    #         json_path = os.path.join(PIPELINE_PATH, f"{df_name}" + "/pipeline.json")
+    #         # load pipeline data
+    #         jsonFile = pipeline.PipelineJSON(json_path)
+    #         autoencoder = jsonFile.read_from_json(
+    #             ["classifier", model_name, "autoencoder"]
+    #         )
 
-            experiment_dict = {"constraint": constraint_type, "w_value": w_value}
+    #         experiment_dict = {"constraint": constraint_type, "w_value": w_value}
 
-            # if "experiments" in pipeline_data["classifier"][model_name]:
-            #     # if there exists key with value "experiments"
-            #     keys = pipeline_data["classifier"][model_name]["experiments"].keys()
-            #     last_key_int = int(list(keys)[-1])
-            #     last_key_int_incr_str = str(last_key_int + 1)
-            # else:
-            #     last_key_int_incr_str = "0"
-            #     experiment_key_dict = {"experiments": {last_key_int_incr_str: {}}}
-            #     pipeline_data["classifier"][model_name].update(experiment_key_dict)
+    #         # if "experiments" in pipeline_data["classifier"][model_name]:
+    #         #     # if there exists key with value "experiments"
+    #         #     keys = pipeline_data["classifier"][model_name]["experiments"].keys()
+    #         #     last_key_int = int(list(keys)[-1])
+    #         #     last_key_int_incr_str = str(last_key_int + 1)
+    #         # else:
+    #         #     last_key_int_incr_str = "0"
+    #         #     experiment_key_dict = {"experiments": {last_key_int_incr_str: {}}}
+    #         #     pipeline_data["classifier"][model_name].update(experiment_key_dict)
 
-            # outter_dict = {last_key_int_incr_str: experiment_dict}
-            # pipeline_data["classifier"][model_name]["experiments"].update(outter_dict)
+    #         # outter_dict = {last_key_int_incr_str: experiment_dict}
+    #         # pipeline_data["classifier"][model_name]["experiments"].update(outter_dict)
 
-            if jsonFile.key_exists("experiments"):
-                keys = jsonFile.read_from_json(
-                    ["classifier", model_name, "experiments"]
-                ).keys()
-                last_key_int = int(list(keys)[-1])
-                last_key_int_incr_str = str(last_key_int + 1)
-            else:
-                last_key_int_incr_str = "0"
-                experiment_key_dict = {"experiments": {last_key_int_incr_str: {}}}
-                jsonFile.update_json(
-                    ["classifier", model_name], experiment_key_dict
-                )
+    #         if jsonFile.key_exists("experiments"):
+    #             keys = jsonFile.read_from_json(
+    #                 ["classifier", model_name, "experiments"]
+    #             ).keys()
+    #             last_key_int = int(list(keys)[-1])
+    #             last_key_int_incr_str = str(last_key_int + 1)
+    #         else:
+    #             last_key_int_incr_str = "0"
+    #             experiment_key_dict = {"experiments": {last_key_int_incr_str: {}}}
+    #             jsonFile.update_json(
+    #                 ["classifier", model_name], experiment_key_dict
+    #             )
 
-            outter_dict = {last_key_int_incr_str: experiment_dict}
-            jsonFile.update_json(
-                ["classifier", model_name, "experiments"], outter_dict
-            )
+    #         outter_dict = {last_key_int_incr_str: experiment_dict}
+    #         jsonFile.update_json(
+    #             ["classifier", model_name, "experiments"], outter_dict
+    #         )
 
-            if autoencoder == "Yes":
-                autoencoder = joblib.load(model_name_path + "/autoencoder.sav")
-            else:
-                autoencoder = None
+    #         if autoencoder == "Yes":
+    #             autoencoder = joblib.load(model_name_path + "/autoencoder.sav")
+    #         else:
+    #             autoencoder = None
 
-            gc_compute_counterfactuals(
-                model_name_path,
-                model_name_path_constraint,
-                constraint_type,
-                [0.0001],
-                float(w_value),
-                0.5,
-                classifier,
-                autoencoder,
-            )
-            path = model_name_path_constraint
-            context = {"experiment_dict": experiment_dict}
+    #         gc_compute_counterfactuals(
+    #             model_name_path,
+    #             model_name_path_constraint,
+    #             constraint_type,
+    #             [0.0001],
+    #             float(w_value),
+    #             0.5,
+    #             classifier,
+    #             autoencoder,
+    #         )
+    #         path = model_name_path_constraint
+    #         context = {"experiment_dict": experiment_dict}
     elif action == "counterfactual_select":
 
         # if <select> element is used, and a specific counterfactual
diff --git a/base/pipelines/breast-cancer/trained_models/lr/counterfactuals.csv b/base/pipelines/breast-cancer/trained_models/lr/counterfactuals.csv
index fff789121..68437c1a4 100644
--- a/base/pipelines/breast-cancer/trained_models/lr/counterfactuals.csv
+++ b/base/pipelines/breast-cancer/trained_models/lr/counterfactuals.csv
@@ -1,6 +1,6 @@
 radius_mean,texture_mean,perimeter_mean,area_mean,smoothness_mean,compactness_mean,concavity_mean,concave_points_mean,symmetry_mean,fractal_dimension_mean,radius_se,texture_se,perimeter_se,area_se,smoothness_se,compactness_se,concavity_se,concave_points_se,symmetry_se,fractal_dimension_se,radius_worst,texture_worst,perimeter_worst,area_worst,smoothness_worst,compactness_worst,concavity_worst,concave_points_worst,symmetry_worst,fractal_dimension_worst,diagnosis
-3.4750919,1.4265739434979328,0.8415556056573675,0.7790306960982,-0.9287290288417824,0.1243030532148859,0.3967456767175299,0.2177232422659307,-1.2581831090555402,-1.237229512416972,0.3783460650041405,0.8384928142480406,0.2063984456151845,0.3969751069989415,0.3560214645163229,5.52816454,0.5811193892110503,0.9122449230694496,-0.5572394479827509,8.94629564,0.8512769751812264,1.5930644652800996,0.7606941933799796,0.709171646652406,0.4923386920136878,1.0046869818114612,1.1102021958363144,0.9028424668080596,-0.6483348204153583,-0.2496935447689396,0
-0.8925737602393428,1.4265739434979328,0.8415556056573675,0.7790306960982,-0.9287290288417824,0.1243030532148859,0.3967456767175299,0.2177232422659307,-1.2581831090555402,-1.237229512416972,0.3783460650041405,0.8384928142480406,0.2063984456151845,0.3969751069989415,0.3560214645163229,0.9837599133795216,0.5811193892110503,0.9122449230694496,-0.5572394479827509,-0.0211457125063903,0.8512769751812264,-1.6061447,0.7606941933799796,-0.49913326,0.4923386920136878,1.0046869818114612,1.1102021958363144,-1.2969943,-0.6483348204153583,-0.2496935447689396,0
-0.8925737602393428,1.4265739434979328,0.8415556056573675,0.7790306960982,-0.9287290288417824,0.1243030532148859,0.3967456767175299,0.2177232422659307,-1.2581831090555402,-1.237229512416972,0.3783460650041405,6.34863972,0.2063984456151845,0.3969751069989415,7.663727671,5.86552739,0.5811193892110503,0.9122449230694496,-0.5572394479827509,9.442646901,0.8512769751812264,1.5930644652800996,0.7606941933799796,0.709171646652406,0.4923386920136878,1.0046869818114612,1.1102021958363144,0.9028424668080596,-0.6483348204153583,-0.2496935447689396,0
-0.8925737602393428,1.4265739434979328,0.8415556056573675,0.7790306960982,-0.9287290288417824,0.1243030532148859,0.3967456767175299,0.2177232422659307,-1.2581831090555402,-1.237229512416972,0.3783460650041405,6.34863972,0.2063984456151845,0.3969751069989415,0.3560214645163229,5.86552739,0.5811193892110503,0.9122449230694496,-0.5572394479827509,9.442646901,0.8512769751812264,1.5930644652800996,0.7606941933799796,0.709171646652406,0.4923386920136878,1.0046869818114612,1.1102021958363144,0.9028424668080596,-0.6483348204153583,-0.2496935447689396,0
-0.8925737602393428,1.4265739434979328,0.8415556056573675,0.7790306960982,-0.9287290288417824,0.1243030532148859,0.3967456767175299,-0.8955855,-1.2581831090555402,-1.237229512416972,0.3783460650041405,0.8384928142480406,0.2063984456151845,0.3969751069989415,0.3560214645163229,0.9837599133795216,0.5811193892110503,0.9122449230694496,-0.5572394479827509,-0.0211457125063903,0.8512769751812264,-1.7928261,0.7606941933799796,-0.71767315,0.4923386920136878,1.0046869818114612,1.1102021958363144,0.9028424668080596,-0.6483348204153583,-1.0056257,0
+-0.7092663060673473,2.3271489214378698,-0.704312609301373,-0.6819848165294249,-0.1985715944173255,-0.3525161687595716,-0.2159369130590488,-0.7415549605217517,-0.0460699008762327,-0.161268032764232,-0.3308637039371059,2.19380770550748,-0.3544712362792588,-0.3785851577996926,0.9400451433447464,-0.0725523818906913,0.3599620462044872,-0.4186853829712703,0.509462168386181,-0.63050862462314,-0.6521421926159441,2.1385911666478887,3.39703065,-0.6201619455009771,0.3608310179720982,4.13681689,0.0964854745184819,-0.704324887208948,-0.0271070656397842,-0.6509040632115424,1
+-0.7092663060673473,2.3271489214378698,-0.704312609301373,-0.6819848165294249,-0.1985715944173255,-0.3525161687595716,1.6653011,-0.7415549605217517,-0.0460699008762327,-0.161268032764232,-0.3308637039371059,2.19380770550748,-0.3544712362792588,-0.3785851577996926,0.9400451433447464,-0.0725523818906913,0.3599620462044872,-0.4186853829712703,0.509462168386181,-0.63050862462314,-0.6521421926159441,2.1385911666478887,1.40965287,-0.6201619455009771,0.3608310179720982,-0.3254811654644232,0.0964854745184819,-0.704324887208948,-0.0271070656397842,-0.6509040632115424,1
+-0.7092663060673473,2.3271489214378698,-0.704312609301373,-0.6819848165294249,-0.1985715944173255,-0.3525161687595716,-0.2159369130590488,-0.7415549605217517,-0.0460699008762327,-0.161268032764232,-0.3308637039371059,2.19380770550748,-0.3544712362792588,-0.3785851577996926,0.9400451433447464,-0.0725523818906913,8.2396206,-0.4186853829712703,0.509462168386181,-0.63050862462314,-0.6521421926159441,2.1385911666478887,2.54140746,-0.6201619455009771,0.3608310179720982,-0.3254811654644232,0.0964854745184819,-0.704324887208948,-0.0271070656397842,-0.6509040632115424,1
+-0.7092663060673473,2.3271489214378698,-0.704312609301373,-0.6819848165294249,-0.1985715944173255,-0.3525161687595716,-0.2159369130590488,-0.7415549605217517,-0.0460699008762327,-0.161268032764232,-0.3308637039371059,-1.16869482,-0.3544712362792588,-0.3785851577996926,0.9400451433447464,-0.0725523818906913,0.3599620462044872,-0.4186853829712703,0.509462168386181,-0.63050862462314,-0.6521421926159441,2.1385911666478887,-0.6320916112173782,-0.6201619455009771,0.3608310179720982,-0.3254811654644232,0.0964854745184819,-0.704324887208948,-0.0271070656397842,-0.6509040632115424,1
+-0.7092663060673473,2.3271489214378698,-0.704312609301373,3.12509814,-0.1985715944173255,-0.3525161687595716,-0.2159369130590488,-0.7415549605217517,-0.0460699008762327,-0.161268032764232,-0.3308637039371059,2.19380770550748,-0.3544712362792588,-0.3785851577996926,0.9400451433447464,-0.0725523818906913,0.3599620462044872,-0.4186853829712703,0.509462168386181,-0.63050862462314,-0.6521421926159441,2.1385911666478887,-0.6320916112173782,-0.6201619455009771,0.3608310179720982,-0.3254811654644232,0.0964854745184819,-0.704324887208948,-0.0271070656397842,-0.6509040632115424,1
diff --git a/base/pipelines/breast-cancer/trained_models/lr/tsne_cfs.sav b/base/pipelines/breast-cancer/trained_models/lr/tsne_cfs.sav
index 969d333fad04023c0308b9362eb007b7da99395f..27d59e19be12cac33548d5c1f898bfdf2a9abecd 100644
GIT binary patch
delta 99
zcmV-p0G$7|UbSAZXcUvA6-JY-6pa&UV8=kr_NGAe!?8f=WxYR;EM=2k79Eoi6$BVs
zi9;0ZdrCper%*vi%3(ot8Bsw&f>=S5N)%(0>J@DW{Qv*o#SZenlV27m1YnasF|&#m
Fs~DKPD;)p;

delta 96
zcmV-m0H6Q0UbSAZXcUu*2s4w|6%v!K6pa)FjnqJZaC$*!h{HfD;?6+Hf_g!dPZcB-
z9#pEqY4RFD_IR$rSoo{KI>Q=4lS&k1lj;?12mk;8pxHerK$Bk<Cj>wRtRb_C7ONP~
Cq$eH#

diff --git a/base/static/js/home.js b/base/static/js/home.js
index 01b18224b..3133e3182 100755
--- a/base/static/js/home.js
+++ b/base/static/js/home.js
@@ -108,10 +108,12 @@ $(document).ready(function () {
     });
 });
 
-document.getElementById("viewModelsButton").addEventListener("click", function () {
-    // Prompt or redirect the user to the pre-trained models section
-    window.location.href = "/charts.html"; // Replace with the actual URL
-});
+if (document.getElementById("viewModelsButton")) {
+    document.getElementById("viewModelsButton").addEventListener("click", function () {
+        // Prompt or redirect the user to the pre-trained models section
+        window.location.href = "/charts.html"; // Replace with the actual URL
+    });
+}
 
 $(document).ready(function () {
     $('#timeseries-datasets').change(function () {
diff --git a/base/static/js/main.js b/base/static/js/main.js
index 248eff38c..e8ec662e1 100644
--- a/base/static/js/main.js
+++ b/base/static/js/main.js
@@ -46,13 +46,14 @@ document.getElementById("sidebarToggle").addEventListener("click", function () {
 document.addEventListener("DOMContentLoaded", function () {
     const toggleTabularIntro = document.getElementById("toggleIntro");
     const tabularIntroContent = document.getElementById("introContent");
-
-    toggleTabularIntro.addEventListener("click", function () {
-        const isExpanded = tabularIntroContent.classList.contains("show");
-        toggleTabularIntro.querySelector("span").textContent = isExpanded ? "Read More" : "Read Less";
-        toggleTabularIntro.querySelector("i").classList.toggle("fa-chevron-up", !isExpanded);
-        toggleTabularIntro.querySelector("i").classList.toggle("fa-chevron-down", isExpanded);
-    });
+    if (toggleTabularIntro) {
+        toggleTabularIntro.addEventListener("click", function () {
+            const isExpanded = tabularIntroContent.classList.contains("show");
+            toggleTabularIntro.querySelector("span").textContent = isExpanded ? "Read More" : "Read Less";
+            toggleTabularIntro.querySelector("i").classList.toggle("fa-chevron-up", !isExpanded);
+            toggleTabularIntro.querySelector("i").classList.toggle("fa-chevron-down", isExpanded);
+        });
+    }
 });
 
 document.addEventListener("DOMContentLoaded", function () {
@@ -87,34 +88,35 @@ if (document.getElementById("viewCounterfactualsButton")) {
 if (document.getElementById("viewPreTrainedButton")) {
     document.getElementById("viewPreTrainedButton").addEventListener("click", function () {
         // Redirect to the pre trained view section
-        window.location.href = "/charts.html"; 
+        window.location.href = "/charts.html";
     });
 }
 
 // JavaScript to handle delete functionality
 document.addEventListener("DOMContentLoaded", function () {
+    if (document.getElementById("radio_buttons")) {
+        document.getElementById("radio_buttons").addEventListener("click", function (event) {
+            // Identify if the click originated from the button or its child span
+            let targetButton = event.target.closest(".delete-file-icon");
+            console.log(targetButton)
+            // Only proceed if a delete-file-icon button was clicked
+            if (targetButton) {
+                // Get the filename from the data-file attribute
+                const fileName = targetButton.getAttribute("data-file");
 
-    document.getElementById("radio_buttons").addEventListener("click", function (event) {        
-        // Identify if the click originated from the button or its child span
-        let targetButton = event.target.closest(".delete-file-icon");
-        console.log(targetButton)
-        // Only proceed if a delete-file-icon button was clicked
-        if (targetButton) {
-            // Get the filename from the data-file attribute
-            const fileName = targetButton.getAttribute("data-file");
+                const fileNameValue = targetButton.getAttribute("data-file-value");
 
-            const fileNameValue = targetButton.getAttribute("data-file-value");
+                // Set the file name in the modal for display
+                document.getElementById("fileToDeleteName").innerText = fileName;
 
-            // Set the file name in the modal for display
-            document.getElementById("fileToDeleteName").innerText = fileName;
+                // Set the filename in the confirm button for reference during deletion
+                document.getElementById("confirmDeleteButton").setAttribute("data-file", fileName);
 
-            // Set the filename in the confirm button for reference during deletion
-            document.getElementById("confirmDeleteButton").setAttribute("data-file", fileName);
+                document.getElementById("confirmDeleteButton").setAttribute("data-file-value", fileNameValue);
 
-            document.getElementById("confirmDeleteButton").setAttribute("data-file-value", fileNameValue);
-
-            // Show the delete confirmation modal
-            $('#deleteFileModal').modal('show');
-        }
-    });
+                // Show the delete confirmation modal
+                $('#deleteFileModal').modal('show');
+            }
+        });
+    }
 });
\ No newline at end of file
diff --git a/create_requeirements.py b/create_requeirements.py
new file mode 100644
index 000000000..ff1978ef5
--- /dev/null
+++ b/create_requeirements.py
@@ -0,0 +1,27 @@
+import json
+
+def generate_requirements_from_json(json_file, output_file="requirements.txt"):
+    try:
+        # Load JSON data from the file
+        with open(json_file, "r") as f:
+            data = json.load(f)
+
+        # Extract the package names and versions
+        requirements = []
+        for entry in data:
+            package = entry.get("package", {})
+            package_name = package.get("package_name")
+            installed_version = package.get("installed_version")
+            if package_name and installed_version:
+                requirements.append(f"{package_name}=={installed_version}")
+
+        # Write to requirements.txt
+        with open(output_file, "w") as f:
+            f.write("\n".join(requirements))
+
+        print(f"Requirements file generated: {output_file}")
+    except Exception as e:
+        print(f"An error occurred: {e}")
+
+# Replace 'input.json' with your actual JSON file name
+generate_requirements_from_json("requirements_pipedtree.json")
diff --git a/extremum_web/settings.py b/extremum_web/settings.py
index 0de4f113e..9d440581b 100755
--- a/extremum_web/settings.py
+++ b/extremum_web/settings.py
@@ -12,7 +12,7 @@ https://docs.djangoproject.com/en/5.0/ref/settings/
 
 import os
 from pathlib import Path
-import dj_database_url
+# import dj_database_url
 
 # Build paths inside the project like this: BASE_DIR / 'subdir'.
 BASE_DIR = Path(__file__).resolve().parent.parent
@@ -33,13 +33,12 @@ ALLOWED_HOSTS = ['127.0.0.1']
 
 DEBUG_PROPAGATE_EXCEPTIONS = True
 
-
 SECURE_HSTS_SECONDS = 31536000  # One year
 SECURE_HSTS_INCLUDE_SUBDOMAINS = True
 SECURE_HSTS_PRELOAD = True
-SECURE_SSL_REDIRECT = True
-SESSION_COOKIE_SECURE = True
-CSRF_COOKIE_SECURE = True
+SECURE_SSL_REDIRECT = False
+SESSION_COOKIE_SECURE = False
+CSRF_COOKIE_SECURE = False
 
 # Application definition
 INSTALLED_APPS = [
@@ -97,11 +96,11 @@ DATABASES = {
     }
 }
 
-if 'DATABASE_URL' in os.environ:
-    DATABASES['default'] = dj_database_url.config(
-        conn_max_age=500,
-        conn_health_checks=True,
-    )
+# if 'DATABASE_URL' in os.environ:
+#     DATABASES['default'] = dj_database_url.config(
+#         conn_max_age=500,
+#         conn_health_checks=True,
+#     )
 
 # Password validation
 # https://docs.djangoproject.com/en/5.0/ref/settings/#auth-password-validators
diff --git a/requirements.txt b/requirements.txt
index 3ea681ec5..a1bbdd870 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,193 +1,17 @@
-anyio==4.4.0
-argon2-cffi==23.1.0
-argon2-cffi-bindings==21.2.0
-arrow==1.3.0
-asgiref==3.8.1
-asttokens==2.4.1
-async-lru==2.0.4
-attrs==23.2.0
-Babel==2.15.0
-backcall==0.2.0
-beautifulsoup4==4.12.3
-black==24.4.2
-bleach==6.1.0
-blinker==1.4
-cached-property==1.5.1
-certifi==2019.11.28
-cffi==1.16.0
-chardet==3.0.4
-charset-normalizer==3.3.2
-click==8.1.7
-cloud-init==24.3.1
-codecov==2.1.13
-collective.checkdocs==0.2
-comm==0.2.2
-configobj==5.0.6
-contourpy==1.2.1
-coverage==7.5.1
-crayons==0.4.0
-cryptography==2.8
-cycler==0.12.1
-dbus-python==1.2.16
-debugpy==1.8.1
-decorator==5.1.1
-defusedxml==0.7.1
-distlib==0.3.8
-distro==1.4.0
-dj-database-url==2.3.0
-Django==5.0.6
-docker==4.1.0
-docker-compose==1.25.0
-dockerpty==0.4.1
-docopt==0.6.2
-docutils==0.21.2
-et-xmlfile==1.1.0
-exceptiongroup==1.2.1
-executing==2.0.1
-fastjsonschema==2.19.1
-filelock==3.14.0
-flake8==7.0.0
-fonttools==4.53.0
-fqdn==1.5.1
-fs==2.4.16
-gease==0.0.11
-gunicorn==23.0.0
-h11==0.14.0
-httpcore==1.0.5
-httpx==0.27.0
-idna==2.8
-importlib-metadata==1.5.0
-ipykernel==6.29.4
-ipython==8.12.3
-isoduration==20.11.0
-isort==5.13.2
-jedi==0.19.1
-Jinja2==3.1.4
-jinja2-fsloader==0.3.0
+dice_ml==0.11
+dict_and_html==1.0.11
+Django==4.2.13
+fastdtw==0.3.4
+imbalanced_learn==0.12.3
 joblib==1.4.2
-json5==0.9.25
-jsonpatch==1.22
-jsonpointer==2.0
-jsonschema==4.22.0
-jsonschema-specifications==2023.12.1
-jupyter-events==0.10.0
-jupyter-lsp==2.2.5
-jupyter_client==8.6.1
-jupyter_core==5.7.2
-jupyter_server==2.14.1
-jupyter_server_terminals==0.5.3
-jupyterlab==4.2.1
-jupyterlab_pygments==0.3.0
-jupyterlab_server==2.27.2
-kiwisolver==1.4.5
-llvmlite==0.43.0
-lml==0.1.0
-lxml==5.2.2
-MarkupSafe==2.1.5
-matplotlib==3.9.0
-matplotlib-inline==0.1.7
-mccabe==0.7.0
-mistune==3.0.2
-moban==0.8.2
-moban-jinja2-github==0.0.4
-more-itertools==4.2.0
-mypy-extensions==1.0.0
-nbclient==0.10.0
-nbconvert==7.16.4
-nbformat==5.10.4
-nest-asyncio==1.6.0
-netifaces==0.10.4
-nose==1.3.7
-notebook_shim==0.2.4
-numba==0.60.0
-numpy==1.26.4
-oauthlib==3.1.0
-openpyxl==3.1.2
-overrides==7.7.0
-packaging==24.0
-pandas==2.2.2
-pandocfilters==1.5.1
-parso==0.8.4
-pathspec==0.12.1
-pexpect==4.6.0
-pickleshare==0.7.5
-pillow==10.3.0
-pip-chill==1.0.3
-pipenv==2023.12.1
-pipreqs==0.5.0
-platformdirs==4.2.2
-prometheus_client==0.20.0
-prompt-toolkit==3.0.43
-psutil==5.9.8
-psycopg2-binary==2.9.10
-ptyprocess==0.7.0
-pure-eval==0.2.2
-pycairo==1.16.2
-pycodestyle==2.11.1
-pycparser==2.22
-pyecharts-jupyter-installer==0.0.3
-pyexcel==0.7.0
-pyexcel-ezodf==0.3.4
-pyexcel-handsontable==0.0.2
-pyexcel-io==0.6.6
-pyexcel-ods3==0.6.1
-pyexcel-pygal==0.0.2
-pyexcel-webio==0.1.4
-pyexcel-xls==0.7.0
-pyexcel-xlsx==0.6.0
-pyflakes==3.2.0
-pygal==3.0.4
-Pygments==2.18.0
-PyGObject==3.36.0
-PyJWT==1.7.1
-pyOpenSSL==19.0.0
-pyparsing==3.1.2
-pyrsistent==0.15.5
-pyserial==3.4
-python-apt==2.0.1+ubuntu0.20.4.1
-python-dateutil==2.9.0.post0
-python-dotenv==1.0.1
-python-json-logger==2.0.7
-pytz==2024.1
-PyYAML==5.3.1
-pyzmq==26.0.3
-referencing==0.35.1
-requests==2.32.3
-rfc3339-validator==0.1.4
-rfc3986-validator==0.1.1
-rpds-py==0.18.1
-scikit-learn==1.5.0
-scipy==1.13.1
-Send2Trash==1.8.3
-six==1.14.0
-sniffio==1.3.1
-sos==4.7.2
-soupsieve==2.5
-sqlparse==0.5.0
-ssh-import-id==5.10
-stack-data==0.6.3
+keras==2.9.0
+matplotlib==3.9.4
+numpy==1.23.5
+pandas==1.5.3
+plotly==5.22.0
+scikit_learn==1.6.0
+scipy==1.14.1
 stumpy==1.13.0
-terminado==0.18.1
-texttable==1.6.2
-threadpoolctl==3.5.0
-tinycss2==1.3.0
-tomli==2.0.1
-tornado==6.4
-traitlets==5.14.3
-types-python-dateutil==2.9.0.20240316
-typing_extensions==4.11.0
-tzdata==2024.1
-ufw==0.36
-uri-template==1.3.0
-urllib3==1.25.8
-virtualenv==20.26.2
-virtualenv-clone==0.5.7
-wcwidth==0.2.13
-webcolors==24.6.0
-webencodings==0.5.1
-websocket-client==1.8.0
+tensorflow==2.9.1
 wildboar==1.2.0
-xlrd==2.0.1
-xlwt==1.3.0
-yarg==0.1.9
-zipp==1.0.0
+xgboost==2.1.3
diff --git a/requirements_temp.txt b/requirements_temp.txt
new file mode 100644
index 000000000..59a5d709f
--- /dev/null
+++ b/requirements_temp.txt
@@ -0,0 +1,243 @@
+absl-py==2.1.0
+alembic==1.13.2
+anyio==4.4.0
+argon2-cffi==23.1.0
+argon2-cffi-bindings==21.2.0
+args==0.1.0
+arrow==1.3.0
+asgiref==3.8.1
+asttokens==2.4.1
+astunparse==1.6.3
+async-lru==2.0.4
+async-timeout==4.0.3
+attrs==23.2.0
+autobahn==23.6.2
+Automat==22.10.0
+autopage==0.5.2
+Babel==2.15.0
+backcall==0.2.0
+beautifulsoup4==4.12.3
+bleach==6.1.0
+blinker==1.8.2
+cachetools==5.4.0
+certifi==2024.6.2
+cffi==1.16.0
+channels==4.1.0
+channels-redis==4.2.0
+charset-normalizer==3.3.2
+click==8.1.7
+cliff==4.7.0
+clint==0.5.1
+cmaes==0.10.0
+cmd2==2.4.3
+colorlog==6.8.2
+comm==0.2.2
+constantly==23.10.4
+contourpy==1.2.1
+coverage==7.6.1
+cryptography==42.0.8
+cycler==0.12.1
+Cython==3.0.10
+daphne==4.1.2
+dash==2.9.3
+dash-bootstrap-components==1.6.0
+dash-core-components==2.0.0
+dash-html-components==2.0.0
+dash-table==5.0.0
+debugpy==1.8.2
+decorator==5.1.1
+defusedxml==0.7.1
+deptry==0.21.1
+dice-ml==0.11
+dict-and-html==1.0.11
+diff-match-patch==20230430
+dj-database-url==2.3.0
+Django==4.2.13
+django-bootstrap-v5==1.0.11
+django-htmx==1.18.0
+django-import-export==4.0.3
+django-plotly-dash==2.3.1
+django-redis==5.4.0
+docopt==0.6.2
+dpd_components==0.1.0
+et-xmlfile==1.1.0
+exceptiongroup==1.2.1
+executing==2.0.1
+fastdtw==0.3.4
+fastjsonschema==2.20.0
+Flask==3.0.3
+flatbuffers==1.12
+fonttools==4.51.0
+fqdn==1.5.1
+gast==0.4.0
+google-auth==2.32.0
+google-auth-oauthlib==0.4.6
+google-pasta==0.2.0
+greenlet==3.0.3
+grpcio==1.65.1
+h11==0.14.0
+h5py==3.11.0
+html-and-py==1.0.14
+httpcore==1.0.5
+httpx==0.27.0
+hyperlink==21.0.0
+idna==3.7
+imbalanced-learn==0.12.3
+incremental==22.10.0
+ipykernel==6.29.5
+ipython==8.12.3
+ipywidgets==8.1.3
+isoduration==20.11.0
+itsdangerous==2.2.0
+jedi==0.19.1
+Jinja2==3.1.4
+joblib==1.4.2
+json5==0.9.25
+jsonpointer==3.0.0
+jsonschema==4.22.0
+jsonschema-specifications==2023.12.1
+jupyter==1.0.0
+jupyter-console==6.6.3
+jupyter-events==0.10.0
+jupyter-lsp==2.2.5
+jupyter_client==8.6.2
+jupyter_core==5.7.2
+jupyter_server==2.14.2
+jupyter_server_terminals==0.5.3
+jupyterlab==4.2.4
+jupyterlab_pygments==0.3.0
+jupyterlab_server==2.27.3
+jupyterlab_widgets==3.0.11
+keract==4.5.1
+keras==2.9.0
+Keras-Preprocessing==1.1.2
+kiwisolver==1.4.5
+libclang==18.1.1
+llvmlite==0.43.0
+Mako==1.3.5
+mamba==0.11.3
+Markdown==3.6
+MarkupSafe==2.1.5
+matplotlib==3.9.0
+matplotlib-inline==0.1.7
+mistune==3.0.2
+ml-dtypes==0.4.0
+mlxtend==0.23.1
+msgpack==1.0.8
+nbclient==0.10.0
+nbconvert==7.16.4
+nbeats-keras==1.8.0
+nbformat==5.10.4
+nest-asyncio==1.6.0
+ngrok==1.4.0
+notebook==7.2.1
+notebook_shim==0.2.4
+npx==0.1.6
+numba==0.60.0
+numpy==1.23.5
+nvidia-cublas-cu11==11.11.3.6
+oauthlib==3.2.2
+openpyxl==3.1.2
+opt-einsum==3.3.0
+optuna==2.10.1
+overrides==7.7.0
+packaging==24.2
+pandas==1.5.3
+pandocfilters==1.5.1
+parso==0.8.4
+patsy==0.5.6
+pbr==6.0.0
+pexpect==4.9.0
+pickleshare==0.7.5
+pillow==10.3.0
+pipdeptree==2.24.0
+pipreqs==0.5.0
+platformdirs==4.2.2
+plotly==5.22.0
+prettytable==3.10.2
+prometheus_client==0.20.0
+prompt_toolkit==3.0.47
+protobuf==3.19.6
+psutil==6.0.0
+ptyprocess==0.7.0
+pure-eval==0.2.2
+pyasn1==0.6.0
+pyasn1_modules==0.4.0
+pycparser==2.22
+Pygments==2.18.0
+pyOpenSSL==24.1.0
+pyparsing==3.1.2
+pyperclip==1.9.0
+python-dateutil==2.9.0.post0
+python-dotenv==1.0.1
+python-json-logger==2.0.7
+pytz==2024.1
+PyWavelets==1.6.0
+PyYAML==6.0.1
+pyzmq==26.0.3
+qtconsole==5.5.2
+QtPy==2.4.1
+raiutils==0.4.2
+redis==5.0.6
+referencing==0.35.1
+requests==2.32.3
+requests-oauthlib==2.0.0
+requirements-parser==0.11.0
+rfc3339-validator==0.1.4
+rfc3986-validator==0.1.1
+rpds-py==0.18.1
+rsa==4.9
+scikit-base==0.8.2
+scikit-learn==1.5.1
+scipy==1.13.0
+seaborn==0.13.2
+Send2Trash==1.8.3
+service-identity==24.1.0
+six==1.16.0
+sktime==0.31.0
+sniffio==1.3.1
+soupsieve==2.5
+SQLAlchemy==2.0.31
+sqlparse==0.5.0
+stack-data==0.6.3
+statsmodels==0.14.2
+stevedore==5.2.0
+stumpy==1.13.0
+tablib==3.5.0
+tenacity==8.3.0
+tensorboard==2.9.1
+tensorboard-data-server==0.6.1
+tensorboard-plugin-wit==1.8.1
+tensorflow==2.9.1
+tensorflow-estimator==2.9.0
+tensorflow-io-gcs-filesystem==0.37.1
+termcolor==2.4.0
+terminado==0.18.1
+tfts==0.0.5
+threadpoolctl==3.5.0
+tinycss2==1.3.0
+tomli==2.0.1
+tornado==6.4.1
+tqdm==4.66.4
+traitlets==5.14.3
+Twisted==24.3.0
+txaio==23.1.1
+types-python-dateutil==2.9.0.20240316
+types-setuptools==75.6.0.20241126
+typing_extensions==4.11.0
+uri-template==1.3.0
+urllib3==2.2.1
+uWSGI==2.0.28
+wcwidth==0.2.13
+webcolors==24.8.0
+webencodings==0.5.1
+websocket-client==1.8.0
+Werkzeug==3.0.3
+whitenoise==6.8.2
+widgetsnbextension==4.0.11
+wildboar==1.2.0
+wrapt==1.16.0
+xgboost==2.0.3
+XlsxWriter==3.2.0
+yarg==0.1.9
+zope.interface==6.4.post2