@Test public void testTrain() { if (!knnClassifier.train(data)) fail("Train failed"); }
@Override public boolean train(List<FeatureVector> data) throws IllegalArgumentException{ if (data == null || data.size() < 1) throw new IllegalArgumentException("Provided data is invalid"); model.data = data; setState(ClassifierState.TRAINED); return true; }
KNNClassifier extends Classifier { @Override public boolean train(List<FeatureVector> data) throws IllegalArgumentException{ if (data == null || data.size() < 1) throw new IllegalArgumentException("Provided data is invalid"); model.data = data; setState(ClassifierState.TRAINED); return true; } }
KNNClassifier extends Classifier { @Override public boolean train(List<FeatureVector> data) throws IllegalArgumentException{ if (data == null || data.size() < 1) throw new IllegalArgumentException("Provided data is invalid"); model.data = data; setState(ClassifierState.TRAINED); return true; } KNNClassifier(int k, int numFeatures);  KNNClassifier(Object objModel); }
KNNClassifier extends Classifier { @Override public boolean train(List<FeatureVector> data) throws IllegalArgumentException{ if (data == null || data.size() < 1) throw new IllegalArgumentException("Provided data is invalid"); model.data = data; setState(ClassifierState.TRAINED); return true; } 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 { @Override public boolean train(List<FeatureVector> data) throws IllegalArgumentException{ if (data == null || data.size() < 1) throw new IllegalArgumentException("Provided data is invalid"); model.data = data; setState(ClassifierState.TRAINED); return true; } 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; }