Module org.elasticsearch.xcore
Class AucRoc
java.lang.Object
org.elasticsearch.xpack.core.ml.dataframe.evaluation.common.AbstractAucRoc
org.elasticsearch.xpack.core.ml.dataframe.evaluation.classification.AucRoc
- All Implemented Interfaces:
NamedWriteable,Writeable,org.elasticsearch.xcontent.ToXContent,org.elasticsearch.xcontent.ToXContentObject,EvaluationMetric
Area under the curve (AUC) of the receiver operating characteristic (ROC).
The ROC curve is a plot of the TPR (true positive rate) against
the FPR (false positive rate) over a varying threshold.
This particular implementation is making use of ES aggregations
to calculate the curve. It then uses the trapezoidal rule to calculate
the AUC.
In particular, in order to calculate the ROC, we get percentiles of TP
and FP against the predicted probability. We call those Rate-Threshold
curves. We then scan ROC points from each Rate-Threshold curve against the
other using interpolation. This gives us an approximation of the ROC curve
that has the advantage of being efficient and resilient to some edge cases.
When this is used for multi-class classification, it will calculate the ROC
curve of each class versus the rest.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.elasticsearch.xpack.core.ml.dataframe.evaluation.common.AbstractAucRoc
AbstractAucRoc.AucRocPoint, AbstractAucRoc.ResultNested classes/interfaces inherited from interface org.elasticsearch.xcontent.ToXContent
org.elasticsearch.xcontent.ToXContent.DelegatingMapParams, org.elasticsearch.xcontent.ToXContent.MapParams, org.elasticsearch.xcontent.ToXContent.ParamsNested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V> -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final org.elasticsearch.xcontent.ParseFieldstatic final org.elasticsearch.xcontent.ParseFieldFields inherited from class org.elasticsearch.xpack.core.ml.dataframe.evaluation.common.AbstractAucRoc
NAMEFields inherited from interface org.elasticsearch.xcontent.ToXContent
EMPTY, EMPTY_PARAMS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.elasticsearch.core.Tuple<List<AggregationBuilder>, List<PipelineAggregationBuilder>> aggs(EvaluationParameters parameters, EvaluationFields evaluationFields) Builds the aggregation that collect required data to compute the metricbooleanstatic AucRocfromXContent(org.elasticsearch.xcontent.XContentParser parser) Returns the set of fields that this metric requires in order to be calculated.Gets the evaluation result for this metric.inthashCode()voidprocess(InternalAggregations aggs) Processes given aggregations as a step towards computing resultorg.elasticsearch.xcontent.XContentBuildertoXContent(org.elasticsearch.xcontent.XContentBuilder builder, org.elasticsearch.xcontent.ToXContent.Params params) voidwriteTo(StreamOutput out) Methods inherited from class org.elasticsearch.xpack.core.ml.dataframe.evaluation.common.AbstractAucRoc
buildAucRocCurve, calculateAucScore, getName, percentilesArrayMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.elasticsearch.xcontent.ToXContentObject
isFragment
-
Field Details
-
INCLUDE_CURVE
public static final org.elasticsearch.xcontent.ParseField INCLUDE_CURVE -
CLASS_NAME
public static final org.elasticsearch.xcontent.ParseField CLASS_NAME -
PARSER
-
-
Constructor Details
-
AucRoc
-
AucRoc
- Throws:
IOException
-
-
Method Details
-
fromXContent
-
getWriteableName
-
writeTo
- Throws:
IOException
-
toXContent
public org.elasticsearch.xcontent.XContentBuilder toXContent(org.elasticsearch.xcontent.XContentBuilder builder, org.elasticsearch.xcontent.ToXContent.Params params) throws IOException - Throws:
IOException
-
getRequiredFields
Description copied from interface:EvaluationMetricReturns the set of fields that this metric requires in order to be calculated. -
equals
-
hashCode
public int hashCode() -
aggs
public org.elasticsearch.core.Tuple<List<AggregationBuilder>,List<PipelineAggregationBuilder>> aggs(EvaluationParameters parameters, EvaluationFields evaluationFields) Description copied from interface:EvaluationMetricBuilds the aggregation that collect required data to compute the metric- Parameters:
parameters- settings that may be needed by aggregationsevaluationFields- fields that may be needed by aggregations- Returns:
- the aggregations required to compute the metric
-
process
Description copied from interface:EvaluationMetricProcesses given aggregations as a step towards computing result- Parameters:
aggs- aggregations fromSearchResponse
-
getResult
Description copied from interface:EvaluationMetricGets the evaluation result for this metric.- Returns:
Optional.empty()if the result is not available yet,Optional.of(result)otherwise
-