T
- the class of the PerformanceMeasure
, typically NumericalPerformanceMeasure
or PerformanceMeasure
public class AbstractPerformanceMeasureParameterSet<T extends PerformanceMeasure> extends ExpandableParameterSet
PerformanceMeasure
s that can be used
in AbstractClassifier.evaluate(AbstractPerformanceMeasureParameterSet, boolean, de.jstacs.data.DataSet...)
.ParameterSet.ParameterList
commentTemplate, nameTemplate, template
errorMessage, parameters, parent
Modifier | Constructor and Description |
---|---|
protected |
AbstractPerformanceMeasureParameterSet(int numClasses,
boolean numerical,
T[] measures)
Creates a new
AbstractPerformanceMeasureParameterSet for the given number of classes and measures using only numerical
performance measures or not. |
protected |
AbstractPerformanceMeasureParameterSet(int numClasses,
SelectionParameter selection,
T... measures)
This constructor creates an instance with a given template
selection that can be used for classifiers handling a given number of classes. |
|
AbstractPerformanceMeasureParameterSet(StringBuffer xml)
The standard constructor for the interface
Storable . |
addParameterToSet, clone, fromGalaxy, fromXML, parameterRemovable, removeParameterFromSet, replaceContentWith, toGalaxy, toXML
getAllParameterNames, getComment, getComment, getErrorMessage, getIndex, getName, getName, getNumberOfParameters, getParameterAt, getParameterForName, getParent, hasDefaultOrIsSet, initParameterList, initParameterList, isAtomic, isComparable, parametersLoaded, reset, setParent
public AbstractPerformanceMeasureParameterSet(StringBuffer xml) throws NonParsableException
Storable
.
Constructs a AbstractPerformanceMeasureParameterSet
out of an XML representation.xml
- the XML representation as StringBuffer
NonParsableException
- if the AbstractPerformanceMeasureParameterSet
could not be reconstructed out of
the StringBuffer
xml
protected AbstractPerformanceMeasureParameterSet(int numClasses, boolean numerical, T[] measures) throws Exception
AbstractPerformanceMeasureParameterSet
for the given number of classes and measures using only numerical
performance measures or not.numClasses
- the number of classesnumerical
- the information if all measures shall be NumericalPerformanceMeasure
smeasures
- the measuresException
- if something went wrongprotected AbstractPerformanceMeasureParameterSet(int numClasses, SelectionParameter selection, T... measures) throws Exception
selection
that can be used for classifiers handling a given number of classes.
Additional it allows to set some measure initially.numClasses
- the number of classesselection
- the template that can be used to add an select performance measuresmeasures
- the initially set measuresException
- if the measures
could not be set (e.g. number of classes differs, ...)protected static int getNumberOfClasses(PerformanceMeasure[] measures)
PerformanceMeasure
s in measures
can be applied to.measures
- the measurespublic static NumericalPerformanceMeasureParameterSet createFilledParameters() throws Exception
NumericalPerformanceMeasureParameterSet
that can be used in
AbstractClassifier.evaluate(AbstractPerformanceMeasureParameterSet, boolean, de.jstacs.data.DataSet...)
or in a ClassifierAssessment
.NumericalPerformanceMeasureParameterSet
Exception
- forwarded from createFilledParameters(boolean, double, double, double, double)
public static AbstractPerformanceMeasureParameterSet createFilledParameters(boolean numerical, double spForSn, double snForFPR, double snForPPV, double beta) throws Exception
AbstractPerformanceMeasureParameterSet
that can be used in
AbstractClassifier.evaluate(AbstractPerformanceMeasureParameterSet, boolean, de.jstacs.data.DataSet...)
.
If numerical = false
, the parameter set also contains curve measures (e.g. PRCurve
, ROCCurve
).numerical
- if true
the return type is NumericalPerformanceMeasureParameterSet
, otherwise AbstractPerformanceMeasureParameterSet
spForSn
- the specificity for computing the sensitivity (cf. SensitivityForFixedSpecificity
)snForFPR
- the specificity for computing the sensitivity (cf. FalsePositiveRateForFixedSensitivity
)snForPPV
- the specificity for computing the sensitivity (cf. PositivePredictiveValueForFixedSensitivity
)beta
- the beta of the F-measure (cf. MaximumFMeasure
)AbstractPerformanceMeasureParameterSet
Exception
- if a performance measure could not be created properly (e.g. wrong parameters: sensitivity < 0, ...)protected void setMeasure(T measure) throws SimpleParameter.IllegalValueException
ParameterSetContainer
.measure
- the measure to be computedSimpleParameter.IllegalValueException
- if the measure could not be set (forwarded from SelectionParameter.setValue(Object)
)public AbstractPerformanceMeasure removeMeasure(int index)
index
from the set and returns this measure.index
- the index of the measure to be removedpublic AbstractPerformanceMeasure[] removeMeasures(Class<? extends AbstractPerformanceMeasure> clazz)
clazz
- the specific classObject.equals(Object)
public AbstractPerformanceMeasure[] removeMeasures(String name)
name
- the specific nameAbstractPerformanceMeasure.getName()
,
String.equals(Object)
public AbstractPerformanceMeasure[] getAllMeasures()