diff --git a/himalaya/kernel_ridge/_kernelizer.py b/himalaya/kernel_ridge/_kernelizer.py index 9ed75f2..31bf08d 100644 --- a/himalaya/kernel_ridge/_kernelizer.py +++ b/himalaya/kernel_ridge/_kernelizer.py @@ -245,6 +245,11 @@ class ColumnKernelizer(ColumnTransformer): If True, computations will be performed on CPU, ignoring the current backend. If False, use the current backend. + force_int_remainder_cols : bool, default=True + Force the columns of the last entry of transformers_, which corresponds + to the “remainder” transformer, to always be stored as indices (int) + rather than column names (str). + Attributes ---------- transformers_ : list @@ -308,7 +313,8 @@ class ColumnKernelizer(ColumnTransformer): kernelizer = False def __init__(self, transformers, remainder='drop', n_jobs=None, - transformer_weights=None, verbose=False, force_cpu=False): + transformer_weights=None, verbose=False, force_cpu=False, + force_int_remainder_cols=True): self.transformers = transformers self.remainder = remainder self.sparse_threshold = 0 @@ -316,6 +322,7 @@ def __init__(self, transformers, remainder='drop', n_jobs=None, self.transformer_weights = transformer_weights self.verbose = verbose self.force_cpu = force_cpu + self.force_int_remainder_cols = force_int_remainder_cols def _iter(self, fitted=False, *args, **kwargs): """ diff --git a/himalaya/kernel_ridge/_random_search.py b/himalaya/kernel_ridge/_random_search.py index 6e75a8e..908ff9c 100644 --- a/himalaya/kernel_ridge/_random_search.py +++ b/himalaya/kernel_ridge/_random_search.py @@ -195,7 +195,7 @@ def solve_multiple_kernel_ridge_random_search( warnings.warn("Skip fit because HIMALAYA_SKIP_FIT=True.") # skip the loop by emptying the gammas candidates gammas = gammas[:0] - # fill with fake weights, to avoid gettings only zeros. + # fill with fake weights, to avoid getting only zeros. refit_weights += (backend.arange(n_targets)[None] + 1) / n_targets ###########################################################################