Skip to content

Commit

Permalink
ninth commit
Browse files Browse the repository at this point in the history
  • Loading branch information
deadsoul44 committed Jun 7, 2024
1 parent d0ef036 commit 97cda78
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
macos-build-test:
strategy:
matrix:
pyversion: ["3.8", "3.9", "3.10", "3.11", "3.12"]
pyversion: ["3.11", "3.12"]
runs-on: "macos-latest"
steps:
- uses: actions/checkout@v4
Expand Down
4 changes: 2 additions & 2 deletions python-package/python/perpetual/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ def convert_input_frame(X: FrameLike, categorical_features) -> tuple[list[str],
def f(x):
try:
return np.nan if str(x[feature_index]) == "nan" else float(categories.index(str(x[feature_index])))
except:
except (ValueError, IndexError):
return np.nan
X_[:, feature_index] = np.apply_along_axis(f, 1, X_)

Expand Down Expand Up @@ -215,7 +215,7 @@ def transform_input_frame(X: FrameLike, cat_mapping) -> tuple[list[str], np.ndar
def f(x):
try:
return np.nan if str(x[feature_index]) == "nan" else float(categories.index(str(x[feature_index])))
except:
except (ValueError, IndexError):
return np.nan
X_[:, feature_index] = np.apply_along_axis(f, 1, X_)

Expand Down
1 change: 0 additions & 1 deletion python-package/tests/test_booster.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ def test_booster_no_variance(X_y):

model = PerpetualBooster(objective="LogLoss")
model.fit(X, y)
preds = model.predict(X)
assert model.feature_importances_[1] == 0.0
assert model.feature_importances_[3] == 0.0

Expand Down

0 comments on commit 97cda78

Please sign in to comment.