diff --git a/configs/ref_quantile_lgbm.yaml b/configs/ref_quantile_lgbm.yaml index 7653c2df..59987d27 100644 --- a/configs/ref_quantile_lgbm.yaml +++ b/configs/ref_quantile_lgbm.yaml @@ -44,7 +44,7 @@ learning: prediction: prediction_template: configs/data/sirsam/dem_foc2.tif - quantiles: 0.90 + quantiles: 0.9 outbands: 4 diff --git a/uncoverml/predict.py b/uncoverml/predict.py index 640534bf..ca054a35 100644 --- a/uncoverml/predict.py +++ b/uncoverml/predict.py @@ -22,7 +22,7 @@ def predict(data, model, interval=0.9, **kwargs): - + log.debug(f"Supplied prediction quantiles {interval}") # Classification if hasattr(model, 'predict_proba'): def pred(X): @@ -36,6 +36,11 @@ def pred(X): if hasattr(model, 'predict_dist'): if hasattr(model, 'upper_alpha') and hasattr(model, 'lower_alpha'): interval = model.upper_alpha - model.lower_alpha + print("====in predict====", model.upper_alpha, model.lower_alpha, interval) + log.warn(f"As upper and lower alpha are both specified, " + f"we used interval = model.upper_alpha - model.lower_alpha." + f" We ignored prediction.quantiles and used {interval}") + Ey, Vy, ql, qu = model.predict_dist(X, interval, **kwargs) predres = np.hstack((Ey[:, np.newaxis], Vy[:, np.newaxis], ql[:, np.newaxis], qu[:, np.newaxis]))