KNN.Array Module
Functions and values
| Function or value | Description |
Full Usage:
Array.predict distance labeledPoints k x
Parameters:
Distance<'a>
-
the distance function, e.g. `euclidean`
labeledPoints : ('a * 'l) array
-
the array of classified (or labeled) points [in the format (point, label)],
used for the classification
k : int
-
The _positive_ number of nearest neighbors from x to look for.
x : 'a
-
The point to classify
Returns: 'l option
The most common label from the k nearest neighbors for x.
Modifiers: inline Type parameters: 'a, 'l |
May mutate the order of `labeledPoints`.
Example
val reds: (float list * string) array
module Array
from Microsoft.FSharp.Collections
val map: mapping: ('T -> 'U) -> array: 'T array -> 'U array
val p: float list
val blues: (float list * string) array
val labeledPoints: (float list * string) array
val append: array1: 'T array -> array2: 'T array -> 'T array
val prediction: (float list -> obj)
namespace Microsoft.FSharp
val color: obj
|
FSharp.Stats