Skip to content

Commit da3e088

Browse files
committed
mean: Update unconditional_distfit.py to handle dict models with 'loc' key for mean calculation.
1 parent 1f3d9a5 commit da3e088

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

skpro/regression/unconditional_distfit.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,10 @@ def pdf(self, x):
114114
return self.distfit_obj.model.pdf(x)
115115

116116
def mean(self):
117-
return self.distfit_obj.model.mean()
117+
model = self.distfit_obj.model
118+
if isinstance(model, dict) and "loc" in model:
119+
return model["loc"]
120+
return model.mean()
118121

119122
def var(self):
120123
# For normal/laplace, variance is scale**2

0 commit comments

Comments
 (0)