io.siddhi.extension.execution.streamingml.bayesian.util

## Class LinearRegression

- java.lang.Object
- - io.siddhi.extension.execution.streamingml.bayesian.util.BayesianModel
  - - io.siddhi.extension.execution.streamingml.bayesian.util.LinearRegression

- All Implemented Interfaces:
    Serializable

      public class LinearRegression
      extends BayesianModel

  implements Bayesian Linear regression model.

  minimize the negative ELBO ELBO = E[log(P(yIn|xIn,weights)] - D_KL[weights,prior]

  See Also:
    Serialized Form

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class io.siddhi.extension.execution.streamingml.bayesian.util.BayesianModel

      `BayesianModel.OptimizerType`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `LinearRegression()`
    `LinearRegression(LinearRegression model)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `double` | `evaluate(double[] features, Object expected)`
    `protected double[][]` | `getUpdatedWeights()` implements the model specific gradient updates.

    - ### Methods inherited from class io.siddhi.extension.execution.streamingml.bayesian.util.BayesianModel

      `getLearningRate, getNumFeatures, getNumSamples, getOptimizerType, initiateModel, predict, predictWithStd, setAddBias, setLearningRate, setNumFeatures, setNumSamples, setOptimizerType, setPredictionSamples, update`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### LinearRegression

          public LinearRegression()

    - #### LinearRegression

          public LinearRegression(LinearRegression model)

  - ### Method Detail

    - #### getUpdatedWeights

          protected double[][] getUpdatedWeights()

      Description copied from class: `BayesianModel`
      implements the model specific gradient updates.
      Specified by:
        `getUpdatedWeights` in class `BayesianModel`
      Returns:
        var means and stds

    - #### evaluate

          public double evaluate(double[] features,
                                 Object expected)

      Specified by:
        `evaluate` in class `BayesianModel`

Copyright © 2022 WSO2. All rights reserved.