@Test public void testSetK() { int newK = 5; knnClassifier.setK(newK); assertEquals("KnnClassifier.setK failed", newK, knnClassifier.getK()); }
public void setK(int k) throws IllegalArgumentException { if (k < 1) throw new IllegalArgumentException("k must be greater than zero"); model.k = k; }
KNNClassifier extends Classifier { public void setK(int k) throws IllegalArgumentException { if (k < 1) throw new IllegalArgumentException("k must be greater than zero"); model.k = k; } }
KNNClassifier extends Classifier { public void setK(int k) throws IllegalArgumentException { if (k < 1) throw new IllegalArgumentException("k must be greater than zero"); model.k = k; } KNNClassifier(int k, int numFeatures);  KNNClassifier(Object objModel); }
KNNClassifier extends Classifier { public void setK(int k) throws IllegalArgumentException { if (k < 1) throw new IllegalArgumentException("k must be greater than zero"); model.k = k; } KNNClassifier(int k, int numFeatures);  KNNClassifier(Object objModel); @Override boolean train(List<FeatureVector> data); @Override int classify(FeatureVector featureVector); @Override Object getModel(); ArrayList<ComputedDistance> sortDistances(List<ComputedDistance> 
	computedDistance); int getMajorityLabel(List<ComputedDistance> sortedDistance ); int getK(); void setK(int k); int getNumFeatures(); boolean setNumFeatures(int numFeatures); }
KNNClassifier extends Classifier { public void setK(int k) throws IllegalArgumentException { if (k < 1) throw new IllegalArgumentException("k must be greater than zero"); model.k = k; } KNNClassifier(int k, int numFeatures);  KNNClassifier(Object objModel); @Override boolean train(List<FeatureVector> data); @Override int classify(FeatureVector featureVector); @Override Object getModel(); ArrayList<ComputedDistance> sortDistances(List<ComputedDistance> 
	computedDistance); int getMajorityLabel(List<ComputedDistance> sortedDistance ); int getK(); void setK(int k); int getNumFeatures(); boolean setNumFeatures(int numFeatures); public KNNModel model; }