Converter

dbn.convert

## Class Converter

- java.lang.Object
- - dbn.convert.Converter

-     public abstract class Converter
      extends java.lang.Object

  An abstract class that has some helpful methods to convert `MultiLabelOutput`, `Instance` or `Instances` to double or bipartition vectors or matrixes. It uses the field `threshold` to build the bipartition vectors from a double one. User can change the `threshold` using the appropriate method.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected static double` | `threshold` This field is used by the static methods to convert double vectors in bipartition vectors.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Converter()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static boolean[][]` | `InstancesToBipartionArray(weka.core.Instances instances, int[] indices)` Converts a subset of an `Instances` dataset to a boolean matrix using the `threshold` field.
    `static double[][]` | `InstancesToDoubleMatrix(weka.core.Instances instances, int[] indices)` Converts a subset of an `Instances` dataset to a double matrix.
    `static boolean[]` | `InstanceToBipartition(weka.core.Instance instance, int[] indices)` Converts a subset of an `Instance` to a bipartition using the `threshold` field.
    `static double[]` | `InstanceToDoubleArray(weka.core.Instance instance, int[] indices)` Converts a subset of an `Instance` to a double array.
    `static boolean[][]` | `MultiLabelOutputArrayToBipartitionArray(mulan.classifier.MultiLabelOutput[] Z)` Converts a set of `MultiLabelOutput` instances to a boolean matrix using the `threshold` field.
    `static double[][]` | `MultiLabelOutputArrayToDoubleMatrix(mulan.classifier.MultiLabelOutput[] Z)` Converts a set of `MultiLabelOutput` instances to a double matrix.
    `static boolean[]` | `MultiLabelOutputToBipartition(mulan.classifier.MultiLabelOutput z)` Converts a `MultiLabelOutput` instance to a bipartition using the `threshold` field.
    `static double[]` | `MultiLabelOutputToDoubleArray(mulan.classifier.MultiLabelOutput z)` Converts a `MultiLabelOutput` instance to a double array.
    `static void` | `SetThreshold(double threshold)` Sets the threshold value.

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

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

- - ### Field Detail

    - #### threshold

          protected static double threshold

      This field is used by the static methods to convert double vectors in bipartition vectors.
      Default value is 0.45

  - ### Constructor Detail

    - #### Converter

          public Converter()

  - ### Method Detail

    - #### MultiLabelOutputArrayToBipartitionArray

          public static boolean[][] MultiLabelOutputArrayToBipartitionArray(mulan.classifier.MultiLabelOutput[] Z)

      Converts a set of `MultiLabelOutput` instances to a boolean matrix using the `threshold` field.
      Parameters:
        `Z` - a set of `MultiLabelOutput` instances to be converted
      Returns:
        the boolean matrix of the parameters data.
      Throws:
        `java.lang.NullPointerException`

    - #### MultiLabelOutputArrayToDoubleMatrix

          public static double[][] MultiLabelOutputArrayToDoubleMatrix(mulan.classifier.MultiLabelOutput[] Z)

      Converts a set of `MultiLabelOutput` instances to a double matrix.
      Parameters:
        `Z` - a set of `MultiLabelOutput` instances to be converted
      Returns:
        the double matrix of the parameters data.
      Throws:
        `java.lang.NullPointerException`

    - #### MultiLabelOutputToBipartition

          public static boolean[] MultiLabelOutputToBipartition(mulan.classifier.MultiLabelOutput z)

      Converts a `MultiLabelOutput` instance to a bipartition using the `threshold` field.
      Parameters:
        `z` - a `MultiLabelOutput` instance to be converted
      Returns:
        the bipartition of the parameters data
      Throws:
        `java.lang.NullPointerException`

    - #### MultiLabelOutputToDoubleArray

          public static double[] MultiLabelOutputToDoubleArray(mulan.classifier.MultiLabelOutput z)

      Converts a `MultiLabelOutput` instance to a double array.
      Parameters:
        `z` - a `MultiLabelOutput` instance to be converted
      Returns:
        the double array of the parameters data
      Throws:
        `java.lang.NullPointerException`

    - #### InstancesToBipartionArray

          public static boolean[][] InstancesToBipartionArray(weka.core.Instances instances,
                                              int[] indices)

      Converts a subset of an `Instances` dataset to a boolean matrix using the `threshold` field.
      Parameters:
        `instances` - the `Instances` dataset to be converted
        `indices` - the indices of the subset in each instance
      Returns:
        the boolean matrix of the parameters data.
      Throws:
        `java.lang.NullPointerException`

    - #### InstancesToDoubleMatrix

          public static double[][] InstancesToDoubleMatrix(weka.core.Instances instances,
                                           int[] indices)

      Converts a subset of an `Instances` dataset to a double matrix.
      Parameters:
        `instances` - the `Instances` dataset to be converted
        `indices` - the indices of the subset in each instance
      Returns:
        the double matrix of the parameters data.
      Throws:
        `java.lang.NullPointerException`

    - #### InstanceToBipartition

          public static boolean[] InstanceToBipartition(weka.core.Instance instance,
                                        int[] indices)

      Converts a subset of an `Instance` to a bipartition using the `threshold` field.
      Parameters:
        `instance` - the `Instance` to be converted
        `indices` - the indices of the subset in the `Instance`
      Returns:
        the bipartition of the parameters data
      Throws:
        `java.lang.NullPointerException`

    - #### InstanceToDoubleArray

          public static double[] InstanceToDoubleArray(weka.core.Instance instance,
                                       int[] indices)

      Converts a subset of an `Instance` to a double array.
      Parameters:
        `instance` - the `Instance` to be converted
        `indices` - the indices of the subset in the `Instance`
      Returns:
        the double array of the parameters data
      Throws:
        `java.lang.NullPointerException`

    - #### SetThreshold

          public static void SetThreshold(double threshold)

      Sets the threshold value.
      Parameters:
        `threshold` -