Class EvaluationSplit

    • Constructor Summary

      Constructors 
      Constructor Description
      EvaluationSplit​(de.jungblut.math.DoubleVector[] trainFeatures, de.jungblut.math.DoubleVector[] trainOutcome, de.jungblut.math.DoubleVector[] testFeatures, de.jungblut.math.DoubleVector[] testOutcome)
      Sets a split internally.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static EvaluationSplit create​(de.jungblut.math.DoubleVector[] features, de.jungblut.math.DoubleVector[] outcome, float splitFraction, boolean random)
      Creates a new evaluation split.
      static EvaluationSplit createStratified​(de.jungblut.math.DoubleVector[] features, de.jungblut.math.DoubleVector[] outcome, float splitFraction, boolean random)
      Creates a new stratified evaluation split.
      de.jungblut.math.DoubleVector[] getTestFeatures()  
      de.jungblut.math.DoubleVector[] getTestOutcome()  
      de.jungblut.math.DoubleVector[] getTrainFeatures()  
      de.jungblut.math.DoubleVector[] getTrainOutcome()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • EvaluationSplit

        public EvaluationSplit​(de.jungblut.math.DoubleVector[] trainFeatures,
                               de.jungblut.math.DoubleVector[] trainOutcome,
                               de.jungblut.math.DoubleVector[] testFeatures,
                               de.jungblut.math.DoubleVector[] testOutcome)
        Sets a split internally.
    • Method Detail

      • getTrainFeatures

        public de.jungblut.math.DoubleVector[] getTrainFeatures()
      • getTrainOutcome

        public de.jungblut.math.DoubleVector[] getTrainOutcome()
      • getTestFeatures

        public de.jungblut.math.DoubleVector[] getTestFeatures()
      • getTestOutcome

        public de.jungblut.math.DoubleVector[] getTestOutcome()
      • create

        public static EvaluationSplit create​(de.jungblut.math.DoubleVector[] features,
                                             de.jungblut.math.DoubleVector[] outcome,
                                             float splitFraction,
                                             boolean random)
        Creates a new evaluation split.
        Parameters:
        features - the features of your classifier.
        outcome - the target variables of the classifier.
        splitFraction - a value between 0f and 1f that sets the size of the trainingset. With 1k items, a splitPercentage of 0.9f will result in 900 items to train and 100 to evaluate.
        random - true if data needs shuffling before.
        Returns:
        a new EvaluationSplit.
      • createStratified

        public static EvaluationSplit createStratified​(de.jungblut.math.DoubleVector[] features,
                                                       de.jungblut.math.DoubleVector[] outcome,
                                                       float splitFraction,
                                                       boolean random)
        Creates a new stratified evaluation split. Sampling is done based on the max index of the outcome classes (assumes one-hot encoding, or zero/one encoding for binary classes). This class does not keep the relation of the original outcome vectors to their features, thus every mutual information stored for both should be included in the feature vector.
        Parameters:
        features - the features of your classifier.
        outcome - the target variables of the classifier.
        splitFraction - a value between 0f and 1f that sets the size of the trainingset. With 1k items, a splitPercentage of 0.9f will result in 900 items to train and 100 to evaluate.
        random - true if data needs shuffling before.
        Returns:
        a new EvaluationSplit.