We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- Artificial Intelligence
- Statistics and Machine Learning
- Correlation and Regression Lines - A Quick Recap #2
- Discussions
Correlation and Regression Lines - A Quick Recap #2
Correlation and Regression Lines - A Quick Recap #2
Sort by
recency
|
45 Discussions
|
Please Login in order to post a comment
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)
Does anyone know why I am getting this error? Thank you
import numpy as np ModuleNotFoundError: No module named 'numpy'
Common irritation here:
* no input is provided in this excercise, hardcode it if needed
* "(your answer) in the textbox" just print your answer to stdout
The following code must work but I think the env under the submit is faulty and doesn't let anything but simple print statements to run.
My Solution: