Last answered:

04 Mar 2022

Posted on:

02 Mar 2022

0

Resolved: adj_R^2 returns an Nd array of 2 columns

Hi,
when i run this code for calculating the adjusted R2 'r_adj=1-(1-r2)*(n-1/n-p-1)' I get an nd array of 1x2. kindly explain this to me. i thought I was suppose to get a single value like the r^2

1 answers ( 1 marked as helpful)
Instructor
Posted on:

04 Mar 2022

0

Hey,

Thank you for your question!

Make sure that r2, n and p are defined appropriately, namely:

r2 = reg.score(x, y)
n = x.shape[0]
p = x.shape[1]

Kind regards,
365 Hristina

Submit an answer