public KNN(Data data) { this.data = data; result = new int[data.getTestNum()][2]; data.minMaxDataFormat(data.getTrainData()); data.minMaxDataFormat(data.getTestData()); }
/** 设置优先级队列的比较函数,距离越大,优先级越高 */ public KNN() { data = new Data(); result = new int[data.getTestNum()][2]; data.minMaxDataFormat(data.getTrainData()); data.minMaxDataFormat(data.getTestData()); }