Class KNNRegression
- java.lang.Object
-
- com.actelion.research.calc.regression.ARegressionMethod<ParameterKNN>
-
- com.actelion.research.calc.regression.knn.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.
-
-
Field Summary
Fields Modifier and Type Field Description static int
NEIGHBOURS
-
Fields inherited from class com.actelion.research.calc.regression.ARegressionMethod
parameterRegressionMethod
-
-
Constructor Summary
Constructors Constructor Description KNNRegression()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
calculateYHat(double[] arrRow)
Thread save method.Matrix
calculateYHat(Matrix X)
Not thread save.Matrix
createModel(ModelXYIndex modelXYIndexTrain)
int
getNeighbours()
void
setNeighbours(int neighbours)
-
Methods inherited from class com.actelion.research.calc.regression.ARegressionMethod
decodeProperties2Parameter, getName, getParameter, getProgressController, getProperties, setParameterRegressionMethod, setProgressController
-
-
-
-
Field Detail
-
NEIGHBOURS
public static final int NEIGHBOURS
- See Also:
- Constant Field Values
-
-
Method Detail
-
getNeighbours
public int getNeighbours()
-
setNeighbours
public void setNeighbours(int neighbours)
-
createModel
public Matrix createModel(ModelXYIndex modelXYIndexTrain)
-
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:
-
-