Package com.tibco.patterns.learn.training

## Class VectorExperiment

- java.lang.Object
- - com.tibco.patterns.learn.training.RLinkExperiment<VectorExample>
  - - com.tibco.patterns.learn.training.VectorExperiment

-     public final class VectorExperiment
      extends RLinkExperiment<VectorExample>

  Manages a training dataset and a validation dataset. The datasets consist of VectorExample objects that store feature vectors.

- - ### Field Summary

    - ### Fields inherited from class com.tibco.patterns.learn.training.RLinkExperiment

      `trainSet, vldSet`

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `VectorExperiment​(int nFeatures, double vldProportion)` | Creates an experiment with two empty datasets and a new random number generator.
    `VectorExperiment​(int nFeatures, double vldProportion, java.util.Random rnd)` | Creates an experiment with two empty datasets.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `boolean` | `add​(VectorExample e)` | Randomly adds the example to one of the datasets, preserving dataset proportions.

    - ### Methods inherited from class com.tibco.patterns.learn.training.RLinkExperiment

      `clearPredictions, getAllExamples, getNFeatures, getTrainSet, getVldSet`

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

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

- - ### Constructor Detail

    - #### VectorExperiment

          public VectorExperiment​(int nFeatures,
                                  double vldProportion,
                                  java.util.Random rnd)

      Creates an experiment with two empty datasets.
      Parameters:
        `nFeatures` - - number of model features in each example of this experiment
        `vldProportion` - - the approximate percentage of examples in validation dataset
        `rnd` - - the random number generator to use when choosing a dataset. Not null.
      Throws:
        `java.lang.IllegalArgumentException` - if vldProportion is not in interval [0.0, 1.0)

    - #### VectorExperiment

          public VectorExperiment​(int nFeatures,
                                  double vldProportion)

      Creates an experiment with two empty datasets and a new random number generator.
      Parameters:
        `nFeatures` - - number of model features in each example of this experiment
        `vldProportion` - - the approximate percentage of examples in validation dataset
      Throws:
        `java.lang.IllegalArgumentException` - if vldProportion is not in interval [0.0, 1.0)

  - ### Method Detail

    - #### add

          public boolean add​(VectorExample e)

      Randomly adds the example to one of the datasets, preserving dataset proportions. Not needed for RecPairExperiment, as record pairs are added to the XML structure instead.
      Parameters:
        `e` - - the example to be added.
      Returns:
        true if the example was added to the training dataset.
      Throws:
        `java.lang.IllegalArgumentException` - if number of features in the given example does not match the number of features for this experiment.