SteveOv / ebop_maven

EBOP Model Automatic input Value Estimation Neural network
GNU General Public License v3.0
1 stars 0 forks source link

investigate the use of numpy structured arrays in the output from Estimator #63

Closed SteveOv closed 4 months ago

SteveOv commented 4 months ago

More efficient and maintains the self describing behaviour of the current list of dicts.

SteveOv commented 4 months ago

https://numpy.org/doc/stable/user/basics.rec.html

SteveOv commented 4 months ago

May tie this in with #33 to make the Estimator return its predictions/sigmas in UFloats

SteveOv commented 4 months ago

So I'll deal with Estimator UFloats as part of this issue and I'll leave ufloat support in the libraries to #33

SteveOv commented 4 months ago

The whole Estimator predict() stack will be changed to return a numpy recarray of UFloats so that instances may be accessed by numeric index and predicted values by name (rA_plus_rB, k, ...), so of shape (insts, labels)

I've written a test version of predict to do this and it's pretty straightfiorward. The benefits start to be realised when you see that instances and/or values can be accessed like

predictions[0]
predictions.k
predictions[0]["k"]

And masking is also supported

circular = predictions[predictions.ecosw == 0]
transiting = predictions[transit_flags]

This will require an awful lot of testing and plotting code be updated but it will be worth it.

SteveOv commented 4 months ago

Closed with commit c3c8f404cddbbf30b9f164e9fb7701254f5d513c