Re: Creating a relational Attribute for Multi Instance Data

Peter Reutemann <[email protected]> Tue, 19 Dec 2023 10:37:05 +1300
Newsgroups gmane.comp.ai.weka
Message-ID <CAHoQ12KZJLdh96ZPiJbh0aaFqGDqrOQZJzvbCrX8Ufee0_hYEA@mail.gmail.com>
> I am trying to create an Instances object in Java, which will contain
> multi instance data.
>
> If you run the code below, then you will see a
> "java.lang.IndexOutOfBoundsException: Index -1 out of bounds for length
> 0", which is thrown from the last line in the try-block (where
> toString() is called on "rawData").
>
> However, if I define the attribute "bag" as a string attribute (instead
> of relational), then everything works great. So I think I must have made
> some mistake in the way I am creating the relational attribute.

Have a look at this example on the wiki, which demonstrates how to
create and fill a relational attribute:
https://waikato.github.io/weka-wiki/formats_and_processing/creating_arff_file/

Cheers, Peter
-- 
Peter Reutemann
Dept. of Computer Science
University of Waikato, Hamilton, NZ
Mobile +64 22 190 2375
https://www.cs.waikato.ac.nz/~fracpete/
http://www.data-mining.co.nz/
_______________________________________________
Wekalist mailing list -- [email protected]
Send posts to [email protected]
To unsubscribe send an email to [email protected]
To subscribe, unsubscribe, etc., visit https://list.waikato.ac.nz/postorius/lists/wekalist.list.waikato.ac.nz
List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html