KNN implementation with PyCUDA
KNN_pycuda(MAX_K, X_train, X_test, y_train, y_test,
metric='eucl', preproc=None, verbose=False):
parameters:
MAX_K
: the function evaluates every K in [1, MAX_K]X_train
, X_test, y_train, y_test: training and test setmetric
: distance metric. {'eucl', 'manh', 'cheb', 'cos'} are supportedpreproc
: pre-processing method (normalization). {None, 'l1', 'l2', 'zscore'} are supportedverbose
: displays progress if verbose=True