You are viewing a single comment's thread. Return to all comments →
Help !!
new to hackerRank , how to debug here ?? what's the expected input and output format ? This code runs perfect locally....
import numpy as np from sklearn.linear_model import LinearRegression
def return_cof(x,Y): x=np.array(x).reshape(-1, 1) y = np.array(Y).reshape(-1, 1) reg=LinearRegression().fit(x,Y) ans=reg.coef_ return round(ans[0],3)
a=[15,12,8,8,7,7,7,6,5,3] b=[10,25,17,11,13,17,20,13,9,15] ans=return_cof(a,b) print(ans)
Seems like cookies are disabled on this browser, please enable them to open this website
Correlation and Regression Lines - A Quick Recap #2
You are viewing a single comment's thread. Return to all comments →
Help !!
new to hackerRank , how to debug here ?? what's the expected input and output format ? This code runs perfect locally....
import numpy as np from sklearn.linear_model import LinearRegression
def return_cof(x,Y): x=np.array(x).reshape(-1, 1) y = np.array(Y).reshape(-1, 1) reg=LinearRegression().fit(x,Y) ans=reg.coef_ return round(ans[0],3)
a=[15,12,8,8,7,7,7,6,5,3] b=[10,25,17,11,13,17,20,13,9,15] ans=return_cof(a,b) print(ans)