Module org.elasticsearch.xcore
Class Exponent
java.lang.Object
org.elasticsearch.xpack.core.ml.inference.trainedmodel.ensemble.Exponent
- All Implemented Interfaces:
org.apache.lucene.util.Accountable,NamedWriteable,Writeable,org.elasticsearch.xcontent.ToXContent,org.elasticsearch.xcontent.ToXContentObject,LenientlyParsedOutputAggregator,OutputAggregator,StrictlyParsedOutputAggregator,NamedXContentObject
public class Exponent
extends Object
implements StrictlyParsedOutputAggregator, LenientlyParsedOutputAggregator
-
Nested Class Summary
Nested 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 longstatic final org.elasticsearch.xcontent.ParseFieldFields inherited from interface org.apache.lucene.util.Accountable
NULL_ACCOUNTABLEFields inherited from interface org.elasticsearch.xcontent.ToXContent
EMPTY, EMPTY_PARAMS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoubleaggregate(double[] values) Function to aggregate the processed values into a single double This may be as simple as returning the index of the maximum value.booleancompatibleWith(TargetType targetType) booleanstatic ExponentfromXContentLenient(org.elasticsearch.xcontent.XContentParser parser) static ExponentfromXContentStrict(org.elasticsearch.xcontent.XContentParser parser) getName()inthashCode()double[]processValues(double[][] values) This pre-processes the values so that they may be passed directly to theOutputAggregator.aggregate(double[])method.longorg.elasticsearch.xcontent.XContentBuildertoXContent(org.elasticsearch.xcontent.XContentBuilder builder, org.elasticsearch.xcontent.ToXContent.Params params) voidwriteTo(StreamOutput out) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.lucene.util.Accountable
getChildResourcesMethods inherited from interface org.elasticsearch.xcontent.ToXContentObject
isFragment
-
Field Details
-
SHALLOW_SIZE
public static final long SHALLOW_SIZE -
NAME
public static final org.elasticsearch.xcontent.ParseField NAME -
WEIGHTS
public static final org.elasticsearch.xcontent.ParseField WEIGHTS
-
-
Constructor Details
-
Exponent
public Exponent(double[] weights) -
Exponent
- Throws:
IOException
-
-
Method Details
-
fromXContentStrict
-
fromXContentLenient
-
expectedValueSize
- Specified by:
expectedValueSizein interfaceOutputAggregator- Returns:
- The expected size of the values array when aggregating. `null` implies there is no expected size.
-
processValues
public double[] processValues(double[][] values) Description copied from interface:OutputAggregatorThis pre-processes the values so that they may be passed directly to theOutputAggregator.aggregate(double[])method. Two major types of pre-processed values could be returned: - The confidence/probability scaled values given the input values (See:WeightedMode.processValues(double[][])- A simple transformation of the passed values in preparation for aggregation (See:WeightedSum.processValues(double[][])- Specified by:
processValuesin interfaceOutputAggregator- Parameters:
values- the values to process- Returns:
- A new list containing the processed values or the same list if no processing is required
-
aggregate
public double aggregate(double[] values) Description copied from interface:OutputAggregatorFunction to aggregate the processed values into a single double This may be as simple as returning the index of the maximum value. Or as complex as a mathematical reduction of all the passed values (i.e. summation, average, etc.).- Specified by:
aggregatein interfaceOutputAggregator- Parameters:
values- The values to aggregate- Returns:
- the aggregated value.
-
getName
- Specified by:
getNamein interfaceNamedXContentObject- Specified by:
getNamein interfaceOutputAggregator- Returns:
- The name of the output aggregator
-
compatibleWith
- Specified by:
compatibleWithin interfaceOutputAggregator
-
getWriteableName
- Specified by:
getWriteableNamein interfaceNamedWriteable
-
writeTo
- Specified by:
writeToin interfaceWriteable- Throws:
IOException
-
toXContent
public org.elasticsearch.xcontent.XContentBuilder toXContent(org.elasticsearch.xcontent.XContentBuilder builder, org.elasticsearch.xcontent.ToXContent.Params params) throws IOException - Specified by:
toXContentin interfaceorg.elasticsearch.xcontent.ToXContent- Throws:
IOException
-
equals
-
hashCode
public int hashCode() -
ramBytesUsed
public long ramBytesUsed()- Specified by:
ramBytesUsedin interfaceorg.apache.lucene.util.Accountable
-