You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My hunch is that this a result of not having any positive examples in my training set (will confirm), but this should have a more helpful error message:
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-49-9a80de5295c7> in <module>()
----> 1 deduper.train()
/Users/robertvoyer/anaconda3/envs/entity-search/lib/python3.6/site-packages/dedupe/api.py in train(self, recall, index_predicates)
669 self.classifier.fit(self.data_model.distances(examples), y)
670
--> 671 self._trainBlocker(recall, index_predicates)
672
673 def _trainBlocker(self, recall, index_predicates): # pragma: no cover
/Users/robertvoyer/anaconda3/envs/entity-search/lib/python3.6/site-packages/dedupe/api.py in _trainBlocker(self, recall, index_predicates)
680
681 self.predicates = block_learner.learn(matches,
--> 682 recall)
683
684 self.blocker = blocking.Blocker(self.predicates)
/Users/robertvoyer/anaconda3/envs/entity-search/lib/python3.6/site-packages/dedupe/training.py in learn(self, matches, recall)
31 comparison_count = self.comparisons(self.total_cover, compound_length)
32
---> 33 coverable_dupes = set.union(*viewvalues(dupe_cover))
34 uncoverable_dupes = [pair for i, pair in enumerate(matches)
35 if i not in coverable_dupes]
TypeError: descriptor 'union' of 'set' object needs an argument
The text was updated successfully, but these errors were encountered:
you can fix it by making a change like this
if len(viewvalues(dupe_cover)) != 0:
coverable_dupes = set.union(*viewvalues(dupe_cover))
else:
coverable_dupes = set()
My hunch is that this a result of not having any positive examples in my training set (will confirm), but this should have a more helpful error message:
The text was updated successfully, but these errors were encountered: