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<Boolean> |
booleanConverter
The boolean encoder for the equality comparison between each of the
possible values and a given input.
|
protected List<InputType> |
values
The set of possible unique values.
|
vectorFactory| Constructor and Description |
|---|
UniqueBooleanVectorEncoder(List<InputType> values,
DataToVectorEncoder<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<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.
|
List<InputType> |
getValues()
Gets the list of unique values that the encoder is to use.
|
protected void |
setBooleanConverter(DataToVectorEncoder<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(List<InputType> values)
Sets the list of unique values that the encoder is to use.
|
encode, evaluate, getVectorFactory, setVectorFactorycloneprotected DataToVectorEncoder<Boolean> booleanConverter
public UniqueBooleanVectorEncoder(List<InputType> values, DataToVectorEncoder<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 List<InputType> getValues()
protected void setValues(List<InputType> values)
values - The list of unique values.public DataToVectorEncoder<Boolean> getBooleanConverter()
protected void setBooleanConverter(DataToVectorEncoder<Boolean> booleanConverter)
booleanConverter - The boolean converter to use.Copyright © 2006–2019 Sandia National Laboratories. All rights reserved.