Class ASimplifiedTSClassifier<T>

    • Field Detail

      • classMapper

        protected ClassMapper classMapper
        Class mapper object used to encode and decode predicted values if String values are used as classes. Can be null if the predicted values are not mapped to String values.
      • trained

        protected boolean trained
        Variable indicating whether the classifier has been trained.
    • Constructor Detail

      • ASimplifiedTSClassifier

        public ASimplifiedTSClassifier()
    • Method Detail

      • predict

        public abstract T predict​(double[] univInstance)
                           throws org.api4.java.ai.ml.core.exception.PredictionException
        Performs a prediction based on the given univariate double[] instance representation and returns the result.
        Parameters:
        univInstance - Univariate instance given by a double vector of time series values used for the prediction
        Returns:
        Returns the result of the prediction
        Throws:
        org.api4.java.ai.ml.core.exception.PredictionException - If something fails during the prediction process.
      • predict

        public T predict​(java.util.List<double[]> multivInstance)
                  throws org.api4.java.ai.ml.core.exception.PredictionException
        Performs a prediction based on the given multivariate list of double[] instance representation and returns the result.
        Parameters:
        multivInstance - Multivariate instance given by a list of multiple double[] time series used for the prediction
        Returns:
        Returns the result of the prediction
        Throws:
        org.api4.java.ai.ml.core.exception.PredictionException - If something fails during the prediction process.
      • predict

        public abstract java.util.List<T> predict​(TimeSeriesDataset2 dataset)
                                           throws org.api4.java.ai.ml.core.exception.PredictionException
        Performs predictions based on the given instances in the given dataset.
        Parameters:
        dataset - The TimeSeriesDataset2 for which predictions should be made.
        Returns:
        Returns the result of the predictions
        Throws:
        org.api4.java.ai.ml.core.exception.PredictionException - If something fails during the prediction process
      • train

        public final void train​(TimeSeriesDataset2 dataset)
                         throws org.api4.java.ai.ml.core.exception.TrainingException
        Trains the simplified time series classifier model using the given TimeSeriesDataset2.
        Parameters:
        dataset - The TimeSeriesDataset2 which should be used for the training.
        Throws:
        org.api4.java.ai.ml.core.exception.TrainingException - If something fails during the training process.
      • getClassMapper

        public ClassMapper getClassMapper()
        Getter for the property classMapper.
        Returns:
        Returns the actual class mapper or null if no mapper is stored
      • setClassMapper

        public void setClassMapper​(ClassMapper classMapper)
        Setter for the property classMapper.
        Parameters:
        classMapper - The class mapper to be set
      • isTrained

        public boolean isTrained()
        Returns:
        the trained
      • checkWhetherPredictionIsPossible

        protected double[][] checkWhetherPredictionIsPossible​(TimeSeriesDataset2 dataset)
                                                       throws org.api4.java.ai.ml.core.exception.PredictionException
        Throws:
        org.api4.java.ai.ml.core.exception.PredictionException