public class BalancedPathFilter extends RandomPathFilter
Modifier and Type | Field and Description |
---|---|
protected PathLabelGenerator |
labelGenerator |
protected String[] |
labels |
protected long |
maxLabels |
protected long |
maxPathsPerLabel |
protected long |
minPathsPerLabel |
extensions, maxPaths, random
Constructor and Description |
---|
BalancedPathFilter(Random random,
PathLabelGenerator labelGenerator,
long maxPathsPerLabel)
Calls
this(random, null, labelGenerator, 0, 0, 0, maxPathsPerLabel) . |
BalancedPathFilter(Random random,
PathLabelGenerator labelGenerator,
long maxPaths,
long maxLabels,
long 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,
long maxPathsPerLabel)
Calls
this(random, extensions, labelGenerator, 0, 0, 0, maxPathsPerLabel) . |
BalancedPathFilter(Random random,
String[] extensions,
PathLabelGenerator labelGenerator,
long maxLabels,
long maxPathsPerLabel)
Calls
this(random, extensions, labelGenerator, 0, maxLabels, 0, maxPathsPerLabel) . |
BalancedPathFilter(Random random,
String[] extensions,
PathLabelGenerator labelGenerator,
long maxPaths,
long maxLabels,
long minPathsPerLabel,
long maxPathsPerLabel,
String... labels)
Constructs an instance of the PathFilter.
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
acceptLabel(String name) |
URI[] |
filter(URI[] paths) |
accept
protected PathLabelGenerator labelGenerator
protected long maxLabels
protected long minPathsPerLabel
protected long 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, long maxPathsPerLabel)
this(random, null, labelGenerator, 0, 0, 0, maxPathsPerLabel)
.public BalancedPathFilter(Random random, String[] extensions, PathLabelGenerator labelGenerator, long maxPathsPerLabel)
this(random, extensions, labelGenerator, 0, 0, 0, maxPathsPerLabel)
.public BalancedPathFilter(Random random, PathLabelGenerator labelGenerator, long maxPaths, long maxLabels, long maxPathsPerLabel)
this(random, extensions, labelGenerator, 0, maxLabels, 0, maxPathsPerLabel)
.public BalancedPathFilter(Random random, String[] extensions, PathLabelGenerator labelGenerator, long maxLabels, long maxPathsPerLabel)
this(random, extensions, labelGenerator, 0, maxLabels, 0, maxPathsPerLabel)
.public BalancedPathFilter(Random random, String[] extensions, PathLabelGenerator labelGenerator, long maxPaths, long maxLabels, long minPathsPerLabel, long 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 PathFilter
filter
in class RandomPathFilter
Copyright © 2018. All rights reserved.