Class RLinkExperiment<T extends VectorExample>

  • Direct Known Subclasses:
    RecPairExperiment, VectorExperiment

    public abstract class RLinkExperiment<T extends VectorExample>
    extends java.lang.Object
    Manages all data required for a model training experiment: training and validation datasets.
    • Constructor Detail

      • RLinkExperiment

        protected RLinkExperiment​(RLinkDataSet<T> trainSet,
                                  RLinkDataSet<T> vldSet)
        Creates the experiment that contains the two given datasets. Use from subclasses and pass two datasets of the appropriate subtype of RLinkDataSet.
        Throws:
        java.lang.NullPointerException - if either dataset is null
      • RLinkExperiment

        protected RLinkExperiment​(RLinkDataSet<T> allExamples,
                                  double vldProportion)
        Creates experiment with validation dataset randomly split from allExamples according to vldProportion.
        Parameters:
        vldProportion - - the approximate percentage of examples in validation dataset
        Throws:
        java.lang.NullPointerException - if the given dataset is null
        java.lang.IllegalArgumentException - if vldProportion is not in interval [0.0, 1.0)
    • Method Detail

      • getTrainSet

        public RLinkDataSet<T> getTrainSet()
        Returns:
        internal reference to the training dataset. Not null.
      • getVldSet

        public RLinkDataSet<T> getVldSet()
        Returns:
        internal reference to the validation dataset. Not null.
      • getAllExamples

        public RLinkDataSet<T> getAllExamples()
        Returns:
        a new dataset with all examples from both training and validation datasets
      • getNFeatures

        public int getNFeatures()
        Returns:
        the number of features in the experiment. If not empty, both training and validation sets must have same number of features.
      • clearPredictions

        public void clearPredictions()
        Clears stored predictions from all examples in both datasets. If dataset(s) in this experiment have been used for training/evaluation earlier, and the convergence observer uses predictions from previous iteration (e.g. COScoreChange), then this method must be called before the first call to Trainer.trainIteration(RLinkExperiment, TrainingObserver, ConvergenceObserver).