@PublicationReference(author="Wikipedia", title="Generalized linear model", type=WebPage, year=2011, url="http://en.wikipedia.org/wiki/Generalized_linear_model") public class GeneralizedLinearModel extends AbstractCloneableSerializable implements VectorizableVectorFunction, VectorInputEvaluator<Vector,Vector>, VectorOutputEvaluator<Vector,Vector>
Constructor and Description |
---|
GeneralizedLinearModel()
Default constructor.
|
GeneralizedLinearModel(GeneralizedLinearModel other)
Creates a new instance of GeneralizedLinearModel
|
GeneralizedLinearModel(int numInputs,
int numOutputs,
UnivariateScalarFunction scalarFunction)
Creates a new instance of GeneralizedLinearModel
|
GeneralizedLinearModel(MultivariateDiscriminant matrixMultiply,
UnivariateScalarFunction scalarSquashingFunction)
Creates a new instance of GeneralizedLinearModel
|
GeneralizedLinearModel(MultivariateDiscriminant discriminant,
VectorFunction squashingFunction)
Creates a new instance of GeneralizedLinearModel
|
Modifier and Type | Method and Description |
---|---|
GeneralizedLinearModel |
clone()
This makes public the clone method on the
Object class and
removes the exception that it throws. |
void |
convertFromVector(Vector parameters)
Converts the object from a Vector of parameters.
|
Vector |
convertToVector()
Converts the object to a vector.
|
Vector |
evaluate(Vector input)
Evaluates the function on the given input and returns the output.
|
MultivariateDiscriminant |
getDiscriminant()
Getter for discriminant
|
int |
getInputDimensionality()
Gets the expected dimensionality of the input vector to the evaluator,
if it is known.
|
int |
getOutputDimensionality()
Gets the expected dimensionality of the output vector of the evaluator,
if it is known.
|
VectorFunction |
getSquashingFunction()
Getter for squashingFunction
|
void |
setDiscriminant(MultivariateDiscriminant discriminant)
Setter for discriminant
|
void |
setSquashingFunction(VectorFunction squashingFunction)
Setter for squashingFunction
|
java.lang.String |
toString() |
public GeneralizedLinearModel()
public GeneralizedLinearModel(int numInputs, int numOutputs, UnivariateScalarFunction scalarFunction)
numInputs
- Number of inputs of the function (number of matrix columns)numOutputs
- Number of outputs of the function (number of matrix rows)scalarFunction
- Function to apply to each outputpublic GeneralizedLinearModel(MultivariateDiscriminant discriminant, VectorFunction squashingFunction)
discriminant
- GradientDescendable that multiplies an input by the internal matrixsquashingFunction
- VectorFunction that is applied to the output of the matrix multiplypublic GeneralizedLinearModel(GeneralizedLinearModel other)
other
- GeneralizedLinearModel to copypublic GeneralizedLinearModel(MultivariateDiscriminant matrixMultiply, UnivariateScalarFunction scalarSquashingFunction)
matrixMultiply
- GradientDescendable that multiplies an input by the internal matrixscalarSquashingFunction
- scalar function that is applied to the output of the matrix multiplypublic MultivariateDiscriminant getDiscriminant()
public void setDiscriminant(MultivariateDiscriminant discriminant)
discriminant
- GradientDescendable that multiplies an input by the internal matrixpublic VectorFunction getSquashingFunction()
public void setSquashingFunction(VectorFunction squashingFunction)
squashingFunction
- VectorFunction that is applied to the output of the matrix multiplypublic Vector convertToVector()
Vectorizable
convertToVector
in interface Vectorizable
public void convertFromVector(Vector parameters)
Vectorizable
convertFromVector
in interface Vectorizable
parameters
- The parameters to incorporate.public Vector evaluate(Vector input)
Evaluator
public GeneralizedLinearModel 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 Vectorizable
clone
in interface VectorizableVectorFunction
clone
in interface CloneableSerializable
clone
in class AbstractCloneableSerializable
public java.lang.String toString()
toString
in class java.lang.Object
public int getInputDimensionality()
VectorInputEvaluator
getInputDimensionality
in interface VectorInputEvaluator<Vector,Vector>
public int getOutputDimensionality()
VectorOutputEvaluator
getOutputDimensionality
in interface VectorOutputEvaluator<Vector,Vector>