What does the np.polyfit() function do in NumPy?
Correct answer
A. Fits a polynomial of specified degree to a set of data points
15 views
A. Fits a polynomial of specified degree to a set of data points
15 views
np.polyfit() fits a polynomial of a specified degree to data points using least squares and returns the coefficients, highest power first. np.polyfit(x, y, 1) gives the slope and intercept of the best-fit line.
Use np.polyval() to evaluate the fitted polynomial.
Keep preparing with more Data Science MCQs on MCQsExam.com.
Not sure why the answer is A? Ask here and get an explanation.