Package net.starype.quiz.api.game.answer
Class BinaryLossFunction
- java.lang.Object
-
- net.starype.quiz.api.game.answer.BinaryLossFunction
-
- All Implemented Interfaces:
LossFunction
public class BinaryLossFunction extends java.lang.Object implements LossFunction
A loss function that considers the value 100% correct if in a given range, 0% otherwise.
-
-
Constructor Summary
Constructors Constructor Description BinaryLossFunction()
Construct a BinaryLossFunction object withScoreDistribution.EPSILON
threshold.BinaryLossFunction(double threshold)
Construct a BinaryLossFunction object from the specified threshold (range).
-
Method Summary
Modifier and Type Method Description double
evaluate(double error)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.starype.quiz.api.game.answer.LossFunction
evaluate
-
-
-
-
Constructor Detail
-
BinaryLossFunction
public BinaryLossFunction(double threshold)
Construct a BinaryLossFunction object from the specified threshold (range).- Parameters:
threshold
- the 'error' tolerated to consider a 100% accuracy
-
BinaryLossFunction
public BinaryLossFunction()
Construct a BinaryLossFunction object withScoreDistribution.EPSILON
threshold.
-
-
Method Detail
-
evaluate
public double evaluate(double error)
- Specified by:
evaluate
in interfaceLossFunction
-
-