📜  poly fit python代码示例上的r值

📅  最后修改于: 2022-03-11 14:45:17.837000             🧑  作者: Mango

代码示例1
x_values = [1,2,3]
y_values = [1,5,25]

correlation_matrix = np.corrcoef(x_values, y_values)
correlation_xy = correlation_matrix[0,1]
r_squared = correlation_xy**2

print(r_squared)