machine learning - Inconsistent Classifier Updating in Weka [Scala] -


i'm simultaneously updating 2 weka classifiers.

here's how i'm updating first classifier:

 list(x, y, action).zipwithindex.foreach{    case (attrstring:string, index)=> attrs.elementat(index) match{      case attr:attribute => instance.setvalue(attr,attrstring)    }           } 

here's how i'm updating second classifier:

 list(x, name, y).zipwithindex.foreach{    case (attrstring:string, index) => tagattrs.elementat(index) match{      case attr:attribute => {        println("setting taginstance's "+index+"th field "+attrstring)        taginstance.setvalue(attr, attrstring)      }    }  } 

you'll notice difference(other debugging statement) /instance/ should have attributes /x, y, action/, whereas /taginstance/ should have attributes /x, name, y/

then: println(instance) println(taginstance)

unfortunately, what's output these 2 functions:

setting taginstance's 0th field dt setting taginstance's 1th field warm setting taginstance's 2th field jj dt,jj,shift dt,jj,? 

the first 3 lines indicate should setting correct values, if case, last line read dt, warm, jj.

what heck!

the comment @rehj led me debugging problem. unfortunately, had wrong set of attributes associated instances. changing attrs tagattrs in following solved problem. bad!

 val tagdata = new instances("actions",tagattrs,10) 

Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -