Class 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.
    • 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.