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.Serializable

  Class encapsulating the PMML VectorDictionary construct.
  Version:
    $Revision: 8034 $
  Author:
    Mark Hall (mhall{[at]}pentaho{[dot]}com)
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `VectorDictionary(org.w3c.dom.Element vectNode, MiningSchema ms)` Constructor.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `VectorInstance` | `getVector(java.lang.String ID)` Gets a vector from the dictionary corresponding to the supplied ID
    `static VectorDictionary` | `getVectorDictionary(org.w3c.dom.Element container, MiningSchema ms)` Returns a new VectorDictionary constructed from the supplied XML container
    `double[]` | `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

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### VectorDictionary

          public VectorDictionary(org.w3c.dom.Element vectNode,
                                  MiningSchema ms)
                           throws java.lang.Exception

      Constructor.
      Parameters:
        `vectNode` - the XML containing the VectorDictionary
        `ms` - 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 XML
        `ms` - 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.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:
        `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