-
Notifications
You must be signed in to change notification settings - Fork 89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
kknn engine fails with factors without calling library(kknn) #410
Comments
This is the same as #264. Do you mind adding any new info you have to that issue, instead of opening a new one? And/or adding a ➕ or 👍 ? |
This is a problem with that specific package. See KlausVigo/kknn#16. I have a few issues and PRs there (some from 2018) but no action to date. |
My apologies for not finding the previous issue report. That is exactly the issue I reported and it seems well described with an example. I have nothing to add other than a 👍, which I did
Thanks for a great modeling environment. I am updating my grad machine learning course this spring to switch from caret to tidy models. I loved caret but I really love tidy models so far.
much appreciated
John
John J. Curtin, Ph.D.
Professor and
Director of Clinical Training
Department of Psychology
University of Wisconsin-Madison
1202 West Johnson St
Madison, WI 53706
608-262-0387
https://arc.psych.wisc.edu<https://arc.psych.wisc.edu/>
https://uwmadison.zoom.us/j/6082176221
pronouns: he/him/his
…________________________________
From: Julia Silge <[email protected]>
Sent: Wednesday, January 13, 2021 1:10 PM
To: tidymodels/parsnip <[email protected]>
Cc: JOHN J CURTIN <[email protected]>; Author <[email protected]>
Subject: Re: [tidymodels/parsnip] kknn engine fails with factors without calling library(kknn) (#410)
This is the same as #264<#264>. Do you mind adding any new info you have to that issue, instead of opening a new one? And/or adding a ➕ or 👍 ?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#410 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AFKEGFER7GXY7KMMH5MFU6LSZXV3DANCNFSM4WBILANQ>.
|
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. |
There appears to be a problem when using nearest_neighbor() and the kknn engine with factors that have not been converted to dummy features using a recipe. By default, train.kknn() will convert factors to dummy coded features (see its contrasts argument). However, it uses its own contrast function to do this - contr.dummy(). This function is not available when using nearest_neighbor() unless the user explicitly also loads the kknn package.
The code below reproduces this error. If you add library(kknn) at the top of the code, the error is resolved. It seems that contr.dummy() needs to be available when using tidymodels with kknn engine. Thanks for looking into this
The text was updated successfully, but these errors were encountered: