whistleClassifier.training
Class SequentialTrainingSelector

java.lang.Object
  extended by whistleClassifier.training.TrainingSelector
      extended by whistleClassifier.training.SequentialTrainingSelector

public class SequentialTrainingSelector
extends TrainingSelector

Selects groups of fragments into training / test groups simply by concatonating all the files together from some random start point.

Author:
Doug Gillespie

Field Summary
private  java.util.Random random
           
private  java.util.Vector<FragmentStore> testFragmentStores
           
private  java.util.Vector<FragmentStore> trainingFragmentStores
           
 
Constructor Summary
SequentialTrainingSelector()
           
 
Method Summary
 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.
private  int[] createTrainingSection(TrainingDataGroup trainingDataGroup, double trainingFraction, int sectionLength)
           
private  int fillStores(java.util.Vector<FragmentStore> store, TrainingDataGroup trainingDataGroup, int nStores, int sectionLength, int iContour)
           
 FragmentStore getFragmentStore(boolean training, int iFragmentGroup)
           
(package private)  java.util.List<FragmentStore> getTestStoreList()
           
(package private)  int getTotalSections(int iSpecies, int sectionLength)
          Get the total number of training + test sections, each consisting of sectionLength fragments
(package private)  java.util.List<FragmentStore> getTrainingStoreList()
           
 
Methods inherited from class whistleClassifier.training.TrainingSelector
getNumSpecies, getParameterArray, getTotalFragments, getTrainingDataCollection, getWhistleFragmenter, setTrainingDataCollection, setWhistleFragmenter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

random

private java.util.Random random

trainingFragmentStores

private java.util.Vector<FragmentStore> trainingFragmentStores

testFragmentStores

private java.util.Vector<FragmentStore> testFragmentStores
Constructor Detail

SequentialTrainingSelector

public SequentialTrainingSelector()
Method Detail

getTotalSections

int getTotalSections(int iSpecies,
                     int sectionLength)
Description copied from class: TrainingSelector
Get the total number of training + test sections, each consisting of sectionLength fragments

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

createSections

public int[] createSections(int iSpecies,
                            double trainingFraction,
                            int sectionLength)
Description copied from class: TrainingSelector
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.

Specified by:
createSections in class TrainingSelector
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

createTrainingSection

private int[] createTrainingSection(TrainingDataGroup trainingDataGroup,
                                    double trainingFraction,
                                    int sectionLength)

fillStores

private int fillStores(java.util.Vector<FragmentStore> store,
                       TrainingDataGroup trainingDataGroup,
                       int nStores,
                       int sectionLength,
                       int iContour)

getFragmentStore

public FragmentStore getFragmentStore(boolean training,
                                      int iFragmentGroup)
Specified by:
getFragmentStore in class TrainingSelector

getTrainingStoreList

java.util.List<FragmentStore> getTrainingStoreList()
Specified by:
getTrainingStoreList in class TrainingSelector

getTestStoreList

java.util.List<FragmentStore> getTestStoreList()
Specified by:
getTestStoreList in class TrainingSelector