T - the class of the PerformanceMeasure, typically NumericalPerformanceMeasure or PerformanceMeasurepublic class AbstractPerformanceMeasureParameterSet<T extends PerformanceMeasure> extends ExpandableParameterSet
PerformanceMeasures that can be used
in AbstractClassifier.evaluate(AbstractPerformanceMeasureParameterSet, boolean, de.jstacs.data.DataSet...).ParameterSet.ParameterListcommentTemplate, nameTemplate, templateerrorMessage, 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. |
| Modifier and Type | Method and Description |
|---|---|
static NumericalPerformanceMeasureParameterSet |
createFilledParameters()
Creates a filled
NumericalPerformanceMeasureParameterSet that can be used in
AbstractClassifier.evaluate(AbstractPerformanceMeasureParameterSet, boolean, de.jstacs.data.DataSet...)
or in a ClassifierAssessment. |
static AbstractPerformanceMeasureParameterSet |
createFilledParameters(boolean numerical,
double spForSn,
double snForFPR,
double snForPPV,
double beta)
Creates a filled
AbstractPerformanceMeasureParameterSet that can be used in
AbstractClassifier.evaluate(AbstractPerformanceMeasureParameterSet, boolean, de.jstacs.data.DataSet...). |
AbstractPerformanceMeasure[] |
getAllMeasures()
Returns an array of all contained performance measures.
|
protected static int |
getNumberOfClasses(PerformanceMeasure[] measures)
Returns the number of classes the
PerformanceMeasures in measures
can be applied to. |
AbstractPerformanceMeasure |
removeMeasure(int index)
Removes the measure with index
index from the set and returns this measure. |
AbstractPerformanceMeasure[] |
removeMeasures(Class<? extends AbstractPerformanceMeasure> clazz)
Removes all measures of a specific class from the set.
|
AbstractPerformanceMeasure[] |
removeMeasures(String name)
Removes all measures with a specific name.
|
protected void |
setMeasure(T measure)
Sets the given measure as content of the internally last
ParameterSetContainer. |
addParameterToSet, clone, fromGalaxy, fromXML, parameterRemovable, removeParameterFromSet, replaceContentWith, toGalaxy, toXMLgetAllParameterNames, getComment, getComment, getErrorMessage, getIndex, getName, getName, getNumberOfParameters, getParameterAt, getParameterForName, getParent, hasDefaultOrIsSet, initParameterList, initParameterList, isAtomic, isComparable, parametersLoaded, reset, setParentpublic AbstractPerformanceMeasureParameterSet(StringBuffer xml) throws NonParsableException
Storable.
Constructs a AbstractPerformanceMeasureParameterSet out of an XML representation.xml - the XML representation as StringBufferNonParsableException - if the AbstractPerformanceMeasureParameterSet could not be reconstructed out of
the StringBuffer xmlprotected 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 NumericalPerformanceMeasuresmeasures - 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)
PerformanceMeasures 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.NumericalPerformanceMeasureParameterSetException - 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 trueNumericalPerformanceMeasureParameterSet, otherwise AbstractPerformanceMeasureParameterSetspForSn - 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)AbstractPerformanceMeasureParameterSetException - 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()