GithubHelp home page GithubHelp logo

Comments (5)

stefanfritsch avatar stefanfritsch commented on July 19, 2024 1

As I see it, if the parameter data=dataset is present, augment augments that dataset. So all rows of the input dataset should be present with new columns added.

That said, why not just add a column "na.action", that way the user has full control? Although in most cases that would just be an is.na(fitted.values), wouldn't it? :)

from broom.

gavinsimpson avatar gavinsimpson commented on July 19, 2024

It might be better to have augment() respect the na.action requested by the user when the statistical model was fitted. Hence to achieve the behaviour you desire, the model would need to be fitted using the standard convention of na.action = na.exclude.

Where the model fitting function doesn't have an na.action argument, perhaps the augment() method could add an argument which would allow this NA preserving feature?

from broom.

alexpghayes avatar alexpghayes commented on July 19, 2024

Dave and I talk about this earlier and we've decided to strictly enforce:

  • glance returns a single row summarizing model level information
  • augment returns a single row for each observation present in data or newdata, and if neither of those are present, for each observation present in the original training data. When there's missing data for a particular row, the NA will get propagated to .fitted and any other relevant columns.

from broom.

alexpghayes avatar alexpghayes commented on July 19, 2024

This has now been codified in the strict version of the check_augment_function() test. Very few of the strict tests are passing at the moment, but we're about to start making changes so that they do. Sorry about the delays on this, and thanks for your patience.

from broom.

github-actions avatar github-actions commented on July 19, 2024

This issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with a reprex: https://reprex.tidyverse.org) and link to this issue.

from broom.

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.