Package weka.core.pmml
Class VectorDictionary
- java.lang.Object
-
- weka.core.pmml.VectorDictionary
-
- All Implemented Interfaces:
java.io.Serializable
public class VectorDictionary extends java.lang.Object implements java.io.SerializableClass encapsulating the PMML VectorDictionary construct.- Version:
- $Revision: 8034 $
- Author:
- Mark Hall (mhall{[at]}pentaho{[dot]}com)
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description VectorDictionary(org.w3c.dom.Element vectNode, MiningSchema ms)Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description VectorInstancegetVector(java.lang.String ID)Gets a vector from the dictionary corresponding to the supplied IDstatic VectorDictionarygetVectorDictionary(org.w3c.dom.Element container, MiningSchema ms)Returns a new VectorDictionary constructed from the supplied XML containerdouble[]incomingInstanceToVectorFieldVals(double[] incoming)Convert an incoming instance to an array of values that corresponds to the fields referenced by the support vectors in the vector dictionary
-
-
-
Constructor Detail
-
VectorDictionary
public VectorDictionary(org.w3c.dom.Element vectNode, MiningSchema ms) throws java.lang.ExceptionConstructor.- Parameters:
vectNode- the XML containing the VectorDictionaryms- the mining schema- Throws:
java.lang.Exception- if something goes wrong
-
-
Method Detail
-
getVectorDictionary
public static VectorDictionary getVectorDictionary(org.w3c.dom.Element container, MiningSchema ms) throws java.lang.Exception
Returns a new VectorDictionary constructed from the supplied XML container- Parameters:
container- the containing XMLms- the mining schema- Returns:
- a VectorDictionary
- Throws:
java.lang.Exception- if the VectorDictionary can't be read from the XML container
-
incomingInstanceToVectorFieldVals
public double[] incomingInstanceToVectorFieldVals(double[] incoming) throws java.lang.ExceptionConvert an incoming instance to an array of values that corresponds to the fields referenced by the support vectors in the vector dictionary- Parameters:
incoming- an incoming instance- Returns:
- an array of values from the incoming instance that corresponds to just the fields referenced by the support vectors
- Throws:
java.lang.Exception- if this array cant be constructed for some reason
-
getVector
public VectorInstance getVector(java.lang.String ID)
Gets a vector from the dictionary corresponding to the supplied ID- Parameters:
ID- the ID of the vector to retrieve- Returns:
- the vector with the given ID or null if no vector with that ID exists in the dictionary
-
-