public class VectorInstance
extends java.lang.Object
implements java.io.Serializable
Constructor and Description |
---|
VectorInstance(Array values,
java.util.List<FieldRef> vectorFields)
Constructor
|
VectorInstance(org.w3c.dom.Element vecElement,
java.util.List<FieldRef> vectorFields)
Constructor
|
Modifier and Type | Method and Description |
---|---|
double |
dotProduct(double[] other)
Computes the dot product between this vector instance and the
supplied array of values
|
double |
dotProduct(VectorInstance other)
Computes the dot product between this vector instance and the
argument
|
java.lang.String |
getID()
Get the ID of this vector instance
|
Array |
getValues()
Get the Array of values encapsulated in this vector instance
|
java.util.List<FieldRef> |
getVectorFields()
Get the mining fields that are indexed by this vector instance
|
VectorInstance |
subtract(double[] other)
Subtract the values in the supplied array from this vector instance
|
VectorInstance |
subtract(VectorInstance other)
Subtract the supplied VectorInstance from this one and return the
result as a new VectorInstance
|
public VectorInstance(Array values, java.util.List<FieldRef> vectorFields)
values
- the Array of values for this vector instancevectorFields
- the mining fields indexed by this vector instancepublic VectorInstance(org.w3c.dom.Element vecElement, java.util.List<FieldRef> vectorFields) throws java.lang.Exception
vecElement
- PMML element containing this vector instancevectorFields
- the mining fields indexed by this vector instancejava.lang.Exception
- if something goes wrongpublic java.lang.String getID()
public Array getValues()
public java.util.List<FieldRef> getVectorFields()
public VectorInstance subtract(double[] other) throws java.lang.Exception
other
- an array of valuesjava.lang.Exception
- if something goes wrongpublic VectorInstance subtract(VectorInstance other) throws java.lang.Exception
other
- the vector instance to subtractjava.lang.Exception
- if something goes wrongpublic double dotProduct(VectorInstance other) throws java.lang.Exception
other
- the vector instance to perform the dot product withjava.lang.Exception
- if something goes wrongpublic double dotProduct(double[] other) throws java.lang.Exception
other
- an array of values to perform the dot product withjava.lang.Exception
- if something goes wrong