Class LinearModel
java.lang.Object
org.elasticsearch.search.aggregations.pipeline.MovAvgModel
org.elasticsearch.search.aggregations.pipeline.LinearModel
- All Implemented Interfaces:
NamedWriteable
,Writeable
,ToXContent
,ToXContentFragment
Calculate a linearly weighted moving average, such that older values are
linearly less important. "Time" is determined by position in collection
-
Nested Class Summary
Nested classes/interfaces inherited from class org.elasticsearch.search.aggregations.pipeline.MovAvgModel
MovAvgModel.AbstractModelParser
Nested classes/interfaces inherited from interface org.elasticsearch.xcontent.ToXContent
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
Nested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V>
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
static final MovAvgModel.AbstractModelParser
Fields inherited from interface org.elasticsearch.xcontent.ToXContent
EMPTY_PARAMS
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns 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 predictionsboolean
Returns the name of the writeable objectint
hashCode()
Generates a "neighboring" model, where one of the tunable parameters has been randomly mutated within the allowed range.double
next
(Collection<Double> values) Returns the next value in the series, according to the underlying smoothing modeltoXContent
(XContentBuilder builder, ToXContent.Params params) void
writeTo
(StreamOutput out) Write the model to the output streamMethods inherited from class org.elasticsearch.search.aggregations.pipeline.MovAvgModel
emptyPredictions, hasValue, minimizeByDefault, predict, validate
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.elasticsearch.xcontent.ToXContentFragment
isFragment
-
Field Details
-
NAME
- See Also:
-
PARSER
-
-
Constructor Details
-
LinearModel
public LinearModel() -
LinearModel
Read from a stream.
-
-
Method Details
-
writeTo
Description copied from class:MovAvgModel
Write the model to the output stream- Specified by:
writeTo
in interfaceWriteable
- Specified by:
writeTo
in classMovAvgModel
- Parameters:
out
- Output stream- Throws:
IOException
-
getWriteableName
Description copied from interface:NamedWriteable
Returns the name of the writeable object -
canBeMinimized
public boolean canBeMinimized()Description copied from class:MovAvgModel
Returns if the model can be cost minimized. Not all models have parameters which can be tuned / optimized.- Specified by:
canBeMinimized
in classMovAvgModel
-
neighboringModel
Description copied from class:MovAvgModel
Generates a "neighboring" model, where one of the tunable parameters has been randomly mutated within the allowed range. Used for minimization- Specified by:
neighboringModel
in classMovAvgModel
-
clone
Description copied from class:MovAvgModel
Clone the model, returning an exact copy- Specified by:
clone
in classMovAvgModel
-
doPredict
Description copied from class:MovAvgModel
Calls to the model-specific implementation which actually generates the predictions- Specified by:
doPredict
in 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:MovAvgModel
Returns the next value in the series, according to the underlying smoothing model- Specified by:
next
in classMovAvgModel
- Parameters:
values
- Collection of numerics to movingAvg, usually windowed- Returns:
- Returns a double, since most smoothing methods operate on floating points
-
toXContent
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException - Throws:
IOException
-
hashCode
public int hashCode()- Specified by:
hashCode
in classMovAvgModel
-
equals
- Specified by:
equals
in classMovAvgModel
-