@@ -481,7 +481,7 @@ def calibration_core(self, uncal_preds, cal_dict, cal_min, cal_max):
481481 if len (uncal_preds ) == 0 :
482482 return np .array (cal_preds )
483483 if self .pygam_calibration :
484- linear_model_left , spline_model , linear_model_right = uncal_preds
484+ linear_model_left , spline_model , linear_model_right = cal_dict
485485 y_pred_spline = spline_model .predict (uncal_preds )
486486 y_pred_left = linear_model_left .predict (uncal_preds )
487487 y_pred_right = linear_model_right .predict (uncal_preds )
@@ -493,17 +493,15 @@ def calibration_core(self, uncal_preds, cal_dict, cal_min, cal_max):
493493 ) # Ensure this is a 1D array for proper indexing
494494
495495 # Create a prediction array initialized with spline predictions
496- y_pred = np .copy (y_pred_spline )
496+ cal_preds = np .copy (y_pred_spline )
497497
498498 # Replace predictions outside the range with the linear model predictions
499- y_pred [~ within_range & (uncal_preds .ravel () < cal_min )] = y_pred_left [
499+ cal_preds [~ within_range & (uncal_preds .ravel () < cal_min )] = y_pred_left [
500500 ~ within_range & (uncal_preds .ravel () < cal_min )
501501 ]
502- y_pred [~ within_range & (uncal_preds .ravel () > cal_max )] = y_pred_right [
502+ cal_preds [~ within_range & (uncal_preds .ravel () > cal_max )] = y_pred_right [
503503 ~ within_range & (uncal_preds .ravel () > cal_max )
504504 ]
505-
506- cal_preds = cal_dict .predict (uncal_preds )
507505 else :
508506 for uncal_pred in uncal_preds :
509507 try :
0 commit comments