Class PredictionDiff<E,​A>

  • All Implemented Interfaces:
    org.api4.java.ai.ml.core.evaluation.IPredictionAndGroundTruthTable<E,​A>
    Direct Known Subclasses:
    TypelessPredictionDiff

    public class PredictionDiff<E,​A>
    extends java.lang.Object
    implements org.api4.java.ai.ml.core.evaluation.IPredictionAndGroundTruthTable<E,​A>
    • Constructor Detail

      • PredictionDiff

        public PredictionDiff()
      • PredictionDiff

        public PredictionDiff​(java.util.List<? extends E> groundTruths,
                              java.util.List<? extends A> predictions)
    • Method Detail

      • addPair

        public void addPair​(E groundTruth,
                            A prediction)
      • getCastedView

        public <E1,​A1> PredictionDiff<E1,​A1> getCastedView​(java.lang.Class<E1> expectedClass,
                                                                       java.lang.Class<A1> actualClass)
        Specified by:
        getCastedView in interface org.api4.java.ai.ml.core.evaluation.IPredictionAndGroundTruthTable<E,​A>
      • size

        public int size()
        Specified by:
        size in interface org.api4.java.ai.ml.core.evaluation.IPredictionAndGroundTruthTable<E,​A>
      • getPrediction

        public A getPrediction​(int instance)
        Specified by:
        getPrediction in interface org.api4.java.ai.ml.core.evaluation.IPredictionAndGroundTruthTable<E,​A>
      • getGroundTruth

        public E getGroundTruth​(int instance)
        Specified by:
        getGroundTruth in interface org.api4.java.ai.ml.core.evaluation.IPredictionAndGroundTruthTable<E,​A>
      • getPredictionsAsList

        public java.util.List<A> getPredictionsAsList()
        Specified by:
        getPredictionsAsList in interface org.api4.java.ai.ml.core.evaluation.IPredictionAndGroundTruthTable<E,​A>
      • getPredictionsAsList

        public <T> java.util.List<T> getPredictionsAsList​(java.lang.Class<T> clazz)
      • getPredictionsAsArray

        public A[] getPredictionsAsArray()
        Specified by:
        getPredictionsAsArray in interface org.api4.java.ai.ml.core.evaluation.IPredictionAndGroundTruthTable<E,​A>
      • getGroundTruthAsList

        public java.util.List<E> getGroundTruthAsList()
        Specified by:
        getGroundTruthAsList in interface org.api4.java.ai.ml.core.evaluation.IPredictionAndGroundTruthTable<E,​A>
      • getGroundTruthAsList

        public <T> java.util.List<T> getGroundTruthAsList​(java.lang.Class<T> clazz)
      • getGroundTruthAsArray

        public E[] getGroundTruthAsArray()
        Specified by:
        getGroundTruthAsArray in interface org.api4.java.ai.ml.core.evaluation.IPredictionAndGroundTruthTable<E,​A>