From 7b713bd227e3ee8c3269ca9f5d25b11334cb2d92 Mon Sep 17 00:00:00 2001 From: cactuskid Date: Fri, 30 Aug 2024 15:21:08 +0200 Subject: [PATCH] weighted hash err --- src/HogProf/lshbuilder.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/HogProf/lshbuilder.py b/src/HogProf/lshbuilder.py index 5cdb5e2..7fd7c5a 100755 --- a/src/HogProf/lshbuilder.py +++ b/src/HogProf/lshbuilder.py @@ -147,7 +147,8 @@ def __init__(self,h5_oma=None,fileglob = None, taxa=None,masterTree=None, saving else: #load machine learning weights self.treeweights = treeweights - wmg = WeightedMinHashGenerator(3*len(self.taxaIndex), sample_size = numperm , seed=1) + tax_max = max(self.taxaIndex.values())+1 + wmg = WeightedMinHashGenerator(3*tax_max, sample_size = numperm , seed=1) with open( self.saving_path + 'wmg.pkl', 'wb') as wmgout: wmgout.write( pickle.dumps(wmg)) self.wmg = wmg