Skip to content

Commit

Permalink
REF update pairwise_set to follow the remaining code style
Browse files Browse the repository at this point in the history
  • Loading branch information
joaopfonseca committed Nov 12, 2024
1 parent 46a660d commit d44836b
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions sharp/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,23 +259,16 @@ def pairwise(self, sample1, sample2, **kwargs):
**kwargs
)

def pairwise_all(self, pairs, **kwargs):
def pairwise_set(self, samples1, samples2, **kwargs):
"""
set_cols_idx should be passed in kwargs if measure is marginal
pairs is a list of tuples of indexes
"""
# X_ref = self._X if self._X is not None else check_inputs(X)[0]

if "sample_size" in kwargs.keys():
sample_size = 1

influences = parallel_loop(
lambda idx: self.individual(
pairs[idx][0].reshape(1, -1), X=pairs[idx][1].reshape(1, -1), verbose=False, **kwargs
),
range(len(pairs)),
contributions = parallel_loop(
lambda samples: self.pairwise(*samples, verbose=False, **kwargs),
range(zip(samples1, samples2)),
n_jobs=self.n_jobs,
progress_bar=self.verbose,
)

return np.array(influences)
return np.array(contributions)

0 comments on commit d44836b

Please sign in to comment.