@Test public void testRpTreeMaxNodes() throws Exception { DataSetIterator mnist = new MnistDataSetIterator(150,150); RPForest rpTree = new RPForest(4,4,"euclidean"); DataSet d = mnist.next(); NormalizerStandardize normalizerStandardize = new NormalizerStandardize(); normalizerStandardize.fit(d); rpTree.fit(d.getFeatures()); for(RPTree tree : rpTree.getTrees()) { for(RPNode node : tree.getLeaves()) { assertTrue(node.getIndices().size() <= rpTree.getMaxSize()); } } }
public List<RPNode> getLeaves() { List<RPNode> nodes = new ArrayList<>(); RPUtils.scanForLeaves(nodes,getRoot()); return nodes; }
RPTree { public List<RPNode> getLeaves() { List<RPNode> nodes = new ArrayList<>(); RPUtils.scanForLeaves(nodes,getRoot()); return nodes; } }
RPTree { public List<RPNode> getLeaves() { List<RPNode> nodes = new ArrayList<>(); RPUtils.scanForLeaves(nodes,getRoot()); return nodes; } @Builder  RPTree(int dim, int maxSize,String similarityFunction);  RPTree(int dim, int maxSize); }
RPTree { public List<RPNode> getLeaves() { List<RPNode> nodes = new ArrayList<>(); RPUtils.scanForLeaves(nodes,getRoot()); return nodes; } @Builder  RPTree(int dim, int maxSize,String similarityFunction);  RPTree(int dim, int maxSize); void buildTree(INDArray x); void addNodeAtIndex(int idx,INDArray toAdd); List<RPNode> getLeaves(); List<Pair<Double, Integer>> queryWithDistances(INDArray query, int numResults); INDArray query(INDArray query,int numResults); List<Integer> getCandidates(INDArray target); }
RPTree { public List<RPNode> getLeaves() { List<RPNode> nodes = new ArrayList<>(); RPUtils.scanForLeaves(nodes,getRoot()); return nodes; } @Builder  RPTree(int dim, int maxSize,String similarityFunction);  RPTree(int dim, int maxSize); void buildTree(INDArray x); void addNodeAtIndex(int idx,INDArray toAdd); List<RPNode> getLeaves(); List<Pair<Double, Integer>> queryWithDistances(INDArray query, int numResults); INDArray query(INDArray query,int numResults); List<Integer> getCandidates(INDArray target);  }