InputType
- Input type of the dataset and EvaluatorTargetType
- Output type (labels) of the dataset and Evaluatorpublic abstract class AbstractSupervisedCostFunction<InputType,TargetType> extends AbstractSupervisedPerformanceEvaluator<InputType,TargetType,TargetType,java.lang.Double> implements SupervisedCostFunction<InputType,TargetType>
Constructor and Description |
---|
AbstractSupervisedCostFunction()
Creates a new instance of AbstractSupervisedCostFunction
|
AbstractSupervisedCostFunction(java.util.Collection<? extends InputOutputPair<? extends InputType,TargetType>> costParameters)
Creates a new instance of AbstractSupervisedCostFunction
|
Modifier and Type | Method and Description |
---|---|
AbstractSupervisedCostFunction<InputType,TargetType> |
clone()
This makes public the clone method on the
Object class and
removes the exception that it throws. |
java.lang.Double |
evaluate(Evaluator<? super InputType,? extends TargetType> evaluator)
Computes the cost of the given target.
|
abstract java.lang.Double |
evaluatePerformance(java.util.Collection<? extends TargetEstimatePair<? extends TargetType,? extends TargetType>> data)
Evaluates the performance accuracy of the given estimates against the
given targets.
|
java.util.Collection<? extends InputOutputPair<? extends InputType,TargetType>> |
getCostParameters()
Gets the parameters of the cost function.
|
void |
setCostParameters(java.util.Collection<? extends InputOutputPair<? extends InputType,TargetType>> costParameters)
Sets the parameters of the cost function used to evaluate the cost of
a target.
|
java.lang.Double |
summarize(java.util.Collection<? extends TargetEstimatePair<? extends TargetType,? extends TargetType>> data)
Creates a summary of the given collection of data.
|
evaluatePerformance
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
evaluatePerformance
public AbstractSupervisedCostFunction()
public AbstractSupervisedCostFunction(java.util.Collection<? extends InputOutputPair<? extends InputType,TargetType>> costParameters)
costParameters
- Labeled dataset to use to evaluate the cost againstpublic AbstractSupervisedCostFunction<InputType,TargetType> clone()
AbstractCloneableSerializable
Object
class and
removes the exception that it throws. Its default behavior is to
automatically create a clone of the exact type of object that the
clone is called on and to copy all primitives but to keep all references,
which means it is a shallow copy.
Extensions of this class may want to override this method (but call
super.clone()
to implement a "smart copy". That is, to target
the most common use case for creating a copy of the object. Because of
the default behavior being a shallow copy, extending classes only need
to handle fields that need to have a deeper copy (or those that need to
be reset). Some of the methods in ObjectUtil
may be helpful in
implementing a custom clone method.
Note: The contract of this method is that you must use
super.clone()
as the basis for your implementation.clone
in interface CostFunction<Evaluator<? super InputType,? extends TargetType>,java.util.Collection<? extends InputOutputPair<? extends InputType,TargetType>>>
clone
in interface CloneableSerializable
clone
in class AbstractCloneableSerializable
public abstract java.lang.Double evaluatePerformance(java.util.Collection<? extends TargetEstimatePair<? extends TargetType,? extends TargetType>> data)
SupervisedPerformanceEvaluator
evaluatePerformance
in interface SupervisedPerformanceEvaluator<InputType,TargetType,TargetType,java.lang.Double>
evaluatePerformance
in class AbstractSupervisedPerformanceEvaluator<InputType,TargetType,TargetType,java.lang.Double>
data
- The target-estimate pairs to use to evaluate performance.public java.lang.Double evaluate(Evaluator<? super InputType,? extends TargetType> evaluator)
CostFunction
evaluate
in interface Evaluator<Evaluator<? super InputType,? extends TargetType>,java.lang.Double>
evaluate
in interface CostFunction<Evaluator<? super InputType,? extends TargetType>,java.util.Collection<? extends InputOutputPair<? extends InputType,TargetType>>>
evaluator
- The object to evaluate.public java.util.Collection<? extends InputOutputPair<? extends InputType,TargetType>> getCostParameters()
CostFunction
getCostParameters
in interface CostFunction<Evaluator<? super InputType,? extends TargetType>,java.util.Collection<? extends InputOutputPair<? extends InputType,TargetType>>>
public void setCostParameters(java.util.Collection<? extends InputOutputPair<? extends InputType,TargetType>> costParameters)
CostFunction
setCostParameters
in interface CostFunction<Evaluator<? super InputType,? extends TargetType>,java.util.Collection<? extends InputOutputPair<? extends InputType,TargetType>>>
costParameters
- The parameters of the cost function.public java.lang.Double summarize(java.util.Collection<? extends TargetEstimatePair<? extends TargetType,? extends TargetType>> data)
Summarizer
summarize
in interface Summarizer<TargetEstimatePair<? extends TargetType,? extends TargetType>,java.lang.Double>
summarize
in class AbstractSupervisedPerformanceEvaluator<InputType,TargetType,TargetType,java.lang.Double>
data
- The collection of data to summarize.