public class InteractionValueEncoder extends FeatureVectorEncoder
CONTINUOUS_VALUE_HASH_SEED, WORD_LIKE_VALUE_HASH_SEED| Constructor and Description |
|---|
InteractionValueEncoder(String name,
FeatureVectorEncoder encoderOne,
FeatureVectorEncoder encoderTwo) |
| Modifier and Type | Method and Description |
|---|---|
void |
addInteractionToVector(byte[] originalForm1,
byte[] originalForm2,
double weight,
Vector data)
Adds a value to a vector.
|
void |
addInteractionToVector(String original1,
String original2,
double weight,
Vector data)
Adds a value to a vector.
|
void |
addToVector(byte[] originalForm,
double w,
Vector data)
Adds a value to a vector.
|
void |
addToVector(String originalForm,
double w,
Vector data)
Adds a value to a vector.
|
String |
asString(String originalForm)
Converts a value into a form that would help a human understand the internals of how the value
is being interpreted.
|
protected double |
getWeight(byte[] originalForm1,
byte[] originalForm2,
double w) |
protected int |
hashForProbe(byte[] originalForm,
int dataSize,
String name,
int probe)
Provides the unique hash for a particular probe.
|
addToVector, addToVector, bytesForString, getName, getProbes, getWeight, hash, hash, hash, hash, hash, hashesForProbe, isTraceEnabled, setProbes, setTraceDictionary, trace, tracepublic InteractionValueEncoder(String name, FeatureVectorEncoder encoderOne, FeatureVectorEncoder encoderTwo)
public void addToVector(String originalForm, double w, Vector data)
addToVector in class FeatureVectorEncoderoriginalForm - The original form of the first value as a string.data - The vector to which the value should be added.w - The weight to be applied to this feature.public void addToVector(byte[] originalForm,
double w,
Vector data)
addToVector in class FeatureVectorEncoderoriginalForm - The original form of the first value as a byte array.data - The vector to which the value should be added.public void addInteractionToVector(String original1, String original2, double weight, Vector data)
original1 - The original form of the first value as a string.original2 - The original form of the second value as a string.weight - How much to weight this interactiondata - The vector to which the value should be added.public void addInteractionToVector(byte[] originalForm1,
byte[] originalForm2,
double weight,
Vector data)
originalForm1 - The original form of the first value as a byte array.originalForm2 - The original form of the second value as a byte array.weight - How much to weight this interactiondata - The vector to which the value should be added.protected double getWeight(byte[] originalForm1,
byte[] originalForm2,
double w)
public String asString(String originalForm)
asString in class FeatureVectorEncoderoriginalForm - The original form of the value as a string.protected int hashForProbe(byte[] originalForm,
int dataSize,
String name,
int probe)
FeatureVectorEncoderhashForProbe in class FeatureVectorEncoderoriginalForm - The original byte array valuedataSize - The length of the vector being encodedname - The name of the variable being encodedprobe - The probe numberCopyright © 2008–2017 The Apache Software Foundation. All rights reserved.