Skip to content

Commit

Permalink
Privatize DisagreementLearner.learners
Browse files Browse the repository at this point in the history
  • Loading branch information
NickCrews committed Jun 18, 2022
1 parent 1b230ac commit 2605b29
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions dedupe/labeler.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ def pop(self) -> TrainingExample:
if not len(self.candidates):
raise IndexError("No more unlabeled examples to label")

prob_l = [learner.candidate_scores() for learner in self.learners]
prob_l = [learner.candidate_scores() for learner in self._learners]
probs = numpy.concatenate(prob_l, axis=1)

# where do the classifers disagree?
Expand All @@ -321,18 +321,18 @@ def pop(self) -> TrainingExample:
return uncertain_pair

@property
def learners(self) -> tuple[Learner, ...]:
def _learners(self) -> tuple[Learner, ...]:
return (self.matcher, self.blocker)

def _remove(self, index: int) -> None:
self._candidates.pop(index)
for learner in self.learners:
for learner in self._learners:
learner.remove(index)

def mark(self, pairs: TrainingExamples, y: LabelsLike) -> None:
self.y = numpy.concatenate([self.y, y]) # type: ignore[arg-type]
self.pairs.extend(pairs)
for learner in self.learners:
for learner in self._learners:
learner.fit(self.pairs, self.y)

def learn_predicates(
Expand Down

0 comments on commit 2605b29

Please sign in to comment.