本文整理了Java中de.lmu.ifi.dbs.elki.database.relation.Relation.getDBIDs
方法的一些代码示例,展示了Relation.getDBIDs
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Relation.getDBIDs
方法的具体详情如下:
包路径:de.lmu.ifi.dbs.elki.database.relation.Relation
类名称:Relation
方法名:getDBIDs
[英]Get the IDs the query is defined for. If possible, prefer #iterDBIDs().
[中]获取为其定义查询的ID。如果可能的话,选择#iterDBIDs()。
代码示例来源:origin: elki-project/elki
/**
* Constructor.
*
* @param rel Relation
*/
public SamplingResult(Relation<?> rel) {
super();
sample = rel.getDBIDs();
}
代码示例来源:origin: elki-project/elki
public Instance(Relation<? extends NumberVector> relation, NumberVectorDistanceFunction<?> df, double[][] means) {
super(relation, df, means);
second = DataStoreUtil.makeIntegerStorage(relation.getDBIDs(), DataStoreFactory.HINT_TEMP | DataStoreFactory.HINT_HOT, -1);
cdist = new double[k];
cnum = new int[k];
}
代码示例来源:origin: elki-project/elki
/**
* Compute Covariance Matrix for a complete relation.
*
* @param relation the relation to run on
* @return Covariance Matrix
*/
default double[][] processRelation(Relation<? extends NumberVector> relation) {
return processIds(relation.getDBIDs(), relation);
}
代码示例来源:origin: de.lmu.ifi.dbs.elki/elki-index-preprocessed
/**
* Create the default storage.
*/
void createStorage() {
storage = DataStoreUtil.makeStorage(relation.getDBIDs(), DataStoreFactory.HINT_HOT, KNNList.class);
}
代码示例来源:origin: elki-project/elki
@Override
public void initialize() {
super.initialize();
insertAll(relation.getDBIDs());
}
代码示例来源:origin: elki-project/elki
/**
* Joins in the given spatial database to each object its k-nearest neighbors.
*
* @param relation Relation to process
* @return result
*/
public Relation<KNNList> run(Relation<V> relation) {
DBIDs ids = relation.getDBIDs();
WritableDataStore<KNNList> knnLists = run(relation, ids);
// Wrap as relation:
return new MaterializedRelation<>("k nearest neighbors", "kNNs", TypeUtil.KNNLIST, knnLists, ids);
}
代码示例来源:origin: elki-project/elki
@Override
public PrecomputedDistanceMatrix<O> instantiate(Relation<O> relation) {
DBIDs rids = relation.getDBIDs();
if(!(rids instanceof DBIDRange)) {
throw new AbortException("Distance matrixes are currently only supported for DBID ranges (as used by static databases; not on modifiable databases) for performance reasons (Patches welcome).");
}
return new PrecomputedDistanceMatrix<>(relation, (DBIDRange) rids, distanceFunction);
}
代码示例来源:origin: elki-project/elki
/**
* Constructor.
*
* @param relation Database to use.
* @param distanceFunction Our distance function
*/
public DBIDRangeDistanceQuery(Relation<DBID> relation, DBIDRangeDistanceFunction distanceFunction) {
super(relation, distanceFunction);
this.range = DBIDUtil.assertRange(relation.getDBIDs());
distanceFunction.checkRange(this.range);
this.distanceFunction = distanceFunction;
}
代码示例来源:origin: elki-project/elki
@Override
protected void preprocess() {
// Run KNNJoin
KNNJoin<V, ?, ?> knnjoin = new KNNJoin<V, RStarTreeNode, SpatialEntry>(distanceFunction, k);
storage = knnjoin.run(relation, relation.getDBIDs());
}
代码示例来源:origin: elki-project/elki
@Override
public void initialize() {
super.initialize();
insertAll(relation.getDBIDs()); // Will check for actual bulk load!
}
代码示例来源:origin: elki-project/elki
@Override
public void initialize() {
super.initialize();
insertAll(relation.getDBIDs());
}
代码示例来源:origin: elki-project/elki
@Override
public void initialize() {
super.initialize();
insertAll(relation.getDBIDs());
}
代码示例来源:origin: elki-project/elki
@Override
public void initialize() {
super.initialize();
insertAll(relation.getDBIDs());
}
代码示例来源:origin: de.lmu.ifi.dbs.elki/elki
@Override
public void initialize() {
super.initialize();
insertAll(relation.getDBIDs()); // Will check for actual bulk load!
}
代码示例来源:origin: elki-project/elki
public Clustering<Model> run(Relation<?> relation) {
final DBIDs ids = relation.getDBIDs();
Clustering<Model> result = new Clustering<>("All-in-one trivial Clustering", "allinone-clustering");
Cluster<Model> c = new Cluster<Model>(ids, ClusterModel.CLUSTER);
result.addToplevelCluster(c);
return result;
}
代码示例来源:origin: elki-project/elki
@Override
public Instance instantiate(Database database) {
DistanceQuery<O> dq = QueryUtil.getDistanceQuery(database, distFunc);
RangeQuery<O> rq = database.getRangeQuery(dq);
return new Instance(epsilon, rq, dq.getRelation().getDBIDs());
}
代码示例来源: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
/**
* Executes multiple change point detection for given relation
*
* @param relation the relation to process
* @return list with all the detected change point for every time series
*/
public ChangePoints run(Relation<DoubleVector> relation) {
if(!(relation.getDBIDs() instanceof ArrayDBIDs)) {
throw new AbortException("This implementation may only be used on static databases, with ArrayDBIDs to provide a clear order.");
}
return new Instance(rnd.getSingleThreadedRandom()).run(relation);
}
代码示例来源: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: elki-project/elki
@Override
public DoubleDBIDList getRangeForDBID(DBIDRef id, double range) {
ModifiableDoubleDBIDList result = DBIDUtil.newDistanceDBIDList();
for(DBIDIter iter = relation.getDBIDs().iter(); iter.valid(); iter.advance()) {
final double currentSim = simQuery.similarity(id, iter);
if(currentSim >= range) {
result.add(currentSim, iter);
}
}
result.sort();
return result;
}
内容来源于网络,如有侵权,请联系作者删除!