topepo / FES

Code and Resources for "Feature Engineering and Selection: A Practical Approach for Predictive Models" by Kuhn and Johnson
https://bookdown.org/max/FES
GNU General Public License v2.0
716 stars 235 forks source link

Trouble with plotting roc curve(yardstick) in some models #93

Open lucaszago opened 4 years ago

lucaszago commented 4 years ago

Thanks for giving us feedback on the book. Please follow these guidelines:

Comments or questions on the content

Please tell us where exactly the issue is (e.g. chapter, section, figure number, etc.) and, whenever possible, copy/paste the text in question using > in the issue. Also, please state the version of the book by referencing the date on the book's first page (under the title and authors).

See this issue as an example:

In the version dated "2018-05-12", capitalization in article/book names are inconsistent. Also, sometimes initials are used for names, sometimes not: 

> Agresti, Alan. 2012. Categorical Data Analysis. Wiley-Interscience.
> Altman, D. 1991. “Categorising Continuous Variables.” British Journal of Cancer, no. 5:975.
lucaszago commented 4 years ago

I`m new in r, and I was not really sure which place I could post my doubt:

I was trying to do a roc curve for 2 models:

knn_res %>% unnest(.predictions) %>% mutate(model ="kknn") %>% #adicionando uma coluna bind_rows(tree_res %>% unnest(.predictions) %>% mutate(model ="rpart")) %>% group_by(model) %>% roc_curve(new_renda, .pred_abaixo) %>% autoplot()

And I received this error: Error in roc.default(response = integer(0), predictor = numeric(0), levels = c("acima", : No control observation.

Could you help me how to solve it?