diff --git a/encexp/__init__.py b/encexp/__init__.py index 846a24a..3f3f4b6 100644 --- a/encexp/__init__.py +++ b/encexp/__init__.py @@ -17,4 +17,4 @@ if not '-m' in sys.argv: from encexp.text_repr import EncExpT, SeqTM, TextModel -__version__ = "0.1.3" +__version__ = "0.1.4" diff --git a/encexp/build_encexp.py b/encexp/build_encexp.py index dc46ece..4342ff2 100644 --- a/encexp/build_encexp.py +++ b/encexp/build_encexp.py @@ -252,7 +252,7 @@ def parameters(self, label): if self.with_intercept: output['intercept'] = m.intercept_.astype(np.float16).tobytes().hex() return output - + def create_model(self): """Create model""" def inner(fname, label, add_label=None): @@ -263,14 +263,14 @@ def inner(fname, label, add_label=None): return None with open(fname, 'w', encoding='utf-8') as fpt: if add_label is not None: - coef['label'] = [coef['label'], add_label] + coef['label'] = [add_label, coef['label']] print(json.dumps(coef), file=fpt) return (fname, label) if not isdir(self.identifier): os.mkdir(self.identifier) if len(self.labels) == 2: - args = [join(self.identifier, '0.json'), self.labels[0]] - output = inner(*args, add_label=self.labels[1]) + args = [join(self.identifier, '0.json'), self.labels[1]] + output = inner(*args, add_label=self.labels[0]) if output is not None: return [output] return [] diff --git a/encexp/text_repr.py b/encexp/text_repr.py index 0484380..3873ad6 100644 --- a/encexp/text_repr.py +++ b/encexp/text_repr.py @@ -649,7 +649,7 @@ def set_weights(data): if tsv_filename is None or not isfile(tsv_filename): ds.process(D) if train is None: - train = Train(text_model=self.seqTM, + train = Train(text_model=clone(self.seqTM), filename=ds.output_filename, use_tqdm=self.use_tqdm, min_pos=min_pos,