Skip to content

Commit

Permalink
Update regression.py
Browse files Browse the repository at this point in the history
  • Loading branch information
tarantula-leo authored Dec 6, 2023
1 parent 5d8c587 commit 568ca02
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions sml/metrics/regression/regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
from sklearn import metrics
import jax.numpy as jnp

import spu.spu_pb2 as spu_pb2
import spu.utils.simulation as spsim


def _mean_tweedie_deviance(y_true, y_pred, sample_weight, power, d2_score=False):
Expand Down Expand Up @@ -45,7 +43,7 @@ def _mean_tweedie_deviance(y_true, y_pred, sample_weight, power, d2_score=False)
- temp_power * (y_true / temp - y_pred / (temp + 1))
)

if d2_score & (sample_weight is None):
if d2_score and (sample_weight is None):
# When weight is none and the d2 fraction is calculated, the numerator and denominator are divided by shape, and only sum is used
return jnp.sum(dev)
else:
Expand Down

0 comments on commit 568ca02

Please sign in to comment.