InputType - The input type to encode as a unique values in a Vector.public class UniqueBooleanVectorEncoder<InputType> extends AbstractToVectorEncoder<InputType>
| Modifier and Type | Field and Description |
|---|---|
protected DataToVectorEncoder<java.lang.Boolean> |
booleanConverter
The boolean encoder for the equality comparison between each of the
possible values and a given input.
|
protected java.util.List<InputType> |
values
The set of possible unique values.
|
vectorFactory| Constructor and Description |
|---|
UniqueBooleanVectorEncoder(java.util.List<InputType> values,
DataToVectorEncoder<java.lang.Boolean> booleanConverter)
Creates a new
UniqueBooleanVectorEncoder. |
| Modifier and Type | Method and Description |
|---|---|
void |
encode(InputType object,
Vector vector,
int startIndex)
Encodes the given object into the given vector at the given starting
index by using a unique boolean encoding, where the given input value is
compared to each of the encoder's values using equality.
|
DataToVectorEncoder<java.lang.Boolean> |
getBooleanConverter()
Gets the boolean converter used to encode the equality comparison
between each of the unique values and a given input.
|
int |
getOutputDimensionality()
Gets the dimensionality of the vector created by this converter, which
is the number of possible values times the size of the boolean encoding.
|
java.util.List<InputType> |
getValues()
Gets the list of unique values that the encoder is to use.
|
protected void |
setBooleanConverter(DataToVectorEncoder<java.lang.Boolean> booleanConverter)
Sets the boolean converter used to encode the equality comparison
between each of the unique values and a given input.
|
protected void |
setValues(java.util.List<InputType> values)
Sets the list of unique values that the encoder is to use.
|
encode, evaluate, getVectorFactory, setVectorFactorycloneprotected java.util.List<InputType> values
protected DataToVectorEncoder<java.lang.Boolean> booleanConverter
public UniqueBooleanVectorEncoder(java.util.List<InputType> values, DataToVectorEncoder<java.lang.Boolean> booleanConverter)
UniqueBooleanVectorEncoder.values - The list of possible values.booleanConverter - The boolean converter for the values.public void encode(InputType object, Vector vector, int startIndex)
object - The object to encode.vector - The vector to encode into.startIndex - The index to start the encoding at.public int getOutputDimensionality()
public java.util.List<InputType> getValues()
protected void setValues(java.util.List<InputType> values)
values - The list of unique values.public DataToVectorEncoder<java.lang.Boolean> getBooleanConverter()
protected void setBooleanConverter(DataToVectorEncoder<java.lang.Boolean> booleanConverter)
booleanConverter - The boolean converter to use.