R2 Score Function In Python Example