Skip to content

Commit

Permalink
Merge pull request #190 from sunya-ch/xgboost
Browse files Browse the repository at this point in the history
update weight format
  • Loading branch information
rootfs authored Nov 10, 2023
2 parents 4724605 + 3523a0e commit c02be1c
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 16 deletions.
2 changes: 1 addition & 1 deletion cmd/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 0 additions & 3 deletions dockerfiles/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
2 changes: 0 additions & 2 deletions dockerfiles/Dockerfile.test
Original file line number Diff line number Diff line change
Expand Up @@ -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" ]
2 changes: 1 addition & 1 deletion model_training/custom-cluster/kind/kind.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}

Expand Down
2 changes: 0 additions & 2 deletions src/train/trainer/scikit.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,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))},
Expand Down
9 changes: 2 additions & 7 deletions src/train/trainer/xgboost_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,15 +100,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

0 comments on commit c02be1c

Please sign in to comment.