Package weka.core.neighboursearch
Class NewNNSearchWithIndices
- java.lang.Object
-
- weka.core.neighboursearch.NearestNeighbourSearch
-
- weka.core.neighboursearch.NewNNSearch
-
- weka.core.neighboursearch.NewNNSearchWithIndices
-
- All Implemented Interfaces:
Serializable
,weka.core.AdditionalMeasureProducer
,NearestNeighbourSearchWithIndices
,weka.core.OptionHandler
,weka.core.RevisionHandler
public class NewNNSearchWithIndices extends NewNNSearch implements NearestNeighbourSearchWithIndices
NewNNSearch with index support.- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class weka.core.neighboursearch.NewNNSearch
NewNNSearch.InstanceNode
-
Nested classes/interfaces inherited from class weka.core.neighboursearch.NearestNeighbourSearch
weka.core.neighboursearch.NearestNeighbourSearch.MyHeap, weka.core.neighboursearch.NearestNeighbourSearch.MyHeapElement, weka.core.neighboursearch.NearestNeighbourSearch.NeighborList, weka.core.neighboursearch.NearestNeighbourSearch.NeighborNode
-
-
Field Summary
-
Fields inherited from class weka.core.neighboursearch.NewNNSearch
m_Distances, m_neighbours, m_SkipIdentical
-
-
Constructor Summary
Constructors Constructor Description NewNNSearchWithIndices()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getRevision()
Returns the revision string.String
globalInfo()
Returns a string describing this nearest neighbour search algorithm.int[]
kNearestNeighboursIndices(weka.core.Instance target, int kNN)
Returns the indices of the k nearest instances in the current neighbourhood to the supplied instance.-
Methods inherited from class weka.core.neighboursearch.NewNNSearch
addInstanceInfo, getDistances, getOptions, getSkipIdentical, kNearestNeighbours, listOptions, nearestNeighbour, setInstances, setOptions, setSkipIdentical, skipIdenticalTipText, update
-
Methods inherited from class weka.core.neighboursearch.NearestNeighbourSearch
combSort11, distanceFunctionTipText, enumerateMeasures, getDistanceFunction, getInstances, getMeasure, getMeasurePerformance, getPerformanceStats, measurePerformanceTipText, partition, quickSort, setDistanceFunction, setMeasurePerformance
-
-
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string describing this nearest neighbour search algorithm.- Overrides:
globalInfo
in classNewNNSearch
- Returns:
- a description of the algorithm for displaying in the explorer/experimenter gui
-
kNearestNeighboursIndices
public int[] kNearestNeighboursIndices(weka.core.Instance target, int kNN) throws Exception
Returns the indices of the k nearest instances in the current neighbourhood to the supplied instance.- Specified by:
kNearestNeighboursIndices
in interfaceNearestNeighbourSearchWithIndices
- Parameters:
target
- The instance to find the k nearest neighbours for.kNN
- The number of nearest neighbours to find.- Returns:
- the indices of the k nearest neighbors in the dataset
- Throws:
Exception
- if the neighbours could not be found.
-
getRevision
public String getRevision()
Returns the revision string.- Specified by:
getRevision
in interfaceweka.core.RevisionHandler
- Overrides:
getRevision
in classNewNNSearch
- Returns:
- the revision
-
-