Class AbstractClassifierBasedGeneticAlgorithmWithSecondEvaluation

    • Field Detail

      • m_UseSecondEvaluation

        protected boolean m_UseSecondEvaluation
        whether to use second evaluation with different seed.
      • m_SecondFolds

        protected int m_SecondFolds
        the number of folds for cross-validation (second evaluation).
      • m_SecondCrossValidationSeed

        protected int m_SecondCrossValidationSeed
        the cross-validation seed (second evaluation).
      • m_SecondStoredResults

        public Hashtable<String,​Double> m_SecondStoredResults
        the cache for results (second evaluation).
      • m_SecondBestFitness

        protected double m_SecondBestFitness
        the best fitness so far (second evaluation).
      • m_SecondBestSetup

        protected Object m_SecondBestSetup
        the best setup so far (second evaluation).
      • m_SecondBestWeights

        protected int[] m_SecondBestWeights
        the best weights/bits so far (second evaluation).
    • Constructor Detail

      • AbstractClassifierBasedGeneticAlgorithmWithSecondEvaluation

        public AbstractClassifierBasedGeneticAlgorithmWithSecondEvaluation()
    • Method Detail

      • setUseSecondEvaluation

        public void setUseSecondEvaluation​(boolean value)
        Sets whether to use the second evaluation.
        Parameters:
        value - true if to use second evaluation
      • getUseSecondEvaluation

        public boolean getUseSecondEvaluation()
        Returns whether to use the second evaluation.
        Returns:
        true if to use second evaluation
      • useSecondEvaluationTipText

        public String useSecondEvaluationTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setSecondFolds

        public void setSecondFolds​(int value)
        Sets the number of folds to use in cross-validation (second evaluation).
        Parameters:
        value - the number of folds
      • getSecondFolds

        public int getSecondFolds()
        Returns the number of folds to use in cross-validation (second evaluation).
        Returns:
        the number of folds
      • secondFoldsTipText

        public String secondFoldsTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setSecondCrossValidationSeed

        public void setSecondCrossValidationSeed​(int value)
        Sets the seed value to use for cross-validation (second evaluation).
        Parameters:
        value - the seed to use
      • getSecondCrossValidationSeed

        public int getSecondCrossValidationSeed()
        Returns the current seed value for cross-validation (second evaluation).
        Returns:
        the seed value
      • secondCrossValidationSeedTipText

        public String secondCrossValidationSeedTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • addSecondResult

        protected void addSecondResult​(String key,
                                       Double val)
        Adds a result to the cache (second evaluation).
        Parameters:
        key - the key of the result
        val - the value to add
      • getSecondResult

        protected Double getSecondResult​(String key)
        Returns a value from the cache (second evaluation).
        Parameters:
        key - the key of the result
        Returns:
        the result or null if not present
      • isSecondBetterFitness

        public boolean isSecondBetterFitness​(double fitness)
        Checks whether the fitness is better (second evaluation).
        Parameters:
        fitness - the new fitness
        Returns:
        true if the new fitness is better
      • setSecondNewFitness

        public boolean setSecondNewFitness​(double fitness,
                                           Object setup,
                                           int chromosome,
                                           int[] weights)
        Sets a fitness and keep it if better (second evaluation).
        Parameters:
        fitness - the new fitness
        setup - the new setup
        chromosome - the chromosome responsible
        weights - the new weights
        Returns:
        true if the new fitness was better