@CodeReview(reviewer="Kevin R. Dixon", date="2006-07-17", changesNeeded=false, comments={"Encapsulated members, added a comment to virtually every method and member.","Added comment about the regression equation.","No additional changes needed."}) public class LinearRegressionCoefficientExtractor extends AbstractStatefulEvaluator<Vector,Vector,FiniteCapacityBuffer<Vector>>
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_MAX_BUFFER_SIZE
Default maximum buffer size, 20.
|
Constructor and Description |
---|
LinearRegressionCoefficientExtractor()
Default constructor.
|
LinearRegressionCoefficientExtractor(int maxBufferSize)
Creates new instance of LinearRegressionEvaluator
|
Modifier and Type | Method and Description |
---|---|
LinearRegressionCoefficientExtractor |
clone()
This makes public the clone method on the
Object class and
removes the exception that it throws. |
FiniteCapacityBuffer<Vector> |
createDefaultState()
Creates a new default state object.
|
Vector |
evaluate(Vector input)
Evaluates the object using the given input and current state objects,
returning the output.
|
int |
getMaxBufferSize()
Getter for maxBufferSize
|
void |
setMaxBufferSize(int maxBufferSize)
Setter for maxBufferSize
|
evaluate, getState, resetState, setState
public static final int DEFAULT_MAX_BUFFER_SIZE
public LinearRegressionCoefficientExtractor()
public LinearRegressionCoefficientExtractor(int maxBufferSize)
maxBufferSize
- maximum number of vectors to hold in the bufferpublic LinearRegressionCoefficientExtractor clone()
AbstractCloneableSerializable
Object
class and
removes the exception that it throws. Its default behavior is to
automatically create a clone of the exact type of object that the
clone is called on and to copy all primitives but to keep all references,
which means it is a shallow copy.
Extensions of this class may want to override this method (but call
super.clone()
to implement a "smart copy". That is, to target
the most common use case for creating a copy of the object. Because of
the default behavior being a shallow copy, extending classes only need
to handle fields that need to have a deeper copy (or those that need to
be reset). Some of the methods in ObjectUtil
may be helpful in
implementing a custom clone method.
Note: The contract of this method is that you must use
super.clone()
as the basis for your implementation.clone
in interface CloneableSerializable
clone
in class AbstractStatefulEvaluator<Vector,Vector,FiniteCapacityBuffer<Vector>>
public FiniteCapacityBuffer<Vector> createDefaultState()
StatefulEvaluator
public Vector evaluate(Vector input)
StatefulEvaluator
input
- The input to evaluate.public int getMaxBufferSize()
public void setMaxBufferSize(int maxBufferSize)
maxBufferSize
- Maximum buffer size, must be greater than or equal to 2