I have some data points to plot, and would like to add a best fit line to the graph, and then output the relevant metrics to indicate the quality of the best fit line.
I could plot the data, and polyfit
is a function I used to add the best fit line. However, I am just wondering how could I get the metrics that indicates the quality of the best fit line?
I don't see polyfit
returns any metrics (i.e. min square error value).
Data:
0,1717
1,1761
2,1961
3,1711
4,1285
5,976
6,721
7,428
8,313
9,297
10,375
11,521
12,678
13,752
14,728
15,758
16,741
17,812
18,845
19,863
20,933
21,1169
22,1523
23,1779