@Beta public final class BootstrapInspector<ObsT,SummaryT> extends Object implements Inspector<ObsT>
BootstrapInspector.ObservationSummarizer
and one or more ways of aggregating a collection of collections of summaries into a final output
(a BootstrapInspector.SummaryAggregator.
The bootstrap inspector will apply the ObservationSummarizer to each item it observes and
remember the result. When it is finish()ed, it will then take a specified number of
samples with replacement from the collection of summaries. Each of these samples will be
presented to the SummaryAggregators. Finally, each SummaryAggregator's finish() method will be called to produce final output.
To make an example concrete, your ObservationSummarizer could produce the true positive,
false positive, and false negative counts for some classification task on a document. The
aggregator could sum these of the corpus and create a corpus-wide F-measure and then output the
mean and standard deviation of these F-measures. This would give you some idea how robust your
F-measure is with respect to the corpus composition.
If you don't know how many samples to use, we suggest 1000 as a reasonable default.| Modifier and Type | Class and Description |
|---|---|
static interface |
BootstrapInspector.BootstrapStrategy<ObsT,SummaryT> |
static class |
BootstrapInspector.Builder<ObsT,SummaryT> |
static interface |
BootstrapInspector.ObservationSummarizer<ObsT,SummaryT>
A strategy for reducing a pair observation to a some sort of summary we can later bootstrap
sample over.
|
static interface |
BootstrapInspector.SummaryAggregator<SummaryT>
A strategy of aggregating bootstrap samples into some sort of final output.
|
| Modifier and Type | Method and Description |
|---|---|
void |
finish() |
static <ObsT,SummaryT> |
forStrategy(BootstrapInspector.BootstrapStrategy<ObsT,SummaryT> strategy,
int numSamples,
Random rng) |
static <ObsT,SummaryT> |
forSummarizer(BootstrapInspector.ObservationSummarizer<? super ObsT,? extends SummaryT> observationSummarizer,
int numSamples,
Random rng) |
void |
inspect(ObsT item) |
public void finish()
throws IOException
finish in interface FinishableIOExceptionpublic static <ObsT,SummaryT> BootstrapInspector.Builder<ObsT,SummaryT> forSummarizer(BootstrapInspector.ObservationSummarizer<? super ObsT,? extends SummaryT> observationSummarizer, int numSamples, Random rng)
public static <ObsT,SummaryT> BootstrapInspector<ObsT,SummaryT> forStrategy(BootstrapInspector.BootstrapStrategy<ObsT,SummaryT> strategy, int numSamples, Random rng)
Copyright © 2016. All rights reserved.