de.lmu.ifi.dbs.elki.database.relation.Relation类的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(6.2k)|赞(0)|评价(0)|浏览(120)

本文整理了Java中de.lmu.ifi.dbs.elki.database.relation.Relation类的一些代码示例,展示了Relation类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Relation类的具体详情如下:
包路径:de.lmu.ifi.dbs.elki.database.relation.Relation
类名称:Relation

Relation介绍

[英]An object representation from a database.
[中]数据库中的对象表示。

代码示例

代码示例来源:origin: elki-project/elki

/**
 * Get the dimensionality of a vector field.
 *
 * @param relation Relation
 * @return Dimensionality
 */
private static int dimensionality(Relation<ParameterizationFunction> relation) {
 return relation.get(relation.iterDBIDs()).getDimensionality();
}

代码示例来源:origin: elki-project/elki

/**
 * Constructor.
 * 
 * @param rel Relation
 */
public SamplingResult(Relation<?> rel) {
 super();
 sample = rel.getDBIDs();
}

代码示例来源:origin: elki-project/elki

@Override
 public int size() {
  return db.size();
 }
}

代码示例来源:origin: elki-project/elki

@Override
public void initialize() {
 super.initialize();
 List<MkAppEntry> objs = new ArrayList<>(relation.size());
 for(DBIDIter iter = relation.iterDBIDs(); iter.valid(); iter.advance()) {
  DBID id = DBIDUtil.deref(iter);
  final O object = relation.get(id);
  objs.add(createNewLeafEntry(id, object, Double.NaN));
 }
 insertAll(objs);
}

代码示例来源:origin: elki-project/elki

@Override
public O get(DBIDRef id) {
 assert(idview.contains(id)) : "Accessing object not included in view.";
 return inner.get(id);
}

代码示例来源:origin: elki-project/elki

/**
 * Simplified constructor.
 *
 * @param database Database
 */
public RelationObjectIterator(Relation<? extends O> database) {
 super();
 this.database = database;
 this.iter = database.iterDBIDs();
}

代码示例来源:origin: elki-project/elki

@Override
protected void preprocess() {
 createStorage();
 materialized_RkNN = DataStoreUtil.makeStorage(relation.getDBIDs(), DataStoreFactory.HINT_HOT, TreeSet.class);
 FiniteProgress progress = LOG.isVerbose() ? new FiniteProgress("Materializing k nearest neighbors and reverse k nearest neighbors (k=" + k + ")", relation.size(), getLogger()) : null;
 materializeKNNAndRKNNs(DBIDUtil.ensureArray(relation.getDBIDs()), progress);
}

代码示例来源:origin: elki-project/elki

@Override
public void initialize() {
 sorted = DBIDUtil.newDistanceDBIDList(relation.size());
 dims = RelationUtil.dimensionality(relation);
 for(DBIDIter it = relation.iterDBIDs(); it.valid(); it.advance()) {
  sorted.add(Double.NaN, it);
 }
 buildTree(0, sorted.size(), 0, sorted.iter());
}

代码示例来源:origin: elki-project/elki

@Override
public <T extends O> AffinityMatrix computeAffinityMatrix(Relation<T> relation, double initialScale) {
 DistanceQuery<T> dq = relation.getDistanceQuery(distanceFunction);
 ArrayDBIDs ids = DBIDUtil.ensureArray(relation.getDBIDs());
 // Compute desired affinities.
 double[][] dist = buildDistanceMatrix(ids, dq);
 return new DenseAffinityMatrix(computePij(dist, sigma, initialScale), ids);
}

代码示例来源:origin: elki-project/elki

@Override
public SimpleTypeInformation<O> getDataTypeInformation() {
 return inner.getDataTypeInformation();
}

代码示例来源:origin: elki-project/elki

/**
 * Constructor with preprocessing step.
 *
 * @param relation Relation to preprocess
 * @param distanceFunction the distance function to use
 * @param k query k
 */
public MaterializeKNNPreprocessor(Relation<O> relation, DistanceFunction<? super O> distanceFunction, int k) {
 super(relation, distanceFunction, k);
 this.knnQuery = relation.getKNNQuery(distanceQuery, k, DatabaseQuery.HINT_BULK, DatabaseQuery.HINT_HEAVY_USE, DatabaseQuery.HINT_NO_CACHE);
}

代码示例来源:origin: elki-project/elki

@Override
public <O> DistanceQuery<O> getDistanceQuery(Relation<O> objQuery, DistanceFunction<? super O> distanceFunction, Object... hints) {
 return objQuery.getDistanceQuery(distanceFunction, hints);
}

代码示例来源:origin: elki-project/elki

@Override
public void initialize() {
 super.initialize();
 List<MkCoPEntry> objs = new ArrayList<>(relation.size());
 for(DBIDIter iter = relation.iterDBIDs(); iter.valid(); iter.advance()) {
  DBID id = DBIDUtil.deref(iter); // FIXME: expensive
  final O object = relation.get(id);
  objs.add(createNewLeafEntry(id, object, Double.NaN));
 }
 insertAll(objs);
}

代码示例来源:origin: elki-project/elki

@Override
protected Element makeTooltip(DBIDRef id, double x, double y, double dotsize) {
 final Object data = result.get(id);
 String label = (data == null) ? "null" : data.toString();
 label = (label.isEmpty() || label == null) ? "null" : label;
 return svgp.svgText(x + dotsize, y + fontsize * 0.07, label);
}

代码示例来源:origin: elki-project/elki

@Override
public void getRangeForObject(O obj, double range, ModifiableDoubleDBIDList neighbors) {
 final Relation<? extends O> relation = getRelation();
 linearScan(relation, relation.iterDBIDs(), obj, range, neighbors);
}

代码示例来源:origin: de.lmu.ifi.dbs.elki/elki-index-preprocessed

@Override
protected void preprocess() {
 createStorage();
 materialized_RkNN = DataStoreUtil.makeStorage(relation.getDBIDs(), DataStoreFactory.HINT_HOT, TreeSet.class);
 FiniteProgress progress = LOG.isVerbose() ? new FiniteProgress("Materializing k nearest neighbors and reverse k nearest neighbors (k=" + k + ")", relation.size(), getLogger()) : null;
 materializeKNNAndRKNNs(DBIDUtil.ensureArray(relation.getDBIDs()), progress);
}

代码示例来源:origin: de.lmu.ifi.dbs.elki/elki-index-various

@Override
public void initialize() {
 sorted = DBIDUtil.newDistanceDBIDList(relation.size());
 dims = RelationUtil.dimensionality(relation);
 for(DBIDIter it = relation.iterDBIDs(); it.valid(); it.advance()) {
  sorted.add(Double.NaN, it);
 }
 buildTree(0, sorted.size(), 0, sorted.iter());
}

代码示例来源:origin: elki-project/elki

@Override
public <T extends O> AffinityMatrix computeAffinityMatrix(Relation<T> relation, double initialScale) {
 DistanceQuery<T> dq = relation.getDistanceQuery(distanceFunction);
 ArrayDBIDs ids = DBIDUtil.ensureArray(relation.getDBIDs());
 // Compute desired affinities.
 double[][] dist = buildDistanceMatrix(ids, dq);
 return new DenseAffinityMatrix(computePij(dist, perplexity, initialScale), ids);
}

代码示例来源:origin: de.lmu.ifi.dbs.elki/elki

@Override
public SimpleTypeInformation<O> getDataTypeInformation() {
 return inner.getDataTypeInformation();
}

代码示例来源:origin: de.lmu.ifi.dbs.elki/elki-index-preprocessed

/**
 * Constructor with preprocessing step.
 *
 * @param relation Relation to preprocess
 * @param distanceFunction the distance function to use
 * @param k query k
 */
public MaterializeKNNPreprocessor(Relation<O> relation, DistanceFunction<? super O> distanceFunction, int k) {
 super(relation, distanceFunction, k);
 this.knnQuery = relation.getKNNQuery(distanceQuery, k, DatabaseQuery.HINT_BULK, DatabaseQuery.HINT_HEAVY_USE, DatabaseQuery.HINT_NO_CACHE);
}

相关文章