[ 
https://issues.apache.org/jira/browse/MAHOUT-65?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12615292#action_12615292
 ] 

Karl Wettin commented on MAHOUT-65:
-----------------------------------

bq. That seems like shoe-horning two functions into one, but I see your point 
that these are both characteristics of the element of the vector.

What about something like this:

{code:java}

class Matrix {
  Attributes attributes;
}

class Vector {
  transient Matrix matrix;
  Attributes attributes;
  Attributes getAttributes() {
    return attributes != null ? attributes : matrix != null ? matrix.attributes 
: null;
  }
}

class Attributes {
  Map<String, Attribute> nameIndex;
  List<Attribute> attributes;
  
  void setName(Attribute, String);
  String getName(Attribute);
}  

class Attribute {
  Type type {ordinal, numeric};
  List<String> ordinalValues;
}

{code}

> 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