File [.../site-packages/pomegranate/distributions/lognormal.py:174, in LogNormal.summarize(self, X, sample_weight)
172 if self.frozen is True:
173 return
--> 174 X = _cast_as_tensor(X, dtype=self.means.dtype)
175 super().summarize(X.log(), sample_weight=sample_weight)
AttributeError: 'NoneType' object has no attribute 'dtype'
I would cut a PR for this, but I'm not actually sure what the most Pythonic resolution for this kind of inheritance issue is.
A basic workaround is invoking summarize on the distribution manually:
Bug Description LogNormal.summarize() throws a NoneType exception.
This is because Normal() correctly calls _distribution.Distribution.summarize() via super() before any processing with X:
LogNormal() attempts to access self.means before super().summarize() is called.
To Reproduce
produces:
I would cut a PR for this, but I'm not actually sure what the most Pythonic resolution for this kind of inheritance issue is.
A basic workaround is invoking summarize on the distribution manually:
Edit: a better workaround: