FFTrees icon indicating copy to clipboard operation
FFTrees copied to clipboard

Ideas for refining the structure of FFTrees objects

Open ndphillips opened this issue 1 year ago • 2 comments

@hneth In the context of #224 I realized that the structure of FFTrees objects is making development challenging - such as knowing how to modularize the plot.FFTrees() function.

The current code to create FFTrees objects is contained here: https://github.com/ndphillips/FFTrees/blob/71b9da041d16439f7de3091f7aa5987885f45108/R/fftrees_create.R#L765-L852

Here are the core issues I see:

  • Inconsistent and confusing naming
    • Ex) How do the definitions, inwords, stats, level_stats, and decisions objects in FFTrees.relate to each other?
  • Information at different levels of abstraction aren't consistently stored
    • Ex) Why are tree definitions stored at the tree level but not the node level? Why aren't overall tree accuracy stats located close to the tree level accuracy stats?
  • Inconsistent storage locations
    • Ex) Why are criterion_name, cue_names and formula stored at the same level as trees, data and params? Could these be stored in a list such as metadata?

To solve these issues, I'm drafted an object design doc at https://github.com/ndphillips/FFTrees/wiki/%5B80%25%5D-FFTrees-Object-Design. I'm eager for feedback

ndphillips avatar May 29 '24 12:05 ndphillips

Just realized that my comment on #224 should better have been posted here — sorry!

hneth avatar May 30 '24 08:05 hneth

No worries, let's carry on the discussion here

ndphillips avatar Jun 01 '24 11:06 ndphillips