org.elasticsearch.search.aggregations.pipeline.MovAvgModel
org.elasticsearch.search.aggregations.pipeline.EwmaModel
All Implemented Interfaces:
NamedWriteable, Writeable, org.elasticsearch.common.xcontent.ToXContent, org.elasticsearch.common.xcontent.ToXContentFragment

public class EwmaModel extends MovAvgModel
Calculate a exponentially weighted moving average
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
     

    Nested classes/interfaces inherited from class org.elasticsearch.search.aggregations.pipeline.MovAvgModel

    MovAvgModel.AbstractModelParser

    Nested 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.Params

    Nested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable

    Writeable.Reader<V>, Writeable.Writer<V>
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static
     
     

    Fields inherited from interface org.elasticsearch.common.xcontent.ToXContent

    EMPTY_PARAMS
  • Constructor Summary

    Constructors
    Constructor
    Description
     
    EwmaModel​(double alpha)
     
    Read from a stream.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Returns if the model can be cost minimized.
    Clone the model, returning an exact copy
    protected double[]
    <> values, int numPredictions)
    Calls to the model-specific implementation which actually generates the predictions
    boolean
     obj)
     
    Returns the name of the writeable object
    int
     
    Generates a "neighboring" model, where one of the tunable parameters has been randomly mutated within the allowed range.
    double
    <> values)
    Returns the next value in the series, according to the underlying smoothing model
    org.elasticsearch.common.xcontent.XContentBuilder
    toXContent​(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params)
     
    void
    Write the model to the output stream

    Methods inherited from class org.elasticsearch.search.aggregations.pipeline.MovAvgModel

    emptyPredictions, hasValue, minimizeByDefault, predict, validate

    Methods inherited from class java.lang.

    , , , , , , ,

    Methods inherited from interface org.elasticsearch.common.xcontent.ToXContentFragment

    isFragment
  • Field Details

  • Constructor Details

    • EwmaModel

      public EwmaModel()
    • EwmaModel

      public EwmaModel(double alpha)
    • EwmaModel

      public EwmaModel(StreamInput in) throws
      Read from a stream.
      Throws:
  • Method Details

    • writeTo

      public void writeTo(StreamOutput out) throws
      Description copied from class: MovAvgModel
      Write the model to the output stream
      Specified by:
      writeTo in interface Writeable
      Specified by:
      writeTo in class MovAvgModel
      Parameters:
      out - Output stream
      Throws:
    • getWriteableName

      public  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 class MovAvgModel
    • neighboringModel

      public MovAvgModel 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 class MovAvgModel
    • clone

      public MovAvgModel clone()
      Description copied from class: MovAvgModel
      Clone the model, returning an exact copy
      Specified by:
      clone in class MovAvgModel
    • doPredict

      protected double[] doPredict(<> values, int numPredictions)
      Description copied from class: MovAvgModel
      Calls to the model-specific implementation which actually generates the predictions
      Specified by:
      doPredict in class MovAvgModel
      Parameters:
      values - Collection of numerics to movingAvg, usually windowed
      numPredictions - Number of newly generated predictions to return
      Returns:
      Returns an array of doubles, since most smoothing methods operate on floating points
    • next

      public double next(<> values)
      Description copied from class: MovAvgModel
      Returns the next value in the series, according to the underlying smoothing model
      Specified by:
      next in class MovAvgModel
      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
      Throws:
    • hashCode

      public int hashCode()
      Specified by:
      hashCode in class MovAvgModel
    • equals

      public boolean equals( obj)
      Specified by:
      equals in class MovAvgModel