Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@jakob-r
Copy link
Member

@jakob-r jakob-r commented Oct 26, 2020

General problem: New factor levels appeared during prediction.

Behaviour: fix.factors.prediction = TRUE will convert new factors to NAs

Concrete problem: There is no warning that this happens.

More concrete problem: Some learners (eg. ksvm) will just drop rows with NAs in prediction, leading to fewer predictions than in newdata. (#2771)

Less heavy problem: Some learners (eg. ranger) will complain about NAs, but the user does not now where these are comming from (#2611)

Solution: Create a warning, when NAs are created, throw an error if prediction has not the right number of items. Both in combination will hopefully give the user a clue of what is happening.

Also related: #2602

@pat-s
Copy link
Member

pat-s commented Oct 28, 2020

Thanks @jakob-r! Could you also add a descriptive NEWS entry for this?

@jakob-r
Copy link
Member Author

jakob-r commented Oct 28, 2020

done.

Copy link
Member

@pat-s pat-s left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. LGTM.

@pat-s pat-s merged commit 7d2138f into master Oct 28, 2020
@pat-s pat-s deleted the fix2771__factor_na branch October 28, 2020 16:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants