Class SimpleModel
java.lang.Object
org.elasticsearch.search.aggregations.pipeline.MovAvgModel
org.elasticsearch.search.aggregations.pipeline.SimpleModel
- All Implemented Interfaces:
NamedWriteable,Writeable,org.elasticsearch.common.xcontent.ToXContent,org.elasticsearch.common.xcontent.ToXContentFragment
Calculate a simple unweighted (arithmetic) moving average
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class org.elasticsearch.search.aggregations.pipeline.MovAvgModel
MovAvgModel.AbstractModelParserNested classes/interfaces inherited from interface org.elasticsearch.common.xcontent.ToXContent
org.elasticsearch.common.xcontent.ToXContent.DelegatingMapParams, org.elasticsearch.common.xcontent.ToXContent.MapParams, org.elasticsearch.common.xcontent.ToXContent.ParamsNested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V> -
Field Summary
FieldsFields inherited from interface org.elasticsearch.common.xcontent.ToXContent
EMPTY_PARAMS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns if the model can be cost minimized.clone()Clone the model, returning an exact copyprotected double[]doPredict(Collection<Double> values, int numPredictions)Calls to the model-specific implementation which actually generates the predictionsbooleanReturns the name of the writeable objectinthashCode()Generates a "neighboring" model, where one of the tunable parameters has been randomly mutated within the allowed range.doublenext(Collection<Double> values)Returns the next value in the series, according to the underlying smoothing modelorg.elasticsearch.common.xcontent.XContentBuildertoXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params)voidwriteTo(StreamOutput out)Write the model to the output streamMethods inherited from class org.elasticsearch.search.aggregations.pipeline.MovAvgModel
emptyPredictions, hasValue, minimizeByDefault, predict, validateMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.elasticsearch.common.xcontent.ToXContentFragment
isFragment
-
Field Details
-
NAME
- See Also:
- Constant Field Values
-
PARSER
-
-
Constructor Details
-
SimpleModel
public SimpleModel() -
SimpleModel
Read from a stream.- Throws:
IOException
-
-
Method Details
-
writeTo
Description copied from class:MovAvgModelWrite the model to the output stream- Specified by:
writeToin interfaceWriteable- Specified by:
writeToin classMovAvgModel- Parameters:
out- Output stream- Throws:
IOException
-
getWriteableName
Description copied from interface:NamedWriteableReturns the name of the writeable object -
canBeMinimized
public boolean canBeMinimized()Description copied from class:MovAvgModelReturns if the model can be cost minimized. Not all models have parameters which can be tuned / optimized.- Specified by:
canBeMinimizedin classMovAvgModel
-
neighboringModel
Description copied from class:MovAvgModelGenerates a "neighboring" model, where one of the tunable parameters has been randomly mutated within the allowed range. Used for minimization- Specified by:
neighboringModelin classMovAvgModel
-
clone
Description copied from class:MovAvgModelClone the model, returning an exact copy- Specified by:
clonein classMovAvgModel
-
doPredict
Description copied from class:MovAvgModelCalls to the model-specific implementation which actually generates the predictions- Specified by:
doPredictin classMovAvgModel- Parameters:
values- Collection of numerics to movingAvg, usually windowednumPredictions- Number of newly generated predictions to return- Returns:
- Returns an array of doubles, since most smoothing methods operate on floating points
-
next
Description copied from class:MovAvgModelReturns the next value in the series, according to the underlying smoothing model- Specified by:
nextin classMovAvgModel- Parameters:
values- Collection of numerics to movingAvg, usually windowed- Returns:
- Returns a double, since most smoothing methods operate on floating points
-
toXContent
public org.elasticsearch.common.xcontent.XContentBuilder toXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params) throws IOException- Throws:
IOException
-
hashCode
public int hashCode()- Specified by:
hashCodein classMovAvgModel
-
equals
- Specified by:
equalsin classMovAvgModel
-