1. What will be output of this Python code: import numpy as np import matplotlib.pyplot as plt x = np.array([1, 2, 3, 4, 5]) y = np.array([4, 2, 1, 3, 7]) plt.scatter(x, y); 2. What will be output of this Python code for the same data as above, from sklearn.linear_model import LinearRegression X=x[:, np.newaxis] model LinearRegression().fit(x, y) = yfit = model.predict(X) plt.scatter(x, y) plt.plot(x, yfit);
1. What will be output of this Python code: import numpy as np import matplotlib.pyplot as plt x = np.array([1, 2, 3, 4, 5]) y = np.array([4, 2, 1, 3, 7]) plt.scatter(x, y); 2. What will be output of this Python code for the same data as above, from sklearn.linear_model import LinearRegression X=x[:, np.newaxis] model LinearRegression().fit(x, y) = yfit = model.predict(X) plt.scatter(x, y) plt.plot(x, yfit);
Related questions
Question
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 5 steps with 3 images