@@ -836,7 +836,7 @@ def calibrate_preds_func_pygam(
836836 # Fit a SplineTransformer model
837837 spline = SplineTransformer (degree = 4 , n_knots = int (len (measured_tr ) / 100 ) + 5 )
838838 spline_model = make_pipeline (spline , LinearRegression ())
839- spline_model .fit (predicted_tr , measured_tr )
839+ spline_model .fit (predicted_tr . reshape ( - 1 , 1 ) , measured_tr )
840840
841841 # Determine the top 10% of data on either end
842842 n_top = int (len (predicted_tr ) * 0.1 )
@@ -845,13 +845,13 @@ def calibrate_preds_func_pygam(
845845 X_left = predicted_tr [:n_top ]
846846 y_left = measured_tr [:n_top ]
847847 linear_model_left = LinearRegression ()
848- linear_model_left .fit (X_left , y_left )
848+ linear_model_left .fit (X_left . reshape ( - 1 , 1 ) , y_left )
849849
850850 # Fit a linear model on the top 10% (right-side extrapolation)
851851 X_right = predicted_tr [- n_top :]
852852 y_right = measured_tr [- n_top :]
853853 linear_model_right = LinearRegression ()
854- linear_model_right .fit (X_right , y_right )
854+ linear_model_right .fit (X_right . reshape ( - 1 , 1 ) , y_right )
855855
856856 calibrate_min = min (predicted_tr )
857857 calibrate_max = max (predicted_tr )
0 commit comments