Made multiplicative factor in Scoring file rather than with bind

calls

Value: [1e-5 to 7.5e-4]
This commit is contained in:
Quinn Dougherty 2022-05-04 11:48:20 -04:00
parent f5f5be2cfb
commit 627616558a
4 changed files with 8 additions and 13 deletions

View File

@ -280,10 +280,7 @@ module T = Dist({
if referenceIsZero { if referenceIsZero {
Ok(0.0) Ok(0.0)
} else { } else {
E.R2.bind( combinePointwise(PointSetDist_Scoring.LogScoring.logScore, base, reference)
combinePointwise(PointSetDist_Scoring.LogScoring.multiply, reference),
combinePointwise(PointSetDist_Scoring.LogScoring.logScore, base, reference),
)
|> E.R.fmap(shapeMap(XYShape.T.filterYValues(Js.Float.isFinite))) |> E.R.fmap(shapeMap(XYShape.T.filterYValues(Js.Float.isFinite)))
|> E.R.fmap(integralEndY) |> E.R.fmap(integralEndY)
} }

View File

@ -239,10 +239,9 @@ module T = Dist({
if referenceIsZero { if referenceIsZero {
Ok(0.0) Ok(0.0)
} else { } else {
E.R2.bind( combinePointwise(~fn=PointSetDist_Scoring.LogScoring.logScore, base, reference) |> E.R2.bind(
combinePointwise(~fn=PointSetDist_Scoring.LogScoring.multiply, reference), integralEndYResult,
combinePointwise(~fn=PointSetDist_Scoring.LogScoring.logScore, base, reference), )
) |> E.R2.bind(integralEndYResult)
} }
} }
}) })

View File

@ -311,10 +311,9 @@ module T = Dist({
if referenceIsZero { if referenceIsZero {
Ok(0.0) Ok(0.0)
} else { } else {
E.R2.bind( combinePointwise(PointSetDist_Scoring.LogScoring.logScore, base, reference) |> E.R.fmap(
combinePointwise(PointSetDist_Scoring.LogScoring.multiply, reference), integralEndY,
combinePointwise(PointSetDist_Scoring.LogScoring.logScore, base, reference), )
) |> E.R.fmap(integralEndY)
} }
} }
}) })

View File

@ -8,7 +8,7 @@ module LogScoring = {
Error(Operation.DivisionByZeroError) Error(Operation.DivisionByZeroError)
} else { } else {
let quot = a /. b let quot = a /. b
quot < 0.0 ? Error(Operation.ComplexNumberError) : Ok(logFn(quot)) quot < 0.0 ? Error(Operation.ComplexNumberError) : Ok(b *. logFn(quot))
} }
let multiply = (a: float, b: float): result<float, Operation.Error.t> => Ok(a *. b) let multiply = (a: float, b: float): result<float, Operation.Error.t> => Ok(a *. b)
} }