Skip to content

Commit

Permalink
'fix-bug-r-square'
Browse files Browse the repository at this point in the history
  • Loading branch information
superarthurlx committed Jan 2, 2025
1 parent e716d1d commit e554d9f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions basicts/metrics/r_square.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,4 @@ def masked_r2(prediction: torch.Tensor, target: torch.Tensor, null_val: float =

# 计算 R^2
loss = 1 - (ss_res / (ss_tot + eps))
return torch.mean(loss)

0 comments on commit e554d9f

Please sign in to comment.