use of de.lmu.ifi.dbs.elki.result.SamplingResult in project elki by elki-project.
the class VisualizerParameterizer method newContext.
/**
* Make a new visualization context
*
* @param hier Result hierarchy
* @param start Starting result
* @return New context
*/
public VisualizerContext newContext(ResultHierarchy hier, Result start) {
Collection<Relation<?>> rels = ResultUtil.filterResults(hier, Relation.class);
for (Relation<?> rel : rels) {
if (samplesize == 0) {
continue;
}
if (!ResultUtil.filterResults(hier, rel, SamplingResult.class).isEmpty()) {
continue;
}
if (rel.size() > samplesize) {
SamplingResult sample = new SamplingResult(rel);
sample.setSample(DBIDUtil.randomSample(sample.getSample(), samplesize, rnd));
ResultUtil.addChildResult(rel, sample);
}
}
return new VisualizerContext(hier, start, stylelib, factories);
}
Aggregations