|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgov.sandia.cognition.util.AbstractCloneableSerializable
gov.sandia.cognition.learning.function.kernel.DefaultKernelContainer<InputType>
gov.sandia.cognition.learning.function.scalar.KernelScalarFunction<InputType>
InputType
- The type of the input to the function.
For example, Vector.public class KernelScalarFunction<InputType>
The KernelScalarFunction
class implements a scalar function that
uses a kernel to compute its output value. It is parameterized by a kernel
function, a list of examples and their weights, and a bias term. This types
of scalar function represents what is learned by algorithms such as
Support Vector Regression.
Field Summary | |
---|---|
protected double |
bias
The bias term. |
static double |
DEFAULT_BIAS
The default value for the bias is 0.0. |
protected Collection<? extends WeightedValue<? extends InputType>> |
examples
The list of weighted examples that are used for categorization. |
Fields inherited from class gov.sandia.cognition.learning.function.kernel.DefaultKernelContainer |
---|
kernel |
Constructor Summary | |
---|---|
KernelScalarFunction()
Creates a new instance of KernelScalarFunction. |
|
KernelScalarFunction(Kernel<? super InputType> kernel)
Creates a new instance of KernelScalarFunction with the given kernel. |
|
KernelScalarFunction(Kernel<? super InputType> kernel,
Collection<? extends WeightedValue<? extends InputType>> examples,
double bias)
Creates a new instance of KernelScalarFunction with the given kernel, weighted examples, and bias. |
|
KernelScalarFunction(KernelScalarFunction<InputType> other)
Creates a new copy of a KernelScalarFunction. |
Method Summary | |
---|---|
Double |
evaluate(InputType input)
Evaluates the given input vector as a double by: sum w_i * k(input, x_i) |
double |
evaluateAsDouble(InputType input)
Evaluates the given input vector as a double by: sum w_i * k(input, x_i) |
double |
getBias()
Gets the bias term. |
Collection<? extends WeightedValue<? extends InputType>> |
getExamples()
Gets the list of weighted examples that categorizer is using. |
void |
setBias(double bias)
Sets the bias term. |
void |
setExamples(Collection<? extends WeightedValue<? extends InputType>> examples)
Sets the list of weighted examples that categorizer is using. |
Methods inherited from class gov.sandia.cognition.learning.function.kernel.DefaultKernelContainer |
---|
clone, getKernel, setKernel |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final double DEFAULT_BIAS
protected Collection<? extends WeightedValue<? extends InputType>> examples
protected double bias
Constructor Detail |
---|
public KernelScalarFunction()
public KernelScalarFunction(Kernel<? super InputType> kernel)
kernel
- The kernel to use.public KernelScalarFunction(Kernel<? super InputType> kernel, Collection<? extends WeightedValue<? extends InputType>> examples, double bias)
kernel
- The kernel to use.examples
- The weighted examples.bias
- The bias.public KernelScalarFunction(KernelScalarFunction<InputType> other)
other
- The KernelScalarFunction to copy.Method Detail |
---|
public Double evaluate(InputType input)
evaluate
in interface Evaluator<InputType,Double>
input
- The input to categorize.
public double evaluateAsDouble(InputType input)
evaluateAsDouble
in interface ScalarFunction<InputType>
input
- The input to categorize.
public Collection<? extends WeightedValue<? extends InputType>> getExamples()
public void setExamples(Collection<? extends WeightedValue<? extends InputType>> examples)
examples
- The list of weighted examples.public double getBias()
public void setBias(double bias)
bias
- The bias term.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |