[ 
https://issues.apache.org/jira/browse/MAHOUT-65?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jeff Eastman updated MAHOUT-65:
-------------------------------

    Attachment: MAHOUT-65.patch

This patch introduces four new operations on Vectors:

1. setLabelBindings(Map<String, Integer> bindings) - sets a map of bindings 
between string labels and vector index values
2. getLabelBindings() - returns the map, creating an empty one if needed
3. set(String label, double value) throws UnboundLabelException, IndexException 
- sets the labeled element of the vector to the given value
4. get(String label) throws UnboundLabelException, IndexException - returns the 
value indexed by the given label

This patch required reworking of the serializing/deserializing code so that the 
maps are included in the formatted value if present. Added some new unit tests 
to verify it all works. All tests still run.

This is about as minimal a change as I could imagine, and I chose to just 
expose the map rather than try to encapsulate all the operations that clients 
might want to perform on it. Is this the kind of functionality that people will 
find useful?

Jeff

> Add Element Labels to Vectors and Matrices
> ------------------------------------------
>
>                 Key: MAHOUT-65
>                 URL: https://issues.apache.org/jira/browse/MAHOUT-65
>             Project: Mahout
>          Issue Type: New Feature
>          Components: Matrix
>            Reporter: Jeff Eastman
>         Attachments: MAHOUT-65.patch
>
>
> Many applications can benefit by accessing elements in vectors and matrices 
> using String labels in addition to numeric indices. Investigate adding such a 
> capability.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to