Skip to content

Commit 4480448

Browse files
author
Sunil Thaha
authored
Revert "fix(xgboost): Remove xgboost dependency to reduce image sizes"
1 parent 5c6b810 commit 4480448

File tree

5 files changed

+6
-13
lines changed

5 files changed

+6
-13
lines changed

.github/workflows/integration-test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ env:
3535

3636
jobs:
3737
run-integration:
38+
if: ${{ (inputs.base_change != 'true') || ( (inputs.base_change == 'true') && (inputs.docker_secret == 'true') ) }}
3839
runs-on: ubuntu-20.04
3940
steps:
4041
- name: use Kepler action to deploy cluster

.github/workflows/tekton-test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ env:
4242

4343
jobs:
4444
tekton-test:
45+
if: ${{ (inputs.base_change != 'true') || ( (inputs.base_change == 'true') && (inputs.docker_secret == 'true') ) }}
4546
runs-on: ubuntu-latest
4647
steps:
4748
- name: checkout

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ dependencies = [
4040
"scipy==1.14.1",
4141
"seaborn==0.13.2",
4242
"Werkzeug==3.0.4",
43+
"xgboost==2.1.1",
4344
"boto3==1.34.155",
4445
"pymarkdownlnt==0.9.22",
4546
"yamllint==1.35.1",

src/kepler_model/estimate/model/model.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
11
import json
22
import logging
3-
import importlib.util as import_util
43

54
import pandas as pd
65

76
from kepler_model.estimate.model.curvefit_model import CurveFitModelEstimator
87
from kepler_model.estimate.model.scikit_model import ScikitModelEstimator
9-
10-
if import_util.find_spec("xgboost"):
11-
from kepler_model.estimate.model.xgboost_model import XgboostModelEstimator
12-
8+
from kepler_model.estimate.model.xgboost_model import XgboostModelEstimator
139
from kepler_model.util.config import download_path
1410
from kepler_model.util.loader import get_download_output_path, load_metadata
1511
from kepler_model.util.prom_types import valid_container_query
@@ -21,13 +17,11 @@
2117
# model wrapper
2218
MODELCLASS = {
2319
"scikit": ScikitModelEstimator,
20+
"xgboost": XgboostModelEstimator,
2421
"curvefit": CurveFitModelEstimator,
2522
# 'keras': KerasModelEstimator,
2623
}
2724

28-
if import_util.find_spec("xgboost"):
29-
MODELCLASS["xgboost"] = XgboostModelEstimator
30-
3125

3226
def default_predicted_col_func(energy_component):
3327
return f"default_{energy_component}_power"

src/kepler_model/util/train_types.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
import enum
1212
import random
13-
import importlib.util as import_util
1413

1514
SYSTEM_FEATURES = ["node_info", "cpu_scaling_frequency_hertz"]
1615

@@ -46,11 +45,8 @@
4645
"KNeighborsRegressorTrainer",
4746
"LinearRegressionTrainer",
4847
"SVRRegressorTrainer",
48+
"XgboostFitTrainer",
4949
]
50-
51-
if import_util.find_spec("xgboost"):
52-
no_weight_trainers.append("XgboostFitTrainer")
53-
5450
weight_support_trainers = ["SGDRegressorTrainer", "LogarithmicRegressionTrainer", "LogisticRegressionTrainer", "ExponentialRegressionTrainer"]
5551
default_trainer_names = no_weight_trainers + weight_support_trainers
5652
default_trainers = ",".join(default_trainer_names)

0 commit comments

Comments
 (0)