Menu

writing events for mixed features

Help
2009-05-05
2013-04-11
  • Kushal Dave

    Kushal Dave - 2009-05-05

    Hi,
    I am not too sure as to how to deal with mixed features?
    feature1:string
    feature2:integer
    feature3:binary
    for example if the event list is as follows... in following format:
    <feature1> <feature2> <feature3> <outcome>

    tag=NP    val=3   doesOccur=1 1
    tag=NNP val=26 doesOccur=0  1
    tag=DT    val=15 doesOcuur=1  0
    .
    .
    .
    .

    binary features can be converted to string (true/false) .....
    but how to deal with the other type of features in the same event.....??
    how should i train this model?? is RealValueFileEventStream is the way to go?
    also....here... in  "Event(java.lang.String outcome, java.lang.String[] context, float[] values)" what does the float[] array contain....
    please help... i m stuck :(

     
    • Thomas Morton

      Thomas Morton - 2009-05-06

      Hi,
         Yes the RealValueFileEventStream is what you want.  String values and binary values are basically treated the same and can be thought of as having a value of 1.  RealValueFileEventStream will take equal separated values and construct an event for you.  String and binary values can be used and will be given a value of 1 which is how they are treated in models which only contain these kinds of features.  I would recommend however that you not use the = character to separate your stirng values as the parser will try and split them and created real-valued features.  While it will recover when it figures out that the value to the right is not a number it will do this by catching an exception so this will be slow.

      Hope this helps...Tom

       

Log in to post a comment.