public class LinearCurveFitter extends java.lang.Object implements CurveFitter
Interpolates linearly between example points. Outside the range of examples, the last interval is extrapolated.
Inputs x must be sorted from lowest to highest.
TODO: sort inputs
Constructor and Description |
---|
LinearCurveFitter() |
Modifier and Type | Method and Description |
---|---|
CurveFitter |
clone() |
Function |
fit(float[] x,
float[] y)
Note that inputs x must be sorted from lowest to highest.
|
public Function fit(float[] x, float[] y)
fit
in interface CurveFitter
x
- Example x pointsy
- Example y points (must be same length as x)CurveFitter.fit(float[], float[])
public CurveFitter clone() throws java.lang.CloneNotSupportedException
clone
in interface CurveFitter
clone
in class java.lang.Object
java.lang.CloneNotSupportedException
- is clone can't be made