whistleClassifier.training
Class TrainingSelector

java.lang.Object
  extended by whistleClassifier.training.TrainingSelector
Direct Known Subclasses:
SequentialTrainingSelector

public abstract class TrainingSelector
extends java.lang.Object

Class containing functions to randomly select suitable groups of training and test data from a TrainingDataCollection

Author:
Doug Gillespie
See Also:
TrainingDataCollection, WhistleFragmenter

Field Summary
private  TrainingDataCollection trainingDataCollection
           
private  WhistleFragmenter whistleFragmenter
           
 
Constructor Summary
TrainingSelector()
           
 
Method Summary
(package private) abstract  int[] createSections(int iSpecies, double trainingFraction, int sectionLength)
          Tell the training selector to create a new (hopefully randomised) set of training and test data for a species.
(package private) abstract  FragmentStore getFragmentStore(boolean training, int iFragmentGroup)
           
 int getNumSpecies()
           
 double[][] getParameterArray(boolean training)
           
(package private) abstract  java.util.List<FragmentStore> getTestStoreList()
           
 int getTotalFragments(int iSpecies)
           
(package private) abstract  int getTotalSections(int iSpecies, int sectionLength)
          Get the total number of training + test sections, each consisting of sectionLength fragments
 TrainingDataCollection getTrainingDataCollection()
          get the training data collection
(package private) abstract  java.util.List<FragmentStore> getTrainingStoreList()
           
 WhistleFragmenter getWhistleFragmenter()
          Get the whistle fragmenter
 void setTrainingDataCollection(TrainingDataCollection trainingDataCollection)
          Sets the training data collection
 void setWhistleFragmenter(WhistleFragmenter whistleFragmenter)
          Set the whistle fragmenter to use.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

trainingDataCollection

private TrainingDataCollection trainingDataCollection

whistleFragmenter

private WhistleFragmenter whistleFragmenter
Constructor Detail

TrainingSelector

public TrainingSelector()
Method Detail

setTrainingDataCollection

public void setTrainingDataCollection(TrainingDataCollection trainingDataCollection)
Sets the training data collection

Parameters:
trainingDataCollection - training data

getTrainingDataCollection

public TrainingDataCollection getTrainingDataCollection()
get the training data collection

Returns:
training data collection

setWhistleFragmenter

public void setWhistleFragmenter(WhistleFragmenter whistleFragmenter)
Set the whistle fragmenter to use.

Parameters:
whistleFragmenter - whistle fragmenter

getWhistleFragmenter

public WhistleFragmenter getWhistleFragmenter()
Get the whistle fragmenter

Returns:
fragmenter

getNumSpecies

public int getNumSpecies()
Returns:

getTotalFragments

public int getTotalFragments(int iSpecies)

getTotalSections

abstract int getTotalSections(int iSpecies,
                              int sectionLength)
Get the total number of training + test sections, each consisting of sectionLength fragments

Parameters:
iSpecies - species index in training set
sectionLength - length of each training or test section
Returns:
number of complete sections

createSections

abstract int[] createSections(int iSpecies,
                              double trainingFraction,
                              int sectionLength)
Tell the training selector to create a new (hopefully randomised) set of training and test data for a species.

It does not actually have to create the data sets at the moment - if it want's to save memory it can set up appropriate data structures to define what the sets are and then create them when they are asked for later. Whether or not this is possible may depend on the type of randomisation and grouping employed in the concrete class.

Parameters:
trainingFraction - fraction of data to be used in training (usually 2/3)
Returns:
a two element array giving the number of test and the number of training sections

getFragmentStore

abstract FragmentStore getFragmentStore(boolean training,
                                        int iFragmentGroup)

getParameterArray

public double[][] getParameterArray(boolean training)

getTestStoreList

abstract java.util.List<FragmentStore> getTestStoreList()

getTrainingStoreList

abstract java.util.List<FragmentStore> getTrainingStoreList()