public class BalancedPathFilter extends RandomPathFilter
| Modifier and Type | Field and Description |
|---|---|
protected PathLabelGenerator |
labelGenerator |
protected String[] |
labels |
protected int |
maxLabels |
protected int |
maxPathsPerLabel |
protected int |
minPathsPerLabel |
extensions, maxPaths, random| Constructor and Description |
|---|
BalancedPathFilter(Random random,
PathLabelGenerator labelGenerator,
int maxPathsPerLabel)
Calls
this(random, null, labelGenerator, 0, 0, 0, maxPathsPerLabel). |
BalancedPathFilter(Random random,
PathLabelGenerator labelGenerator,
int maxPaths,
int maxLabels,
int maxPathsPerLabel)
Calls
this(random, extensions, labelGenerator, 0, maxLabels, 0, maxPathsPerLabel). |
BalancedPathFilter(Random random,
String[] extensions,
PathLabelGenerator labelGenerator)
Calls
this(random, extensions, labelGenerator, 0, 0, 0, 0). |
BalancedPathFilter(Random random,
String[] extensions,
PathLabelGenerator labelGenerator,
int maxPathsPerLabel)
Calls
this(random, extensions, labelGenerator, 0, 0, 0, maxPathsPerLabel). |
BalancedPathFilter(Random random,
String[] extensions,
PathLabelGenerator labelGenerator,
int maxLabels,
int maxPathsPerLabel)
Calls
this(random, extensions, labelGenerator, 0, maxLabels, 0, maxPathsPerLabel). |
BalancedPathFilter(Random random,
String[] extensions,
PathLabelGenerator labelGenerator,
int maxPaths,
int maxLabels,
int minPathsPerLabel,
int maxPathsPerLabel,
String... labels)
Constructs an instance of the PathFilter.
|
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
acceptLabel(String name) |
URI[] |
filter(URI[] paths) |
acceptprotected PathLabelGenerator labelGenerator
protected int maxLabels
protected int minPathsPerLabel
protected int maxPathsPerLabel
protected String[] labels
public BalancedPathFilter(Random random, String[] extensions, PathLabelGenerator labelGenerator)
this(random, extensions, labelGenerator, 0, 0, 0, 0).public BalancedPathFilter(Random random, PathLabelGenerator labelGenerator, int maxPathsPerLabel)
this(random, null, labelGenerator, 0, 0, 0, maxPathsPerLabel).public BalancedPathFilter(Random random, String[] extensions, PathLabelGenerator labelGenerator, int maxPathsPerLabel)
this(random, extensions, labelGenerator, 0, 0, 0, maxPathsPerLabel).public BalancedPathFilter(Random random, PathLabelGenerator labelGenerator, int maxPaths, int maxLabels, int maxPathsPerLabel)
this(random, extensions, labelGenerator, 0, maxLabels, 0, maxPathsPerLabel).public BalancedPathFilter(Random random, String[] extensions, PathLabelGenerator labelGenerator, int maxLabels, int maxPathsPerLabel)
this(random, extensions, labelGenerator, 0, maxLabels, 0, maxPathsPerLabel).public BalancedPathFilter(Random random, String[] extensions, PathLabelGenerator labelGenerator, int maxPaths, int maxLabels, int minPathsPerLabel, int maxPathsPerLabel, String... labels)
minPathsPerLabel > 0,
it might return an unbalanced set if the value is larger than the number of
examples available for the label with the minimum amount.random - object to useextensions - of files to keeplabelGenerator - to obtain labels from pathsmaxPaths - max number of paths to return (0 == unlimited)maxLabels - max number of labels to return (0 == unlimited)minPathsPerLabel - min number of paths per labels to returnmaxPathsPerLabel - max number of paths per labels to return (0 == unlimited)labels - of the paths to keep (empty set == keep all paths)protected boolean acceptLabel(String name)
public URI[] filter(URI[] paths)
filter in interface PathFilterfilter in class RandomPathFilterCopyright © 2017. All rights reserved.