@Override public void buildClassifier(Instances Train) throws Exception { testCapabilities(Train); this.m_NumClasses = Train.classIndex(); int indices[] = MLUtils.gen_indices(m_NumClasses); MLUtils.randomize(indices,new Random(m_S)); if(getDebug()) System.out.print(":- Chain ("); root = new QLink(indices,0,Train); if (getDebug()) System.out.println(" ) -:"); }
@Override public String toString() { return (next == null) ? String.valueOf(this.index) : String.valueOf(this.index)+">"+next.toString(); }
next = new QLink(chain, ++j, train);
next = new QLink(chain, ++j, train);
private void classify(Instance test) throws Exception { // copy Instance copy = (Instance)test.copy(); copy.setDataset(null); // delete attributes we don't need for(int i = excld.length-1; i >= 0; i--) { copy.deleteAttributeAt(this.excld[i]); } //set template copy.setDataset(this._template); //set class test.setValue(this.index,(int)(this.classifier.classifyInstance(copy))); //carry on if (next!=null) next.classify(test); }
private void classify(Instance test) throws Exception { // copy Instance copy = (Instance)test.copy(); copy.setDataset(null); // delete attributes we don't need for(int i = excld.length-1; i >= 0; i--) { copy.deleteAttributeAt(this.excld[i]); } //set template copy.setDataset(this._template); //set class test.setValue(this.index,(int)(this.classifier.classifyInstance(copy))); //carry on if (next!=null) next.classify(test); }
@Override public String toString() { return (next == null) ? String.valueOf(this.index) : String.valueOf(this.index)+">"+next.toString(); }
@Override public void buildClassifier(Instances Train) throws Exception { testCapabilities(Train); this.m_NumClasses = Train.classIndex(); int indices[] = MLUtils.gen_indices(m_NumClasses); MLUtils.randomize(indices,new Random(m_S)); if(getDebug()) System.out.print(":- Chain ("); root = new QLink(indices,0,Train); if (getDebug()) System.out.println(" ) -:"); }