InputType
- The input type for the categorizer.public class DefaultKernelBinaryCategorizer<InputType> extends KernelBinaryCategorizer<InputType,DefaultWeightedValue<InputType>>
KernelBinaryCategorizer
that uses
the standard way of representing the examples (supports) using a
DefaultWeightedValue
.bias, DEFAULT_BIAS, examples, kernel
BINARY_CATEGORIES
Constructor and Description |
---|
DefaultKernelBinaryCategorizer()
Creates a new
DefaultKernelBinaryCategorizer with a null kernel,
no examples, and a zero bias. |
DefaultKernelBinaryCategorizer(Kernel<? super InputType> kernel)
Creates a new
DefaultKernelBinaryCategorizer with the given
kernel, no examples, and a zero bias. |
DefaultKernelBinaryCategorizer(Kernel<? super InputType> kernel,
java.util.Collection<DefaultWeightedValue<InputType>> examples,
double bias)
Creates a new
DefaultKernelBinaryCategorizer with the given
parameters. |
Modifier and Type | Method and Description |
---|---|
void |
add(InputType value,
double weight)
Adds a new example of the given value with the given weight.
|
DefaultWeightedValue<InputType> |
get(int i)
Gets the i-th example.
|
int |
getExampleCount()
Returns the number of examples (supports) in the categorizer.
|
DefaultWeightedValue<InputType> |
remove(int i)
Removes the i-th example.
|
evaluateAsDouble, getBias, getExamples, getKernel, getThreshold, setBias, setExamples, setKernel, setThreshold
evaluate, evaluateWithDiscriminant
getCategories
clone
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
evaluateWithDiscriminant
getCategories
clone
public DefaultKernelBinaryCategorizer()
DefaultKernelBinaryCategorizer
with a null kernel,
no examples, and a zero bias.public DefaultKernelBinaryCategorizer(Kernel<? super InputType> kernel)
DefaultKernelBinaryCategorizer
with the given
kernel, no examples, and a zero bias.kernel
- The kernel to use.public DefaultKernelBinaryCategorizer(Kernel<? super InputType> kernel, java.util.Collection<DefaultWeightedValue<InputType>> examples, double bias)
DefaultKernelBinaryCategorizer
with the given
parameters.kernel
- The kernel to use.examples
- The collection of examples to use.bias
- The bias term.public void add(InputType value, double weight)
value
- The value to add.weight
- The weight for the value.public DefaultWeightedValue<InputType> get(int i)
i
- The 0-based index of the example to get.public DefaultWeightedValue<InputType> remove(int i)
i
- The 0-based index of the example to remove.public int getExampleCount()