org.encog.ml.fitting.linear

## Class LinearRegression

- java.lang.Object
- - org.encog.ml.fitting.linear.LinearRegression

- All Implemented Interfaces:
    MLError, MLInput, MLInputOutput, MLMethod, MLOutput, MLRegression

      public class LinearRegression
      extends Object
      implements MLRegression, MLError

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `LinearRegression(int theInputCount)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `double` | `calculateError(MLDataSet data)` Calculate the error of the ML method, given a dataset.
    `MLData` | `compute(MLData input)` Compute regression.
    `int` | `getInputCount()`
    `int` | `getOutputCount()`
    `double[]` | `getWeights()`

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

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

- - ### Constructor Detail

    - #### LinearRegression

          public LinearRegression(int theInputCount)

  - ### Method Detail

    - #### getWeights

          public double[] getWeights()

    - #### getInputCount

          public int getInputCount()

      Specified by:
        `getInputCount` in interface `MLInput`
      Returns:
        The input.

    - #### getOutputCount

          public int getOutputCount()

      Specified by:
        `getOutputCount` in interface `MLOutput`
      Returns:
        The output count.

    - #### compute

          public MLData compute(MLData input)

      Description copied from interface: `MLRegression`
      Compute regression.
      Specified by:
        `compute` in interface `MLRegression`
      Parameters:
        `input` - The input data.
      Returns:
        The output data.

    - #### calculateError

          public double calculateError(MLDataSet data)

      Description copied from interface: `MLError`
      Calculate the error of the ML method, given a dataset.
      Specified by:
        `calculateError` in interface `MLError`
      Parameters:
        `data` - The dataset.
      Returns:
        The error.

Copyright © 2014. All Rights Reserved.