From a8065df788058a907bc8f34a604cae06abb11c90 Mon Sep 17 00:00:00 2001 From: Sunyanan Choochotkaew Date: Thu, 9 Nov 2023 10:53:14 +0900 Subject: [PATCH 1/3] update weight format Signed-off-by: Sunyanan Choochotkaew --- src/train/trainer/scikit.py | 2 -- src/train/trainer/xgboost_interface.py | 9 ++------- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/src/train/trainer/scikit.py b/src/train/trainer/scikit.py index d38b1ecd..6b4a08d9 100644 --- a/src/train/trainer/scikit.py +++ b/src/train/trainer/scikit.py @@ -86,8 +86,6 @@ def get_weight_dict(self, node_type): "Categorical_Variables": dict(), "Numerical_Variables": {self.features[i]: {"scale": scaler.scale_[i], - "mean": 0, - "variance": 0, "weight": model.coef_[i], } for i in range(len(self.features))}, diff --git a/src/train/trainer/xgboost_interface.py b/src/train/trainer/xgboost_interface.py index 62e161a7..d2ec3d27 100644 --- a/src/train/trainer/xgboost_interface.py +++ b/src/train/trainer/xgboost_interface.py @@ -93,15 +93,10 @@ def get_weight_dict(self, node_type): return weight_dict[component] = { "All_Weights": { - "Bias_Weight": 0, "Categorical_Variables": dict(), "Numerical_Variables": {self.features[i]: - {"scale": scaler.scale_[i], - "mean": 0, - "variance": 0, - "weight": model_in_json - } - for i in range(len(self.features))}, + {"scale": scaler.scale_[i]} for i in range(len(self.features))}, + "XGboost_Weights": model_in_json } } return weight_dict \ No newline at end of file From f689449614df9ab3d513fdbbdc26663e56817866 Mon Sep 17 00:00:00 2001 From: Sunyanan Choochotkaew Date: Thu, 9 Nov 2023 10:56:42 +0900 Subject: [PATCH 2/3] remove Werkzeug after rebase Signed-off-by: Sunyanan Choochotkaew --- dockerfiles/Dockerfile | 3 --- dockerfiles/Dockerfile.test | 2 -- 2 files changed, 5 deletions(-) diff --git a/dockerfiles/Dockerfile b/dockerfiles/Dockerfile index ed6a4b64..290841bf 100644 --- a/dockerfiles/Dockerfile +++ b/dockerfiles/Dockerfile @@ -18,7 +18,4 @@ EXPOSE 8101 # port for Offline Trainer EXPOSE 8102 -# TODO: remove after kepler_model_server_base:v0.7 built -RUN pip install Werkzeug==2.2.2 - ENTRYPOINT ["python3.8", "cmd/main.py"] \ No newline at end of file diff --git a/dockerfiles/Dockerfile.test b/dockerfiles/Dockerfile.test index 4cb96422..93791930 100644 --- a/dockerfiles/Dockerfile.test +++ b/dockerfiles/Dockerfile.test @@ -21,7 +21,5 @@ EXPOSE 8100 EXPOSE 8101 # port for Offline Trainer EXPOSE 8102 -# TODO: remove after kepler_model_server_base:v0.7 built -RUN pip install Werkzeug==2.2.2 CMD [ "python3.8", "-u", "src/server/model_server.py" ] \ No newline at end of file From 3523a0e4791bf6d39292fcf8c1cf900662f46630 Mon Sep 17 00:00:00 2001 From: Sunyanan Choochotkaew Date: Fri, 10 Nov 2023 16:51:19 +0900 Subject: [PATCH 3/3] update kind version and remove export filter Signed-off-by: Sunyanan Choochotkaew --- cmd/main.py | 2 +- model_training/custom-cluster/kind/kind.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/main.py b/cmd/main.py index d70ca2e8..ed85be04 100644 --- a/cmd/main.py +++ b/cmd/main.py @@ -677,7 +677,7 @@ def plot(args): feature_cols = FeatureGroups[fg] power_cols = [col for col in data.columns if "power" in col] feature_data = data.groupby([TIMESTAMP_COL]).sum() - _ts_plot(feature_data[feature_data[feature_cols]>0], feature_cols, "Feature group: {}".format(fg.name), output_folder, data_filename) + _ts_plot(feature_data, feature_cols, "Feature group: {}".format(fg.name), output_folder, data_filename) if not energy_plot: power_data = data.groupby([TIMESTAMP_COL]).max() data_filename = get_general_filename(args.target_data, energy_source, None, ot, args.extractor, args.isolator) diff --git a/model_training/custom-cluster/kind/kind.sh b/model_training/custom-cluster/kind/kind.sh index 1bc0b69c..df0da88a 100755 --- a/model_training/custom-cluster/kind/kind.sh +++ b/model_training/custom-cluster/kind/kind.sh @@ -24,7 +24,7 @@ kind_registry_name="kind-registry" KIND_DEFAULT_NETWORK="kind" KIND_REGISTRY_NAME=${KIND_REGISTRY_NAME:-kind-registry} CONFIG_PATH="kind" -KIND_VERSION=${KIND_VERSION:-0.17.0} +KIND_VERSION=${KIND_VERSION:-0.20.0} KIND_MANIFESTS_DIR="$CONFIG_PATH/manifests" CLUSTER_NAME=${KIND_CLUSTER_NAME:-kind}