Pages: [1]
  Print  
Author Topic: arbitrary attribute metadata  (Read 1824 times)
kgeis
Newbie
*
Posts: 5


« on: November 17, 2009, 12:00:31 AM »

I would like to be able to attach arbitrary metadata to an attribute.  For example, a flag that says whether it is possible for that attribute to be null/missing.  Certain of my custom learners would understand this metadata.  I only really need this in the API, not necessarily the UI.

I've tried to figure out how to do this with the existing API.  I could have my own implementation of Attribute, but then I would also need my own BinomialAttribute, DateAttribute, etc.  And then, I would need to modify AttributeFactory; I see no support for replacing the AttributeFactory.  Maybe AttributeFactory should be a singleton object, not a set of static methods (except for something like setInstance/getInstance.) 
Logged
Sebastian Land
Administrator
Hero Member
*****
Posts: 2426


« Reply #1 on: November 17, 2009, 10:21:06 AM »

Hi,
perhaps it would be a better solution not to change the attributes, but implement an own exampleset, providing a method for getting arbitrary meta data on the attributes. It could simply store a map from attribute to your meta data. Your learner then would only need to ensure, it get's the correct type of exampleset.

Greetings,
  Sebastian
Logged
kgeis
Newbie
*
Posts: 5


« Reply #2 on: November 18, 2009, 05:56:12 AM »

Thanks for the idea!
Logged
kgeis
Newbie
*
Posts: 5


« Reply #3 on: December 07, 2009, 08:04:45 AM »

I've realized that this solution does not work very well.  Many pre-processing operators will return a new example set, and it will not contain the attribute metadata I want.
Logged
cherokee
Jr. Member
**
Posts: 83


« Reply #4 on: December 07, 2009, 08:46:24 AM »

Hi!

You could create another IOObject that contains your meta data and pass it around with you true data. Your learners just need to have another ioport.

Best regards,
chero

P.S.: If you don't use preprocessing operators Sebastians solution works. I've used it some time ago.
Logged
Pages: [1]
  Print  
 
Jump to: