#15 Supporting Undefined Values

All
open
All (20)
5
2002-01-02
2002-01-01
Anonymous
No

Hello,
I would like to use your Chart2D to display a
classification table, like:

Item | Class
---------------------
1 | apple

2 | orange

3 | misclassified

4 | apple

...

What is in your opinion the simplest way to modify
Chart2D to do things like this?

Discussion

  • Jason J Simas

    Jason J Simas - 2002-01-02

    Logged In: YES
    user_id=179964

    To: Anonymous

    I don't understand. A table is not a chart. Why don't you
    use JTable? Unless you are talking about a chart or a
    feature of a chart, then it definitely will not be added to
    Chart2D.

    Jason

     
  • Jason J Simas

    Jason J Simas - 2002-01-02
    • labels: --> All
     
  • Jason J Simas

    Jason J Simas - 2002-01-02
    • summary: Classification charts --> Classification Tables
    • assigned_to: nobody --> jjsimas
    • milestone: --> All
     
  • Jason J Simas

    Jason J Simas - 2002-01-02
    • status: open --> pending
     
  • Nobody/Anonymous

    Logged In: NO

    Well,
    ineed I aleady use a JTable to represent this. I work on a
    classifier program and I would like to visualize the
    differences between original and predicted values in a
    dataset (2 series). As I unterstand, a chart <is> a table.
    Everyhing you can represent in a table you can also depict
    graphically. What you do in "category" chart is a mapping "m
    categories -> n series (k items -> k values)". What I need
    is "n series (k items -> 1 category)".
    I already have looked at your code. The simplest way to do
    this seems to me to implement a non-value for an item (like
    Float.NaN). If an item have this value it should not be
    depicted. This way you could also have different series
    lengths in one dataset without restructuring your data
    model. With setting item value either to item number or to
    the non-value I can visualize classification. The clean way
    is to allow different series lengths in one Dataset
    implementing sparse data model and optionally flexible
    mapping function range (value or string).

     
  • Jason J Simas

    Jason J Simas - 2002-01-02

    Logged In: YES
    user_id=179964

    To: Anonymous

    You are using a weird version of "is". The fact that one
    thing can always be used to represent something else does
    not imply that one thing is another thing. There is a
    difference. I don't know if you are familiar with CSci
    theory (my guess is you are), but an example from that area
    is using DFA's and NDFA's. A NDFA can always be
    represented by a DFA (and vice versa), but no one would say
    that a NDFA is a DFA. They have their differences despite
    the ability for their "cross-representationality".

    It appears that you want to be able to be able to specify
    undefined "items" in your dataset. [Do you mind if the we
    use the terminology:
    "n sets -> (m cats -> (k items -> j values))". Currently
    Chart2D requires that k equals j. It appears that you want
    to allow for k to not equal j (instead specifying undefined
    values where they differ).

    Float.NaN I think is the smartest way of doing this. For
    bar charts and dot charts, my estimation is that the
    modifications are quite easy. For line charts, the
    modification may require more work. A line in a line chart
    is a "GeneralPath" class. Allowing undefined values would
    not simply be a matter of not painting certain bars and
    dots but would affect the construction of the
    GeneralPaths. I'm not sure to what extend. At the
    extreme. Each undefined value would cause a new
    GeneralPath to be created. Currently a single GeneralPath
    is used per set of the dataset. There may be one more
    hang up because I recall that somewhere in the code, I check
    for NaN and convert it to 0f, I think.

    I'm currently accepting sponsorship of work requested. If
    you would like me to add this feature within a week, then
    you may sponsor the work for $100.

    Jason

     
  • Jason J Simas

    Jason J Simas - 2002-01-02
    • status: pending --> open
     
  • Nobody/Anonymous

    Logged In: NO

    I thought the question what things are was already answered:
    "42" ;-) .
    Lets summarize:
    Float.NaN is the way to tell the graphical components not to
    paint a specific item in current data model. It will allow
    variable series lengths.
    The problem that still exists is under circumstances the
    allocation of many empty chunks (Float.NaNs) in the data model.

    Why not to do following:
    1. Replace Dataset class with Dataset interface and let user
    decide which data model is appropriate. Implementations
    could be for instance current data model with vectors,
    sparse model, or "online" model for web, where all bounds
    but not all item values are known at dataset creation time.

    2. There are more possibilities:
    a) Rearrange loops in painting components (perhaps there is
    more to do) to deal with variable series length. Dataset
    should always return only item values that really exist.
    b) Modify painting components to accept Float.NaNs as
    non-value. I will use in my case a HashMap as underlying
    data structure for Dataset and supply or calculate domain
    and range bounds at creation. If an item can not be found in
    the set, a Float.NaN value will be returned.

    Btw. Float.NaN opens the way for FAST item removing without
    removing of vector values in current data model.

    Some other thought:
    Why not to use Object superclass for item values? This will
    allow to decide, how the function range looks like. If all
    values are of class String, we have categories (category
    axis), if Integer, we have integers and integer axis, if
    Double - current double axis.

    I am not much interested in the hack with Float.NaN alone.
    Flexible data model is not less important. Let me know what
    you think.

    Sincerely
    Olexij Tkatchenko

     
  • Jason J Simas

    Jason J Simas - 2002-01-02

    Logged In: YES
    user_id=179964

    Olexij

    Realize that this is not a commercial application and that
    there are other places where improvements would help a
    greater number of users.

    i) Your idea that you can eliminate the problem of "empty
    chunks (Float.NaNs) in the data model)" is incorrect...
    Consider the example, where a person is charting how many
    employees were abset each work day of the year. The sets
    would be years. The cats would be months. The items would
    be work days. The case we are taking care of is the case
    where there are months with differing numbers of days (ex
    holidays). If the standard item vector had 25 days in it,
    but if there was a holiday, one would want for the empty/NaN
    value to be at the correct day. For example, for the year
    2001, the 22nd day of January didn't have a value because
    we took a special holiday. The empty space needs to be
    specified and with respect to the other years where the
    22nd was not taken off. There will need to be some way to
    specify that it is the 22nd that has the empty space. There
    are two ways of doing this. For each item vector that has
    fewer spaces than the others for that month and set, one
    would have a list of indexes of those spaces. The other way
    is to fill in the gaps with NaN in the item vector,
    implicitly specifying this. Which requires less space?
    Aren't they equal? You'd have to get more sophisticated in
    order to save space. There would have to be days that are
    adjacent for which there are no values, such as a week, then
    one would specify the beginning index, the ending index, and
    a boolean that the middle is empty as well. I don't think
    it's worth it. It appears to me that you are only thinking
    of your own case and what would be good for it. I have to
    think about what would be good for the majority of cases.
    For the majority of cases NaN would not be a "hack" but an
    intelligent solution.

    There is no need to replace Dataset class with a Dataset
    interface. You can extend Dataset and override any methods
    that you want. An interface would complicate matters for
    the most part, forcing me to document the hell out of it,
    placing many requirements. For example Dataset keeps a
    vector of all the Chart2D objects that are using it. I
    don't think people would in general implement it properly.

    I don't know what you are talking about storing strings
    in Dataset. I cannot chart strings. The thing to do would
    be to add "Number"s. Again, for the majority of
    applications, floats are large enough. I don't want to see
    an axis with labels greater than 38 zeroes. If you have
    values that large, factor zeroes out, and label that in the
    axis title.

    Jason

     
  • Jason J Simas

    Jason J Simas - 2002-01-02
    • summary: Classification Tables --> Supporting Undefined Values
     
  • Nobody/Anonymous

    Logged In: NO

    Jason,
    you have started to talk about sponsorship, not me. I only
    listed what is interesting for my needs.
    1. Data model as interface
    Interface can be implemented with an adaptor. Abstract class
    can also be used in this place. You can also provide a
    default implementation...or many...
    2. What I mean by Strings as item values is just an other
    definition of function range. Currently you have:
    [item_min_value, item_max_value] as function range. With
    Strings you would have i.E. {"Apples", "Oranges"} in
    terminology of first posting. You could enumerate such a
    String set to determine axis partitioning. It would also
    help in your constructed example with holydays: you could
    use Float objects as item value. If item value is null, the
    item is absent, if the value is Float.NaN the item is
    present but should not be painted.
    3. It appears to me that your app is monolitic and hard to
    maintain. If you do not want to change this it is your choice.

    Sincerely
    Olexij Tkatchenko

     
  • Jason J Simas

    Jason J Simas - 2002-01-02

    Logged In: YES
    user_id=179964

    It appears to me that you have brain damage.

    You are making statements, suggestions, and requests. I am
    discussing them with you. I would not implement your
    suggestions and requests unless they were sponsored because
    they are not technically superior either at all or for the
    majority of users. Since you are in the minority, I
    mention the possibility of sponsorship.

    1) Of course I could do all those things. But would it be
    an intelligent thing to do?

    2) Why must I provide more than one way to do things? A
    person can make a second chart with only the categories of
    apples and oranges. There are things that people want that
    don't even have one way yet. It would not help with the
    example, because not every item has a label and other
    reasons...

    3) The appears to me that you think the only objects that
    exist are public objects. Chart2D has an inner core of
    package private objects. The "monolithic" part of it which
    is eleven classes is a wrapper for the 30 objects that are
    Chart2D's core. I don't mind you talking about things
    before you thoroughly check them out, but why would you say
    something like that in the first place except to try to
    hurt me and my project. Stop being a troll.

    Jason

     
  • Nobody/Anonymous

    Logged In: NO

    I will not waste any more time for this senseless discussion
    Mr. brain surgeon. May your user base be happy with you and
    your attitude.

     
  • Jason J Simas

    Jason J Simas - 2002-01-02
    • status: open --> wont-fix
     
  • Jason J Simas

    Jason J Simas - 2002-01-02

    Logged In: YES
    user_id=179964

    I don't know what happened here. I don't like it when
    people ask for more than is necessary. It appeared the
    NaN solution would have worked fine for him. But he
    wasn't happy with it. I tried to explain the problems with
    his suggested solutions and why it wasn't good for Chart2D
    at this time. Calling my solution a hack and that Chart2D
    was monolithic when it really is the best free package on
    the net was offensive. I don't think I have a bad attitude,
    and I've never before been told that I have one. It is
    impolite to ask for too much even thoug it is only asking.

    Jason

     
  • Jason J Simas

    Jason J Simas - 2002-01-02
    • status: wont-fix --> open
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks