Skip to content

Commit

Permalink
Merge 1212a7b into c595052
Browse files Browse the repository at this point in the history
  • Loading branch information
NickCrews committed Sep 1, 2022
2 parents c595052 + 1212a7b commit 3fc0d3e
Show file tree
Hide file tree
Showing 9 changed files with 183 additions and 245 deletions.
3 changes: 0 additions & 3 deletions .coveragerc

This file was deleted.

2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.env
.coverage*
htmlcov
cpredicates.c
*.code-workspace
libdistance-0.2.1
Expand Down Expand Up @@ -29,7 +30,6 @@ mysql.cnf
*.egg-info
ENV
dist
.coverage
src/*.c

!benchmarks/asv.conf.json
Expand Down
8 changes: 6 additions & 2 deletions dedupe/_typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,14 @@ class TrainingData(TypedDict):


class Classifier(Protocol):
def fit(self, X: object, y: object) -> None:
"""Takes an array of pairwise distances and computes the likelihood they are a pair."""

def fit(self, X: numpy.typing.NDArray[numpy.float_], y: LabelsLike) -> None:
...

def predict_proba(self, X: object) -> numpy.typing.NDArray[numpy.float_]:
def predict_proba(
self, X: numpy.typing.NDArray[numpy.float_]
) -> numpy.typing.NDArray[numpy.float_]:
...


Expand Down
8 changes: 2 additions & 6 deletions dedupe/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -1278,8 +1278,6 @@ class Dedupe(ActiveMatching, DedupeMatching):
entity.
"""

ActiveLearner = labeler.DedupeDisagreementLearner

def prepare_training(
self,
data: Data,
Expand Down Expand Up @@ -1321,7 +1319,7 @@ def prepare_training(
# existing training data, so add them to data dictionary
examples, y = flatten_training(self.training_pairs)

self.active_learner = self.ActiveLearner(
self.active_learner = labeler.DedupeDisagreementLearner(
self.data_model,
data,
index_include=examples,
Expand All @@ -1341,8 +1339,6 @@ class Link(ActiveMatching):
Mixin Class for Active Learning Record Linkage
"""

ActiveLearner = labeler.RecordLinkDisagreementLearner

def prepare_training(
self,
data_1: Data,
Expand Down Expand Up @@ -1390,7 +1386,7 @@ def prepare_training(
# existing training data, so add them to data dictionaries
examples, y = flatten_training(self.training_pairs)

self.active_learner = self.ActiveLearner(
self.active_learner = labeler.RecordLinkDisagreementLearner(
self.data_model,
data_1,
data_2,
Expand Down
Loading

0 comments on commit 3fc0d3e

Please sign in to comment.