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
|
47 Discussions
|
Please Login in order to post a comment
Interesting problem! It's a great way to practice applying regression analysis with real data. Calculating the slope by hand gives good insight into how relationships between variables are analyzed. Thanks for sharing this! Cricbet99
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