Package weka.core.pmml
Class VectorDictionary
java.lang.Object
weka.core.pmml.VectorDictionary
- All Implemented Interfaces:
Serializable
Class encapsulating the PMML VectorDictionary construct.
- Version:
- $Revision: 8034 $
- Author:
- Mark Hall (mhall{[at]}pentaho{[dot]}com)
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionGets a vector from the dictionary corresponding to the supplied IDstatic VectorDictionary
getVectorDictionary
(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 Details
-
VectorDictionary
Constructor.- Parameters:
vectNode
- the XML containing the VectorDictionaryms
- the mining schema- Throws:
Exception
- if something goes wrong
-
-
Method Details
-
getVectorDictionary
public static VectorDictionary getVectorDictionary(Element container, MiningSchema ms) throws Exception Returns a new VectorDictionary constructed from the supplied XML container- Parameters:
container
- the containing XMLms
- the mining schema- Returns:
- a VectorDictionary
- Throws:
Exception
- if the VectorDictionary can't be read from the XML container
-
incomingInstanceToVectorFieldVals
Convert 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:
Exception
- if this array cant be constructed for some reason
-
getVector
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
-