org.apache.ignite.ml.regressions.linear

## Class LinearRegressionModel

- java.lang.Object
- - org.apache.ignite.ml.regressions.linear.LinearRegressionModel

- All Implemented Interfaces:
    Serializable, AutoCloseable, Exportable<LinearRegressionModel>, IgniteModel<Vector,Double>, Model<Vector,Double>

      public final class LinearRegressionModel
      extends Object
      implements IgniteModel<Vector,Double>, Exportable<LinearRegressionModel>

  Simple linear regression model which predicts result value Y as a linear combination of input variables: Y = weights * X + intercept.
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `LinearRegressionModel(Vector weights, double intercept)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(Object o)`
    `double` | `getIntercept()`
    `Vector` | `getWeights()`
    `int` | `hashCode()`
    `Double` | `predict(Vector input)` Make a prediction for the specified input arguments.
    `<P> void` | `saveModel(Exporter<LinearRegressionModel,P> exporter, P path)` Save model by the given path.
    `String` | `toString()`
    `String` | `toString(boolean pretty)`

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

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface org.apache.ignite.ml.IgniteModel

      `andBefore, andThen, andThen, close, combine`

- - ### Constructor Detail

    - #### LinearRegressionModel

          public LinearRegressionModel(Vector weights,
                                       double intercept)

  - ### Method Detail

    - #### getWeights

          public Vector getWeights()

    - #### getIntercept

          public double getIntercept()

    - #### predict

          public Double predict(Vector input)

      Make a prediction for the specified input arguments.
      Specified by:
        `predict` in interface `Model<Vector,Double>`
      Parameters:
        `input` - Input arguments.
      Returns:
        Prediction result.

    - #### saveModel

          public <P> void saveModel(Exporter<LinearRegressionModel,P> exporter,
                                    P path)

      Save model by the given path.
      Specified by:
        `saveModel` in interface `Exportable<LinearRegressionModel>`
      Parameters:
        `exporter` - Exporter.
        `path` - Path to saved model.

    - #### equals

          public boolean equals(Object o)

      Overrides:
        `equals` in class `Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### toString

          public String toString(boolean pretty)

      Specified by:
        `toString` in interface `IgniteModel<Vector,Double>`
      Parameters:
        `pretty` - Use pretty mode.

2020 Copyright © Apache Software Foundation
| Follow @ApacheIgnite
Ignite Database and Caching Platform | : ver. 2.9.1
Release Date | : December 9 2020