Class KNNRegression

  • All Implemented Interfaces:
    ICalculateModel, ICalculateYHat

    public class KNNRegression
    extends ARegressionMethod<ParameterKNN>
    KNNRegression kNN regression seems to be very inappropriate for regression problems. However, as base-line method it has a value.

    Modest v. Korff

    Created by korffmo1 on 24.11.18. 20.09.2019 Index bug fixed.

    • Constructor Detail

      • KNNRegression

        public KNNRegression()
    • Method Detail

      • getNeighbours

        public int getNeighbours()
      • setNeighbours

        public void setNeighbours​(int neighbours)
      • calculateYHat

        public Matrix calculateYHat​(Matrix X)
        Not thread save. Should not be called from several threads.
        Parameters:
        X -
        Returns:
      • calculateYHat

        public double calculateYHat​(double[] arrRow)
        Thread save method. Can be called from different threads.
        Parameters:
        arrRow -
        Returns: