Skip to content

Commit

Permalink
Revert "fix(xgboost): Remove xgboost dependency to reduce image sizes"
Browse files Browse the repository at this point in the history
  • Loading branch information
sthaha authored Sep 17, 2024
1 parent 5c6b810 commit 4480448
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 13 deletions.
1 change: 1 addition & 0 deletions .github/workflows/integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ env:

jobs:
run-integration:
if: ${{ (inputs.base_change != 'true') || ( (inputs.base_change == 'true') && (inputs.docker_secret == 'true') ) }}
runs-on: ubuntu-20.04
steps:
- name: use Kepler action to deploy cluster
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/tekton-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ env:

jobs:
tekton-test:
if: ${{ (inputs.base_change != 'true') || ( (inputs.base_change == 'true') && (inputs.docker_secret == 'true') ) }}
runs-on: ubuntu-latest
steps:
- name: checkout
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ dependencies = [
"scipy==1.14.1",
"seaborn==0.13.2",
"Werkzeug==3.0.4",
"xgboost==2.1.1",
"boto3==1.34.155",
"pymarkdownlnt==0.9.22",
"yamllint==1.35.1",
Expand Down
10 changes: 2 additions & 8 deletions src/kepler_model/estimate/model/model.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
import json
import logging
import importlib.util as import_util

import pandas as pd

from kepler_model.estimate.model.curvefit_model import CurveFitModelEstimator
from kepler_model.estimate.model.scikit_model import ScikitModelEstimator

if import_util.find_spec("xgboost"):
from kepler_model.estimate.model.xgboost_model import XgboostModelEstimator

from kepler_model.estimate.model.xgboost_model import XgboostModelEstimator
from kepler_model.util.config import download_path
from kepler_model.util.loader import get_download_output_path, load_metadata
from kepler_model.util.prom_types import valid_container_query
Expand All @@ -21,13 +17,11 @@
# model wrapper
MODELCLASS = {
"scikit": ScikitModelEstimator,
"xgboost": XgboostModelEstimator,
"curvefit": CurveFitModelEstimator,
# 'keras': KerasModelEstimator,
}

if import_util.find_spec("xgboost"):
MODELCLASS["xgboost"] = XgboostModelEstimator


def default_predicted_col_func(energy_component):
return f"default_{energy_component}_power"
Expand Down
6 changes: 1 addition & 5 deletions src/kepler_model/util/train_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

import enum
import random
import importlib.util as import_util

SYSTEM_FEATURES = ["node_info", "cpu_scaling_frequency_hertz"]

Expand Down Expand Up @@ -46,11 +45,8 @@
"KNeighborsRegressorTrainer",
"LinearRegressionTrainer",
"SVRRegressorTrainer",
"XgboostFitTrainer",
]

if import_util.find_spec("xgboost"):
no_weight_trainers.append("XgboostFitTrainer")

weight_support_trainers = ["SGDRegressorTrainer", "LogarithmicRegressionTrainer", "LogisticRegressionTrainer", "ExponentialRegressionTrainer"]
default_trainer_names = no_weight_trainers + weight_support_trainers
default_trainers = ",".join(default_trainer_names)
Expand Down

0 comments on commit 4480448

Please sign in to comment.