|
KNearestNeighborsFromTree Method
|
Creates a new
KNearestNeighbors algorithm from an existing
KDTreeT. The tree must have been created using the input
points and the point's class labels as the associated node information.
Namespace:
Accord.MachineLearning
Assembly:
Accord.MachineLearning (in Accord.MachineLearning.dll) Version: 3.8.0
Syntax public static KNearestNeighbors FromTree(
KDTree<int> tree,
int k,
int classes,
double[][] inputs,
int[] outputs
)
Public Shared Function FromTree (
tree As KDTree(Of Integer),
k As Integer,
classes As Integer,
inputs As Double()(),
outputs As Integer()
) As KNearestNeighbors
Request Example
View SourceParameters
- tree
- Type: Accord.CollectionsKDTreeInt32
The KDTreeT containing the input points and their integer labels. - k
- Type: SystemInt32
The number of nearest neighbors to be used in the decision. - classes
- Type: SystemInt32
The number of classes in the classification problem. - inputs
- Type: SystemDouble
The input data points. - outputs
- Type: SystemInt32
The associated labels for the input points.
Return Value
Type:
KNearestNeighborsA
KNearestNeighbors algorithm initialized from the tree.
See Also