Description
When BaseProbaRegressor.predict_proba falls back to constructing a Normal distribution using predict_var, a predicted variance of 0 leads to sigma = 0 in the Normal distribution.
This causes divide-by-zero warnings and NaN values when evaluating pdf or log_pdf.
Example flow:
pred_var = self.predict_var(X)
pred_std = np.sqrt(pred_var)
Normal(mu=pred_mean, sigma=pred_std)
If pred_var == 0, downstream probability evaluations become unstable.
To Reproduce
This can happen with deterministic regressors where _predict_var returns 0.
Example scenario:
class MockZeroVarRegressor(BaseProbaRegressor):
def _predict(self, X):
return np.zeros(len(X))
def _predict_var(self, X):
return np.zeros(len(X))
Calling:
model.predict_proba(X).pdf(0)
can produce warnings and NaN values.