use of org.tribuo.math.neighbour.bruteforce.NeighboursBruteForceFactory in project tribuo by oracle.
the class HdbscanTrainer method postConfig.
/**
* Used by the OLCUT configuration system, and should not be called by external code.
*/
@Override
public synchronized void postConfig() {
if (this.distanceType != null) {
if (this.distType != null) {
throw new PropertyException("distType", "Both distType and distanceType must not both be set.");
} else {
this.distType = this.distanceType.getDistanceType();
this.distanceType = null;
}
}
if (neighboursQueryFactory == null) {
int numberThreads = (this.numThreads <= 0) ? 1 : this.numThreads;
this.neighboursQueryFactory = new NeighboursBruteForceFactory(distType, numberThreads);
} else {
if (!this.distType.equals(neighboursQueryFactory.getDistanceType())) {
throw new PropertyException("neighboursQueryFactory", "distType and its field on the " + "NeighboursQueryFactory must be equal.");
}
}
}
use of org.tribuo.math.neighbour.bruteforce.NeighboursBruteForceFactory in project tribuo by oracle.
the class TestNeighborsBruteForce method testMultiThreadQueryAll.
@Test
public void testMultiThreadQueryAll() {
NeighboursBruteForceFactory factory = new NeighboursBruteForceFactory(DistanceType.L2, 4);
NeighbourQueryTestHelper.neighboursQueryAll(factory);
}
use of org.tribuo.math.neighbour.bruteforce.NeighboursBruteForceFactory in project tribuo by oracle.
the class TestNeighborsBruteForce method testSingleThreadQueryMany.
@Test
public void testSingleThreadQueryMany() {
NeighboursBruteForceFactory factory = new NeighboursBruteForceFactory(DistanceType.L2, 1);
NeighbourQueryTestHelper.neighboursQueryMany(factory);
}
use of org.tribuo.math.neighbour.bruteforce.NeighboursBruteForceFactory in project tribuo by oracle.
the class TestNeighborsBruteForce method testSingleDimension.
@Test
public void testSingleDimension() {
NeighboursBruteForceFactory factory = new NeighboursBruteForceFactory(DistanceType.L2, 1);
NeighbourQueryTestHelper.neighboursQuerySingleDimension(factory);
}
use of org.tribuo.math.neighbour.bruteforce.NeighboursBruteForceFactory in project tribuo by oracle.
the class TestNeighborsBruteForce method testNeighboursQueryOneExclusive.
@Test
public void testNeighboursQueryOneExclusive() {
NeighboursBruteForceFactory factory = new NeighboursBruteForceFactory(DistanceType.L2, 1);
NeighbourQueryTestHelper.neighboursQueryOneExclusive(factory);
}
Aggregations