Code Monkey home page Code Monkey logo

Comments (8)

DominiqueMakowski avatar DominiqueMakowski commented on August 15, 2024

Thanks for pointing that out! You're right, I think this is a bad design choice. Better to stick with the return in the form of a dataframe containing the two values. Also, I've added more info about them. Will be in upcoming PR

from bayestestr.

DominiqueMakowski avatar DominiqueMakowski commented on August 15, 2024

After thinking a bit more I've decided to re-set the inclusion of the density value to optional as I think most users won't expect nor need it. I tried to document it better in the documentation.

from bayestestr.

DominiqueMakowski avatar DominiqueMakowski commented on August 15, 2024

I am still hesitating with this one... currently MAP_estimate always returns a dataframe with one or two column). However, users might expect a single value instead of a dataframe. The density value of the MAP (the possible second column) was initially added because it is used in p_map and because it might be worth something (#59). At the same time, it can be easily retrieved using density_at, although it is computationally not very efficient (i.e. the density function would be estimated twice).

Nevertheless, maybe it's better to harmonize it with other functions and return a single value (in case a single posterior is passed) instead of always a dataframe...

from bayestestr.

strengejacke avatar strengejacke commented on August 15, 2024

Well, you still have attributes (to save the density value), and you can add a print()-method. What is printed (many information) and what is returned for further computation (a numeric value, with attrbiute) can be something different.

from bayestestr.

DominiqueMakowski avatar DominiqueMakowski commented on August 15, 2024

storing the density value as an attribute solves all problems. Thanks for that :)

from bayestestr.

DominiqueMakowski avatar DominiqueMakowski commented on August 15, 2024

Well I am kind of disappointed to find out that numeric cannot really take attributes... 😅 More precisely, adding attributes to a numeric make the tests fail. If I create a new class `c("MAP", "numeric"), the tests also fail... See #67

Returning a list seems a bit as going back to the dataframe behaviour 😕

from bayestestr.

strengejacke avatar strengejacke commented on August 15, 2024

You can actually check for values with attributes in tests, I have done this somewhere in on of my / our packages... I must check if I can find it...

from bayestestr.

DominiqueMakowski avatar DominiqueMakowski commented on August 15, 2024

I think this has been addressed

from bayestestr.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.