diff --git a/src/glum/_glm.py b/src/glum/_glm.py index 2ace19a8..0d962dd1 100644 --- a/src/glum/_glm.py +++ b/src/glum/_glm.py @@ -44,17 +44,6 @@ column_or_1d, ) -if hasattr(sklearn.utils.validation, "validate_data"): - validate_data = sklearn.utils.validation.validate_data -else: - validate_data = BaseEstimator._validate_data - -if hasattr(sklearn.utils.validation, "_check_n_features"): - _check_n_features = sklearn.utils.validation._check_n_features -else: - _check_n_features = BaseEstimator._check_n_features - - from ._distribution import ( BinomialDistribution, ExponentialDispersionModel, @@ -89,6 +78,16 @@ else: keyword_finiteness = "ensure_all_finite" +if hasattr(sklearn.utils.validation, "validate_data"): + validate_data = sklearn.utils.validation.validate_data +else: + validate_data = BaseEstimator._validate_data + +if hasattr(sklearn.utils.validation, "_check_n_features"): + _check_n_features = sklearn.utils.validation._check_n_features +else: + _check_n_features = BaseEstimator._check_n_features + _float_itemsize_to_dtype = {8: np.float64, 4: np.float32, 2: np.float16} VectorLike = Union[np.ndarray, pd.api.extensions.ExtensionArray, pd.Index, pd.Series]