Package adams.opt.genetic
Class DarkLord
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.opt.genetic.AbstractGeneticAlgorithm
-
- All Implemented Interfaces:
adams.core.Destroyable
,adams.core.GlobalInfoSupporter
,adams.core.logging.LoggingLevelHandler
,adams.core.logging.LoggingSupporter
,adams.core.option.OptionHandler
,adams.core.Pausable
,adams.core.Randomizable
,adams.core.ShallowCopySupporter<adams.opt.genetic.AbstractGeneticAlgorithm>
,adams.core.SizeOfHandler
,adams.core.Stoppable
,adams.core.StoppableWithFeedback
,adams.core.ThreadLimiter
,adams.event.GeneticFitnessChangeNotifier
,Serializable
public class DarkLord extends AbstractClassifierBasedGeneticAlgorithmWithSecondEvaluation
- Author:
- Dale (dale at cs dot waikato dot ac dot nz), FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
DarkLord.DarkLordJob
A job class specific to The Dark Lord.-
Nested classes/interfaces inherited from class adams.opt.genetic.AbstractClassifierBasedGeneticAlgorithmWithSecondEvaluation
AbstractClassifierBasedGeneticAlgorithmWithSecondEvaluation.ClassifierBasedGeneticAlgorithmWithSecondEvaluationJob<T extends AbstractClassifierBasedGeneticAlgorithmWithSecondEvaluation>
-
Nested classes/interfaces inherited from class adams.opt.genetic.AbstractClassifierBasedGeneticAlgorithm
AbstractClassifierBasedGeneticAlgorithm.ClassifierBasedGeneticAlgorithmJob<T extends AbstractClassifierBasedGeneticAlgorithm>
-
-
Field Summary
-
Fields inherited from class adams.opt.genetic.AbstractClassifierBasedGeneticAlgorithmWithSecondEvaluation
m_SecondBestFitness, m_SecondBestSetup, m_SecondBestWeights, m_SecondCrossValidationSeed, m_SecondFolds, m_SecondStoredResults, m_UseSecondEvaluation
-
Fields inherited from class adams.opt.genetic.AbstractClassifierBasedGeneticAlgorithm
m_BitsPerGene, m_Classifier, m_ClassIndex, m_ClassLabelIndex, m_CrossValidationSeed, m_EvaluationPostProcessor, m_FlowContext, m_Folds, m_Generator, m_Instances, m_JobRunner, m_JobRunnerSetup, m_Measure, m_OutputDirectory, m_OutputPrefixType, m_OutputType, m_SetupUpload, m_StoredResults, m_SuppliedPrefix, m_TestInstances, PROPS_FILTER, PROPS_MASK, PROPS_RELATION
-
Fields inherited from class adams.opt.genetic.AbstractGeneticAlgorithm
m_ActualNumChrom, m_BestFitness, m_BestRange, m_BestSetup, m_BestWeights, m_CurrentIteration, m_FavorZeroes, m_Fitness, m_FitnessChangeListeners, m_FitnessHistory, m_Genes, m_InitialSetupsProvider, m_InitialWeights, m_LastNotificationTime, m_MaxFitnessHistorySize, m_NotificationInterval, m_NumChrom, m_NumGenes, m_NumThreads, m_Paused, m_Random, m_Running, m_Seed, m_Stopped, m_StoppingCriterion
-
-
Constructor Summary
Constructors Constructor Description DarkLord()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected OutputType
getDefaultOutputType()
Returns the default output type to use.String
globalInfo()
Returns a string describing the object.protected DarkLord.DarkLordJob
newJob(int chromosome, int[] w, weka.core.Instances data, weka.core.Instances testData)
Creates a new Job instance.protected void
preRun()
Some more initializations.protected adams.core.Properties
storeSetup(weka.core.Instances data, adams.opt.genetic.AbstractGeneticAlgorithm.GeneticAlgorithmJob job)
Generates a Properties file that stores information on the setup of the genetic algorithm.-
Methods inherited from class adams.opt.genetic.AbstractClassifierBasedGeneticAlgorithmWithSecondEvaluation
addSecondResult, clearResults, defineOptions, getSecondCrossValidationSeed, getSecondFolds, getSecondResult, getUseSecondEvaluation, initialize, isSecondBetterFitness, secondCrossValidationSeedTipText, secondFoldsTipText, setSecondCrossValidationSeed, setSecondFolds, setSecondNewFitness, setUseSecondEvaluation, useSecondEvaluationTipText
-
Methods inherited from class adams.opt.genetic.AbstractClassifierBasedGeneticAlgorithm
addResult, bitsPerGeneTipText, calcFitness, classifierTipText, classIndexTipText, classLabelIndexTipText, crossValidationSeedTipText, evaluationPostProcessorTipText, foldsTipText, generatorTipText, getBitsPerGene, getClassifier, getClassIndex, getClassLabelIndex, getCrossValidationSeed, getCurrentFitness, getDefaultClassifier, getEvaluationPostProcessor, getFlowContext, getFolds, getGenerator, getInstances, getJobRunnerSetup, getMeasure, getOutputDirectory, getOutputPrefixType, getOutputType, getResult, getSetupUpload, getSuppliedPrefix, getTestInstances, measureTipText, outputDirectoryTipText, outputPrefixTypeTipText, outputTypeTipText, postRun, setBitsPerGene, setClassifier, setClassIndex, setClassLabelIndex, setCrossValidationSeed, setEvaluationPostProcessor, setFlowContext, setFolds, setGenerator, setInstances, setJobRunnerSetup, setMeasure, setOutputDirectory, setOutputPrefixType, setOutputType, setSetupUpload, setSuppliedPrefix, setTestInstances, setupUploadTipText, stopExecution, suppliedPrefixTipText, toString, updateHeader
-
Methods inherited from class adams.opt.genetic.AbstractGeneticAlgorithm
addFitnessChangeListener, addToFitnessHistory, bestRangeTipText, copyGene, doCrossovers, doMutations, doMutations2, favorZeroesTipText, forCommandLine, forName, getBestRange, getCurrentIteration, getCurrentSetup, getCurrentWeights, getDefaultInitialSetupsProvider, getFavorZeroes, getFitness, getFitnessHistory, getGene, getGeneticAlgorithms, getInitialSetups, getInitialSetupsProvider, getInitialWeights, getMaxFitnessHistorySize, getNotificationInterval, getNumChrom, getNumGenes, getNumThreads, getSeed, getStoppingCriterion, hasMoreZeroes, init, initialSetupsProviderTipText, initialWeightsTipText, isBetterFitness, isPaused, isRunning, isStopped, logChromosomes, maxFitnessHistorySizeTipText, notificationIntervalTipText, notifyFitnessChangeListeners, notifyFitnessChangeListeners, numChromTipText, numThreadsTipText, pauseExecution, removeFitnessChangeListener, reset, resumeExecution, run, runGeneticAlgorithm, seedTipText, setBestRange, setBestRange, setFavorZeroes, setGene, setGene, setInitialSetupsProvider, setInitialWeights, setMaxFitnessHistorySize, setNewFitness, setNotificationInterval, setNumChrom, setNumThreads, setSeed, setStoppingCriterion, shallowCopy, shallowCopy, sort, stoppingCriterionTipText
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, loggingLevelTipText, newOptionManager, setLoggingLevel, toCommandLine
-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
-
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string describing the object.- Specified by:
globalInfo
in interfaceadams.core.GlobalInfoSupporter
- Specified by:
globalInfo
in classadams.core.option.AbstractOptionHandler
- Returns:
- a description suitable for displaying in the gui
-
getDefaultOutputType
protected OutputType getDefaultOutputType()
Returns the default output type to use.- Specified by:
getDefaultOutputType
in classAbstractClassifierBasedGeneticAlgorithm
- Returns:
- the type
-
newJob
protected DarkLord.DarkLordJob newJob(int chromosome, int[] w, weka.core.Instances data, weka.core.Instances testData)
Creates a new Job instance.- Specified by:
newJob
in classAbstractClassifierBasedGeneticAlgorithm
- Parameters:
chromosome
- the number of chromosomesw
- the initial weightsdata
- the data to usetestData
- the test data to use, null for cross-validation- Returns:
- the instance
-
storeSetup
protected adams.core.Properties storeSetup(weka.core.Instances data, adams.opt.genetic.AbstractGeneticAlgorithm.GeneticAlgorithmJob job)
Generates a Properties file that stores information on the setup of the genetic algorithm. E.g., it backs up the original relation name. The generated properties file will be used as new relation name for the data.- Overrides:
storeSetup
in classAbstractClassifierBasedGeneticAlgorithm
- Parameters:
data
- the data to create the setup forjob
- the associated job- Returns:
- the generated setup
- See Also:
AbstractClassifierBasedGeneticAlgorithm.PROPS_RELATION
-
preRun
protected void preRun()
Some more initializations.- Overrides:
preRun
in classAbstractClassifierBasedGeneticAlgorithmWithSecondEvaluation
-
-