Skip to content

Commit

Permalink
Pre-commit hooks (#732)
Browse files Browse the repository at this point in the history
  • Loading branch information
lbittarello committed Nov 13, 2023
1 parent a304d55 commit b14c524
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/glum/_solvers.py
Original file line number Diff line number Diff line change
Expand Up @@ -758,7 +758,7 @@ def line_search(state: IRLSState, data: IRLSData, d: np.ndarray):
"""
# line search parameters
(beta, sigma) = (0.5, 0.0001)
eps = 16 * np.finfo(state.obj_val.dtype).eps
eps = 16 * np.finfo(state.obj_val.dtype).eps # type: ignore

# line search by sequence beta^k, k=0, 1, ..
# F(w + lambda d) - F(w) <= lambda * bound
Expand Down
3 changes: 1 addition & 2 deletions src/glum_benchmarks/data/create_insurance.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import pandas as pd
import sklearn.compose
from git_root import git_root
from pandas.api.types import is_categorical_dtype
from sklearn.base import BaseEstimator, TransformerMixin
from sklearn.compose._column_transformer import _get_transformer_list
from sklearn.pipeline import Pipeline
Expand Down Expand Up @@ -109,7 +108,7 @@ def fit(
categories = {}
for name in columns:
col = X[name]
if not is_categorical_dtype(col):
if str(col.dtype) != "category": # type: ignore
col = pd.Series(col, index=X.index).astype("category")
categories[name] = col.dtype

Expand Down

0 comments on commit b14c524

Please sign in to comment.