|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.kpro.algorithm.ReductionAlgorithm
com.kpro.algorithm.Reduction_KNN
public class Reduction_KNN
A k-nearest-neighbors algorithm class. create it and call run on it to get the nearest k neighbors to the object passed to run().
Field Summary | |
---|---|
private DistanceMetric |
distanceMetric
|
private int |
k
|
Fields inherited from class com.kpro.algorithm.ReductionAlgorithm |
---|
extraArgs, pdb |
Constructor Summary | |
---|---|
Reduction_KNN(DistanceMetric distanceMetric,
PolicyDatabase database,
java.lang.String[] extraArgs)
creates a kNearestNeighbors algorithm to use |
Method Summary | |
---|---|
java.util.ArrayList<PolicyObject> |
reduce(PolicyObject newPO)
the method that returns the closest k objects to the parameter. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private DistanceMetric distanceMetric
private int k
Constructor Detail |
---|
public Reduction_KNN(DistanceMetric distanceMetric, PolicyDatabase database, java.lang.String[] extraArgs)
distanceMetric
- the class defining distance between objectsdatabase
- the database of objects to operate onextraArgs
- from the config fileMethod Detail |
---|
public java.util.ArrayList<PolicyObject> reduce(PolicyObject newPO)
reduce
in class ReductionAlgorithm
newPO
- the new PolicyObject the thing to find the neighbors of
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |