Avatto>>DATA SCIENTIST>>SHORT QUESTIONS>>Data Scientist Tricky Interview Questions
Any value which is more than upper cap and less than the lower cap will fall under the definition of an outlier
from sklearn import linear_model import numpy as np
xl = [3,4,5,6,7]
x = np.asarray(xl).reshape(-1, 1)
y = [15,22,25,33,40]
lm = linear_model.LinearRegression()
lm.fit(x, y)
print(lm.intercept_)
print(lm.coef_[0])


Description