Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion scikit_mol/applicability/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from sklearn.base import BaseEstimator, TransformerMixin
from sklearn.utils import check_array
from sklearn.utils._set_output import _SetOutputMixin, _wrap_method_output
from sklearn.utils.validation import check_is_fitted
from sklearn.utils.validation import check_is_fitted, validate_data


class _ADOutputMixin(_SetOutputMixin):
Expand Down Expand Up @@ -254,3 +254,10 @@ def get_feature_names_out(self, input_features=None) -> NDArray[np.str_]:
"""Get feature name for output column."""
# TODO: what is the mechanism around input_features?
return np.array([f"{self.feature_name}"])

def _validate_data(self, X: Any) -> np.ndarray:
"""
Replace deprecated BaseEstimator._validate_data.
Internally calls sklearn.utils.validation.validate_data(_estimator=self, X=X, y=None, reset=True).
"""
return validate_data(self, X=X)
Empty file.
2 changes: 1 addition & 1 deletion scikit_mol/safeinference.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def wrapper(obj, X, y=None, *args, **kwargs):
# TODO, how can we check y in the same way as the estimator?
y = check_array(
y,
force_all_finite=False, # accept_sparse="csr",
ensure_all_finite=False, # accept_sparse="csr",
ensure_2d=False,
dtype=None,
input_name="y",
Expand Down