Modifier and Type | Class and Description |
---|---|
static class |
KNN.Blocks$ |
static class |
KNN.DistanceMetric$ |
static class |
KNN.K$ |
static class |
KNN.SizeHint$ |
static class |
KNN.UseQuadTree$ |
Constructor and Description |
---|
KNN() |
Modifier and Type | Method and Description |
---|---|
static KNN |
apply() |
static <Testing,PredictionValue> |
evaluate(DataSet<Testing> testing,
ParameterMap evaluateParameters,
EvaluateDataSetOperation<Self,Testing,PredictionValue> evaluator) |
static <Testing,PredictionValue> |
evaluate$default$2() |
static <Training> void |
fit(DataSet<Training> training,
ParameterMap fitParameters,
FitOperation<Self,Training> fitOperation) |
static <Training> ParameterMap |
fit$default$2() |
static <T extends Vector> |
fitKNN(TypeInformation<T> evidence$1)
FitOperation which trains a KNN based on the given training data set. |
static ParameterMap |
parameters() |
static <Testing,Prediction> |
predict(DataSet<Testing> testing,
ParameterMap predictParameters,
PredictDataSetOperation<Self,Testing,Prediction> predictor) |
static <Testing,Prediction> |
predict$default$2() |
static <T extends Vector> |
predictValues(scala.reflect.ClassTag<T> evidence$2,
TypeInformation<T> evidence$3)
PredictDataSetOperation which calculates k-nearest neighbors of the given testing data
set. |
KNN |
setBlocks(int n)
Sets the number of data blocks/partitions
|
KNN |
setDistanceMetric(DistanceMetric metric)
Sets the distance metric
|
KNN |
setK(int k)
Sets K
|
KNN |
setSizeHint(CrossOperatorBase.CrossHint sizeHint)
Parameter a user can specify if one of the training or test sets are small
|
KNN |
setUseQuadTree(boolean useQuadTree)
Sets the Boolean variable that decides whether to use the QuadTree or not
|
scala.Option<DataSet<Block<Vector>>> |
trainingSet() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
parameters
public static KNN apply()
public static <T extends Vector> Object fitKNN(TypeInformation<T> evidence$1)
FitOperation
which trains a KNN based on the given training data set.
evidence$1
- (undocumented)public static <T extends Vector> Object predictValues(scala.reflect.ClassTag<T> evidence$2, TypeInformation<T> evidence$3)
PredictDataSetOperation
which calculates k-nearest neighbors of the given testing data
set.
evidence$2
- (undocumented)evidence$3
- (undocumented)public static ParameterMap parameters()
public static <Training> void fit(DataSet<Training> training, ParameterMap fitParameters, FitOperation<Self,Training> fitOperation)
public static <Training> ParameterMap fit$default$2()
public static <Testing,Prediction> DataSet<Prediction> predict(DataSet<Testing> testing, ParameterMap predictParameters, PredictDataSetOperation<Self,Testing,Prediction> predictor)
public static <Testing,PredictionValue> DataSet<scala.Tuple2<PredictionValue,PredictionValue>> evaluate(DataSet<Testing> testing, ParameterMap evaluateParameters, EvaluateDataSetOperation<Self,Testing,PredictionValue> evaluator)
public static <Testing,Prediction> ParameterMap predict$default$2()
public static <Testing,PredictionValue> ParameterMap evaluate$default$2()
public KNN setK(int k)
k
- the number of selected points as neighborspublic KNN setDistanceMetric(DistanceMetric metric)
metric
- the distance metric to calculate distance between two pointspublic KNN setBlocks(int n)
n
- the number of data blockspublic KNN setUseQuadTree(boolean useQuadTree)
public KNN setSizeHint(CrossOperatorBase.CrossHint sizeHint)
sizeHint
- cross hint tells the system which sizes to expect from the data setsCopyright © 2014–2018 The Apache Software Foundation. All rights reserved.