Class VectorDictionary

java.lang.Object
weka.core.pmml.VectorDictionary
All Implemented Interfaces:
Serializable

public class VectorDictionary extends Object implements Serializable
Class encapsulating the PMML VectorDictionary construct.
Version:
$Revision: 8034 $
Author:
Mark Hall (mhall{[at]}pentaho{[dot]}com)
See Also:
  • Constructor Details

    • VectorDictionary

      public VectorDictionary(Element vectNode, MiningSchema ms) throws Exception
      Constructor.
      Parameters:
      vectNode - the XML containing the VectorDictionary
      ms - 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 XML
      ms - the mining schema
      Returns:
      a VectorDictionary
      Throws:
      Exception - if the VectorDictionary can't be read from the XML container
    • incomingInstanceToVectorFieldVals

      public double[] incomingInstanceToVectorFieldVals(double[] incoming) throws Exception
      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

      public VectorInstance getVector(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