Skip to content

Commit aaaca8f

Browse files
committed
removes override calls
1 parent ed5ca60 commit aaaca8f

File tree

2 files changed

+35
-11
lines changed

2 files changed

+35
-11
lines changed

src/shapiq/imputer/gaussian_copula_imputer.py

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
from __future__ import annotations
44

55
from typing import TYPE_CHECKING, cast
6-
from typing_extensions import override
76

87
import numpy as np
98
from scipy.stats import norm, rankdata
@@ -35,7 +34,6 @@ class GaussianCopulaImputer(GaussianImputer):
3534
3635
More specifically, values will be clipped to the range ``[epsilon, 1 - epsilon]``."""
3736

38-
@override
3937
def __init__(
4038
self,
4139
model: (object | Game | Callable[[npt.NDArray[np.floating]], npt.NDArray[np.floating]]),
@@ -46,6 +44,26 @@ def __init__(
4644
random_state: int | None = None,
4745
verbose: bool = False,
4846
) -> None:
47+
"""Initializes the GaussianCopulaImputer.
48+
49+
Args:
50+
model: The model to explain as a callable function expecting a data points as input and
51+
returning the model's predictions.
52+
53+
data: The background data to use for the explainer as a two-dimensional array with shape
54+
``(n_samples, n_features)``.
55+
56+
x: The explanation point as a ``np.ndarray`` of shape ``(1, n_features)`` or
57+
``(n_features,)``.
58+
59+
sample_size: The number of Monte Carlo samples to draw from the conditional background
60+
data for imputation.
61+
62+
random_state: An optional random seed for reproducibility.
63+
64+
verbose: A flag to enable verbose imputation, which will print a progress bar for model
65+
evaluation. Note that this can slow down the imputation process.
66+
"""
4967
super().__init__(
5068
model=model,
5169
data=data,

src/shapiq/imputer/gaussian_imputer.py

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
from __future__ import annotations
44

55
from typing import TYPE_CHECKING, cast
6-
from typing_extensions import override
76

87
import numpy as np
98
from numpy.random import default_rng
@@ -47,14 +46,22 @@ def __init__(
4746
"""Initializes the class.
4847
4948
Args:
50-
model: The model to explain as a callable function expecting data points as input and
49+
model: The model to explain as a callable function expecting a data points as input and
5150
returning the model's predictions.
52-
data: The background data to use for the explainer as a ``np.ndarray`` of shape ``(n_samples, n_features)``.
53-
x: The explanation point as a ``np.ndarray`` of shape ``(1, n_features)`` or ``(n_features,)``. Defaults to ``None``.
54-
sample_size: Number of Monte Carlo samples for imputation. Defaults to ``100``.
55-
random_state: The random state to use for sampling. Defaults to ``None``.
56-
verbose: A flag to enable verbose imputation, which will print a progress bar for model evaluation.
57-
Note that this can slow down the imputation process. Defaults to ``False``.
51+
52+
data: The background data to use for the explainer as a two-dimensional array with shape
53+
``(n_samples, n_features)``.
54+
55+
x: The explanation point as a ``np.ndarray`` of shape ``(1, n_features)`` or
56+
``(n_features,)``.
57+
58+
sample_size: The number of Monte Carlo samples to draw from the conditional background
59+
data for imputation.
60+
61+
random_state: An optional random seed for reproducibility.
62+
63+
verbose: A flag to enable verbose imputation, which will print a progress bar for model
64+
evaluation. Note that this can slow down the imputation process.
5865
5966
Raises:
6067
CategoricalFeatureError: If the background data contains any categorical features.
@@ -207,7 +214,6 @@ def _sample_monte_carlo(
207214

208215
return samples_all_coalitions
209216

210-
@override
211217
def value_function(self, coalitions: npt.NDArray[np.bool]) -> npt.NDArray[np.floating]:
212218
"""Imputes the missing values of a data point and gets predictions for all coalitions.
213219

0 commit comments

Comments
 (0)