Class RLinkExperiment<T extends VectorExample>
- java.lang.Object
-
- com.tibco.patterns.learn.training.RLinkExperiment<T>
-
- Direct Known Subclasses:
RecPairExperiment,VectorExperiment
public abstract class RLinkExperiment<T extends VectorExample> extends java.lang.ObjectManages all data required for a model training experiment: training and validation datasets.
-
-
Field Summary
Fields Modifier and Type Field Description protected RLinkDataSet<T>trainSetTraining datasetprotected RLinkDataSet<T>vldSetValidation dataset
-
Constructor Summary
Constructors Modifier Constructor Description protectedRLinkExperiment(RLinkDataSet<T> allExamples, double vldProportion)Creates experiment with validation dataset randomly split from allExamples according to vldProportion.protectedRLinkExperiment(RLinkDataSet<T> trainSet, RLinkDataSet<T> vldSet)Creates the experiment that contains the two given datasets.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclearPredictions()Clears stored predictions from all examples in both datasets.RLinkDataSet<T>getAllExamples()intgetNFeatures()RLinkDataSet<T>getTrainSet()RLinkDataSet<T>getVldSet()
-
-
-
Field Detail
-
trainSet
protected final RLinkDataSet<T extends VectorExample> trainSet
Training dataset
-
vldSet
protected final RLinkDataSet<T extends VectorExample> vldSet
Validation dataset
-
-
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 nulljava.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 toTrainer.trainIteration(RLinkExperiment, TrainingObserver, ConvergenceObserver).
-
-