is there an R**2 values for finding in the linear regression analysis?

Viewed 17

I'm trying to code a for linear regression analysis that prints TypeError: can't multiply sequence by non-int of type 'list',.

I tried to learn linear regression coefficient analysis

def corr_coef(x,y):
   N = len(x)
   num = (N * (x * y).sum()) - (x.sum() * y.sum())
   den = np.sqrt((N * (x**2).sum() - x.sum()**2) * (N * (y**2).sum() - y.sum()**2))
   R = num / den 
   return R

num = (N * (x * y).sum()) - (x.sum() * y.sum())

TypeError: can't multiply sequence by non-int of type 'list'

0 Answers
Related