Skip to content

Commit

Permalink
add log
Browse files Browse the repository at this point in the history
  • Loading branch information
basaks committed Jul 9, 2024
1 parent a0a551a commit a4c708b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion configs/ref_quantile_lgbm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ learning:

prediction:
prediction_template: configs/data/sirsam/dem_foc2.tif
quantiles: 0.90
quantiles: 0.9
outbands: 4


Expand Down
6 changes: 5 additions & 1 deletion uncoverml/predict.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -36,6 +36,10 @@ 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
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]))
Expand Down

0 comments on commit a4c708b

Please sign in to comment.