Skip to content

Commit

Permalink
Fix issue with the _shapley_neighbor function referring to the wrong …
Browse files Browse the repository at this point in the history
…LabelEncoder instance and remove the class-level LabelEncoder as we need it only in the KNN Shapley case.
  • Loading branch information
bojan-karlas committed Jul 5, 2024
1 parent b8e328c commit a1b86d6
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions datascope/importance/shapley.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,6 @@ def __init__(
self.metadata_train: Optional[Union[NDArray, DataFrame]] = None
self.provenance: Optional[Provenance] = None
self.randomstate = np.random.RandomState(seed)
self.label_encoder = LabelEncoder()
self.logger = logger if logger is not None else getLogger(__name__)

def _fit(
Expand Down Expand Up @@ -759,7 +758,7 @@ def _shapley_neighbor(
units,
world,
num_neighbors=k,
num_classes=len(self.label_encoder.classes_),
num_classes=len(label_encoder.classes_),
null_scores=null_scores,
)

Expand Down

0 comments on commit a1b86d6

Please sign in to comment.