Re: How to classify unseen multi instance data?
Ulrich Mayring <[email protected]> Thu, 25 Jan 2024 10:24:10 +0100
| Newsgroups | gmane.comp.ai.weka |
|---|---|
| Message-ID | <[email protected]> |
Hi Peter, Am 25.01.24 um 03:56 schrieb Peter Reutemann: > > Even for multi-instance data you only use a single Instance object, > representing a single bag, for making predictions. My confusion stemmed from the somewhat unfortunate terminology, whereby I thought an Instance object is single-instance and Instances is multi-instance - which I now believe to be wrong. An Instance can either be single- or multi-instance and if it is multi-instance we also call it a bag. Instances is then either: - a bunch of bags or - a bunch of single-instance Instance objects The next point to note is that training a model is done off an Instances object, whereas classification of unseen data is using an Instance. Therefore the answer to my original question appears to be thus: When training a model, first get the data from somewhere (ARFF file, database, ...) and then convert it to an Instances object. When classifying unseen data, use the exact same code to create an Instances object (optionally skipping the class values, which are not needed here). Then it's just a matter of passing Instances.firstInstance() to the classifier. Hopefully I explained it correctly now :) FWIW, from a software engineering standpoint single- and multi-instance data should be distinguishable by their type (Java class). Multi-instance data should probably implement an additional interface. Kind regards, Ulrich _______________________________________________ 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