Hi,
I just found there might be a error in the provided regression score function.
It seems you don’t use the new area in the score calculation?
Best regards,
Qin
Extract the scipy model
model = model_PDFs[pdf_type]
The following block of code generates the full PDF for potential normalization
Generate x values for plotting and integration
n_points = 100000
x = np.linspace(-100, 100, n_points)
y = model.pdf(x, **pdf_args)
Verify the area under the curve using numerical integration
area = simps(y, x)
Normalize the PDF if the area is not 1
if area != 1:
y /= area
area = simps(y, x)
# Calculate the score with corrected area
score = model.pdf(true_target, **pdf_args)
Normalize score if the the PDF max is greater than 1
y_max = y.max()
if y_max > 1:
y = y/y_max
score = score/y_max