Package weka.core.pmml
Class VectorInstance
- java.lang.Object
-
- weka.core.pmml.VectorInstance
-
- All Implemented Interfaces:
java.io.Serializable
public class VectorInstance extends java.lang.Object implements java.io.SerializableClass encapsulating a PMML VectorInstance construct- Version:
- $Revision: 8034 $
- Author:
- Mark Hall (mhall{[at]}pentaho{[dot]}com)
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description VectorInstance(org.w3c.dom.Element vecElement, java.util.List<FieldRef> vectorFields)ConstructorVectorInstance(Array values, java.util.List<FieldRef> vectorFields)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description doubledotProduct(double[] other)Computes the dot product between this vector instance and the supplied array of valuesdoubledotProduct(VectorInstance other)Computes the dot product between this vector instance and the argumentjava.lang.StringgetID()Get the ID of this vector instanceArraygetValues()Get the Array of values encapsulated in this vector instancejava.util.List<FieldRef>getVectorFields()Get the mining fields that are indexed by this vector instanceVectorInstancesubtract(double[] other)Subtract the values in the supplied array from this vector instanceVectorInstancesubtract(VectorInstance other)Subtract the supplied VectorInstance from this one and return the result as a new VectorInstance
-
-
-
Constructor Detail
-
VectorInstance
public VectorInstance(Array values, java.util.List<FieldRef> vectorFields)
Constructor- Parameters:
values- the Array of values for this vector instancevectorFields- the mining fields indexed by this vector instance
-
VectorInstance
public VectorInstance(org.w3c.dom.Element vecElement, java.util.List<FieldRef> vectorFields) throws java.lang.ExceptionConstructor- Parameters:
vecElement- PMML element containing this vector instancevectorFields- the mining fields indexed by this vector instance- Throws:
java.lang.Exception- if something goes wrong
-
-
Method Detail
-
getID
public java.lang.String getID()
Get the ID of this vector instance- Returns:
- the ID of this vector instance
-
getValues
public Array getValues()
Get the Array of values encapsulated in this vector instance- Returns:
- the Array of values encapsulated in this vector instance
-
getVectorFields
public java.util.List<FieldRef> getVectorFields()
Get the mining fields that are indexed by this vector instance- Returns:
- the mining fields that are indexed by this vector instance
-
subtract
public VectorInstance subtract(double[] other) throws java.lang.Exception
Subtract the values in the supplied array from this vector instance- Parameters:
other- an array of values- Returns:
- a new VectorInstance containing the result of the subtraction
- Throws:
java.lang.Exception- if something goes wrong
-
subtract
public VectorInstance subtract(VectorInstance other) throws java.lang.Exception
Subtract the supplied VectorInstance from this one and return the result as a new VectorInstance- Parameters:
other- the vector instance to subtract- Returns:
- a new VectorInstance containing the result of the subtraction
- Throws:
java.lang.Exception- if something goes wrong
-
dotProduct
public double dotProduct(VectorInstance other) throws java.lang.Exception
Computes the dot product between this vector instance and the argument- Parameters:
other- the vector instance to perform the dot product with- Returns:
- the dot product of this and the supplied vector instance
- Throws:
java.lang.Exception- if something goes wrong
-
dotProduct
public double dotProduct(double[] other) throws java.lang.ExceptionComputes the dot product between this vector instance and the supplied array of values- Parameters:
other- an array of values to perform the dot product with- Returns:
- the dot product of this vector instance with the argument
- Throws:
java.lang.Exception- if something goes wrong
-
-