Cho n giá trị thực y_true và n dự đoán y_pred. Tính R^2 = 1 - SS_res/SS_tot trong đó SS_res = sum((y_true - y_pred)^2), SS_tot = sum((y_true - mean(y_true))^2). Đảm bảo SS_tot > 0. In R^2 làm tròn 4 chữ số thập phân.
Dòng 1: n. Dòng 2: n số y_true. Dòng 3: n số y_pred.
2 <= n <= 10000; SS_tot > 0
Một số R^2 (4 chữ số thập phân).
Đang tải editor...