{"id":337947,"date":"2022-09-05T15:00:30","date_gmt":"2022-09-05T15:00:30","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=337947"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=337947","title":{"rendered":"<span>\u041b\u043e\u0433\u0438\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e\u00a0tidymodels<\/span>"},"content":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0412 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u044f \u043f\u0443\u0431\u043b\u0438\u043a\u0443\u044e \u0437\u0430\u043c\u0435\u0442\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u0443\u044e\u0442 \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 \u043f\u0430\u043a\u0435\u0442\u043e\u043c\u00a0<code>tidymodels<\/code>\u00a0. \u042f \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u044e \u043a\u0430\u043a \u043f\u0440\u043e\u0441\u0442\u044b\u0435, \u0442\u0430\u043a \u0438 \u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u0435 \u043c\u043e\u0434\u0435\u043b\u0438. \u0421\u0435\u0433\u043e\u0434\u043d\u044f\u0448\u043d\u044f\u044f \u0437\u0430\u043c\u0435\u0442\u043a\u0430 \u043f\u043e\u0434\u043e\u0439\u0434\u0435\u0442 \u0442\u0435\u043c, \u043a\u0442\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442 \u0441\u0432\u043e\u0435 \u0437\u043d\u0430\u043a\u043e\u043c\u0441\u0442\u0432\u043e \u0441 \u043f\u0430\u043a\u0435\u0442\u043e\u043c\u00a0<code>tidymodels<\/code>.\u00a0<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/f6e\/116\/eaa\/f6e116eaaea5ec209cd8916206130485.png\" width=\"3000\" height=\"1790\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f6e\/116\/eaa\/f6e116eaaea5ec209cd8916206130485.png\"\/><figcaption><\/figcaption><\/figure>\n<h2>\u0417\u043d\u0430\u043a\u043e\u043c\u0438\u043c\u0441\u044f \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438<\/h2>\n<p>\u041c\u044b \u0431\u0443\u0434\u0435\u043c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u043d\u0430\u0431\u043e\u0440\u043e\u043c \u0434\u0430\u043d\u043d\u044b\u0445, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u043f\u0438\u043d\u0433\u0432\u0438\u043d\u0430\u0445, \u0436\u0438\u0432\u0443\u0449\u0438\u0445 \u043d\u0430 \u0430\u0440\u0445\u0438\u043f\u0435\u043b\u0430\u0433\u0435 \u041f\u0430\u043b\u043c\u0435\u0440\u0430. \u041d\u0430\u0448\u0430 \u0437\u0430\u0434\u0430\u0447\u0430 \u2014 \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043f\u043e\u043b \u043f\u0438\u043d\u0433\u0432\u0438\u043d\u043e\u0432. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u044c \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438.\u00a0<\/p>\n<pre><code class=\"r\">library(tidyverse) library(palmerpenguins)  penguins<\/code><\/pre>\n<pre><code># A tibble: 344 \u00d7 8    species island    bill_length_mm bill_depth_mm flipper_length_mm body_mass_g sex       &lt;fct>   &lt;fct>              &lt;dbl>         &lt;dbl>             &lt;int>       &lt;int> &lt;fct>   1 Adelie  Torgersen           39.1          18.7               181        3750 male    2 Adelie  Torgersen           39.5          17.4               186        3800 female  3 Adelie  Torgersen           40.3          18                 195        3250 female  4 Adelie  Torgersen           NA            NA                  NA          NA NA      5 Adelie  Torgersen           36.7          19.3               193        3450 female  6 Adelie  Torgersen           39.3          20.6               190        3650 male    7 Adelie  Torgersen           38.9          17.8               181        3625 female  8 Adelie  Torgersen           39.2          19.6               195        4675 male    9 Adelie  Torgersen           34.1          18.1               193        3475 NA     10 Adelie  Torgersen           42            20.2               190        4250 NA     # \u2026 with 334 more rows, and 1 more variable: year &lt;int><\/code><\/pre>\n<p>\u0412 \u043d\u0430\u0448\u0435\u043c \u0434\u0430\u0442\u0430\u0441\u0435\u0442\u0435 \u0435\u0441\u0442\u044c \u0442\u0430\u043a\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043a\u0430\u043a:<\/p>\n<ul>\n<li>\n<p><code>species<\/code>\u00a0&#8212; \u0432\u0438\u0434 \u043f\u0438\u043d\u0433\u0432\u0438\u043d\u0430;<\/p>\n<\/li>\n<li>\n<p><code>island<\/code>\u00a0\u2014 \u043e\u0441\u0442\u0440\u043e\u0432, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043e\u0431\u0438\u0442\u0430\u0435\u0442 \u043e\u0441\u043e\u0431\u044c;<\/p>\n<\/li>\n<li>\n<p><code>bill_length_mm<\/code>\u00a0\u2014 \u0434\u043b\u0438\u043d\u0430 \u043a\u043b\u044e\u0432\u0430;<\/p>\n<\/li>\n<li>\n<p><code>bill_depth_mm<\/code>\u00a0\u2014 \u0433\u043b\u0443\u0431\u0438\u043d\u0430 \u043a\u043b\u044e\u0432\u0430;<\/p>\n<\/li>\n<li>\n<p><code>flipper_length_mm<\/code>\u00a0\u2014 \u0434\u043b\u0438\u043d\u0430 \u043f\u043b\u0430\u0432\u043d\u0438\u043a\u0430;<\/p>\n<\/li>\n<li>\n<p><code>body_mass_g<\/code>\u00a0\u2014 \u043c\u0430\u0441\u0441\u0430 \u0442\u0435\u043b\u0430;<\/p>\n<\/li>\n<li>\n<p><code>sex<\/code>\u00a0\u2014 \u043f\u043e\u043b;<\/p>\n<\/li>\n<li>\n<p><code>year<\/code>\u00a0\u2014 \u0433\u043e\u0434 \u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u044f.<\/p>\n<\/li>\n<\/ul>\n<p>\u0425\u043e\u0447\u0443 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u043c\u044b \u0440\u0435\u0448\u0438\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u044c \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0434\u043b\u044f \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u043d\u0438\u044f \u0432\u0438\u0434\u0430 \u043f\u0438\u043d\u0433\u0432\u0438\u043d\u0430, \u0442\u043e \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u043c, \u0447\u0442\u043e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043e \u043a\u043b\u044e\u0432\u0435 \u0438 \u043c\u0430\u0441\u0441\u0435 \u0442\u0435\u043b\u0430 \u0434\u0430\u044e\u0442 \u0432\u044b\u0441\u043e\u043a\u0443\u044e \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u043e\u0433\u043d\u043e\u0437\u0430. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u044b \u0441\u043e\u0441\u0440\u0435\u0434\u043e\u0442\u043e\u0447\u0438\u043c\u0441\u044f \u043d\u0430 \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u043d\u0438\u0438 \u043f\u043e\u043b\u0430 \u043e\u0441\u043e\u0431\u0438, \u0442\u0430\u043a \u043a\u0430\u043a \u044d\u0442\u0430 \u0437\u0430\u0434\u0430\u0447\u0430 \u0447\u0443\u0442\u044c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0435\u0439.<\/p>\n<p>\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u043f\u043e\u043b\u0430 \u043e\u0441\u043e\u0431\u0438:<\/p>\n<pre><code class=\"r\">penguins %>%    count(sex)<\/code><\/pre>\n<pre><code># A tibble: 3 \u00d7 2   sex        n   &lt;fct>  &lt;int> 1 female   165 2 male     168 3 NA        11<\/code><\/pre>\n<p>\u0412 \u043d\u0430\u0448\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0435\u0441\u0442\u044c 11 \u043f\u0440\u043e\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439, \u0447\u0442\u043e, \u0432 \u0446\u0435\u043b\u043e\u043c, \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043a\u0440\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043e\u0439 \u0434\u043b\u044f \u043d\u0430\u0441.<\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u043d\u0430\u0448\u0438 \u0434\u0430\u043d\u043d\u044b\u0435:<\/p>\n<pre><code class=\"r\">penguins %>%   #\u0438\u0441\u043a\u043b\u044e\u0447\u0438\u043c \u043f\u0440\u043e\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f   filter(!is.na(sex)) %>%    ggplot(aes(flipper_length_mm,              bill_length_mm,              color = sex,              size = body_mass_g)) +   geom_point(alpha = 0.5) +   facet_wrap(~species) +   theme_light()<\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/789\/324\/4d8\/7893244d8f146cd3cc6a4d9a60dca41d.png\" width=\"5840\" height=\"4131\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/789\/324\/4d8\/7893244d8f146cd3cc6a4d9a60dca41d.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u041f\u043e\u0445\u043e\u0436\u0435, \u0447\u0442\u043e \u0441\u0430\u043c\u043a\u0438 \u0431\u043e\u043b\u0435\u0435 \u043c\u0435\u043b\u043a\u0438\u0435, \u0447\u0435\u043c \u043e\u0441\u043e\u0431\u0438 \u043c\u0443\u0436\u0441\u043a\u043e\u0433\u043e \u043f\u043e\u043b\u0430. \u0427\u0442\u043e, \u0432 \u0446\u0435\u043b\u043e\u043c, \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u043e. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u043c \u043a \u043d\u0430\u0448\u0435\u043c\u0443 \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044e. \u0421\u0442\u043e\u0438\u0442 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u043c\u044b \u043d\u0435 \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435\u00a0<code>island<\/code>\u00a0\u0438\u00a0<code>year<\/code>.<\/p>\n<pre><code class=\"r\">penguins_df &lt;- penguins %>%    #\u0423\u0434\u0430\u043b\u0438\u043c \u0438\u0437 \u043d\u0430\u0448\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u0440\u043e\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f   filter(!is.na(sex)) %>%   #\u0423\u0434\u0430\u043b\u0438\u043c \u0438\u0437 \u043d\u0430\u0448\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 island \u0438 year   select(-year, -island)<\/code><\/pre>\n<h2>\u041f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0438<\/h2>\n<p>\u041d\u0430\u0447\u043d\u0435\u043c \u043d\u0430\u0448\u0435 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 \u0441 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043f\u0430\u043a\u0435\u0442\u0430\u00a0<code>tidymodels<\/code> \u0438 \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0430 \u0442\u0435\u0441\u0442\u043e\u0432\u0443\u044e \u0438 \u043e\u0431\u0443\u0447\u0430\u044e\u0449\u0443\u044e \u0432\u044b\u0431\u043e\u0440\u043a\u0438.\u00a0<\/p>\n<pre><code class=\"r\">library(tidymodels)  set.seed(123) # \u041c\u044b \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u043c \u043d\u0430\u0448\u0443 \u0432\u044b\u0431\u043e\u0440\u043a\u0443 \u043f\u043e \u043f\u043e\u043b\u0443, \u0447\u0442\u043e\u0431\u044b \u0441\u043e\u0431\u043b\u044e\u0441\u0442\u0438 \u043f\u0440\u043e\u043f\u043e\u0440\u0446\u0438\u0438 \u0441\u0430\u043c\u0446\u043e\u0432 \u0438 \u0441\u0430\u043c\u043e\u043a penguin_split &lt;- initial_split(penguins_df, strata = sex)  penguin_train &lt;- training(penguin_split) penguin_test &lt;- testing(penguin_split)<\/code><\/pre>\n<p>\u0422\u0430\u043a \u043a\u0430\u043a \u0443 \u043d\u0430\u0441 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u0439 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043d\u0430\u0431\u043e\u0440 \u0434\u0430\u043d\u043d\u044b\u0445 \u0441 \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e\u0439 \u0432\u044b\u0431\u043e\u0440\u043a\u043e\u0439.<\/p>\n<pre><code class=\"r\">set.seed(123) penguin_boot &lt;- bootstraps(penguin_train) penguin_boot<\/code><\/pre>\n<pre><code># Bootstrap sampling  # A tibble: 25 \u00d7 2    splits           id             &lt;list>           &lt;chr>        1 &lt;split [249\/93]> Bootstrap01  2 &lt;split [249\/91]> Bootstrap02  3 &lt;split [249\/90]> Bootstrap03  4 &lt;split [249\/91]> Bootstrap04  5 &lt;split [249\/85]> Bootstrap05  6 &lt;split [249\/87]> Bootstrap06  7 &lt;split [249\/94]> Bootstrap07  8 &lt;split [249\/88]> Bootstrap08  9 &lt;split [249\/95]> Bootstrap09 10 &lt;split [249\/89]> Bootstrap10 # \u2026 with 15 more rows<\/code><\/pre>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0441\u0440\u0430\u0432\u043d\u0438\u043c \u0434\u0432\u0435 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u043c\u043e\u0434\u0435\u043b\u0438: \u043c\u043e\u0434\u0435\u043b\u044c \u043b\u043e\u0433\u0438\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u0438 \u0438 \u043c\u043e\u0434\u0435\u043b\u044c \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u0433\u043e \u043b\u0435\u0441\u0430. \u041d\u0430\u0447\u043d\u0435\u043c \u0441 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0439 \u043c\u043e\u0434\u0435\u043b\u0435\u0439.<\/p>\n<pre><code class=\"r\"># \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f \u0434\u043b\u044f \u043b\u043e\u0433\u0438\u0441\u0442\u0438\u0447\u0441\u0435\u043a\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 glm_spec &lt;- logistic_reg() %>%   set_engine(\"glm\")  glm_spec<\/code><\/pre>\n<pre><code>Logistic Regression Model Specification (classification)  Computational engine: glm <\/code><\/pre>\n<pre><code class=\"r\"># \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f \u0434\u043b\u044f \u043c\u043e\u0434\u0435\u043b\u0438 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u0433\u043e \u043b\u0435\u0441\u0430 rf_spec &lt;- rand_forest() %>%   set_mode(\"classification\") %>%   set_engine(\"ranger\")  rf_spec<\/code><\/pre>\n<pre><code>Random Forest Model Specification (classification)  Computational engine: ranger <\/code><\/pre>\n<p>\u0421\u0435\u0439\u0447\u0430\u0441 \u044d\u0442\u043e \u043f\u0443\u0441\u0442\u044b\u0435 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u043c\u043e\u0434\u0435\u043b\u0438, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043d\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0445. \u041d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u201c\u0441\u043e\u0431\u0440\u0430\u0442\u044c\u201d \u043c\u043e\u0434\u0435\u043b\u044c \u0438 \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e\u00a0<code>workflow()<\/code><\/p>\n<p>\u041d\u0430 \u043f\u0435\u0440\u0432\u043e\u043c \u0448\u0430\u0433\u0435 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0444\u043e\u0440\u043c\u0443\u043b\u0443, \u0433\u0434\u0435 \u043c\u044b \u0432\u044b\u0431\u0435\u0440\u0435\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u043d\u0438\u044f \u043f\u043e\u043b\u0430 \u043e\u0441\u043e\u0431\u0438.<\/p>\n<pre><code class=\"r\">penguin_wf &lt;- workflow() %>%   add_formula(sex ~ .) # \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u0441\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u043d\u0438\u044f \u043f\u043e\u043b\u0430 \u043e\u0441\u043e\u0431\u0438  penguin_wf<\/code><\/pre>\n<pre><code>\u2550\u2550 Workflow \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550 Preprocessor: Formula Model: None  \u2500\u2500 Preprocessor \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 sex ~ .<\/code><\/pre>\n<p>\u041d\u0430 \u0432\u0442\u043e\u0440\u043e\u043c \u0448\u0430\u0433\u0435, \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e \u043c\u043e\u0434\u0435\u043b\u0438. \u041d\u0430\u0447\u043d\u0435\u043c \u0441 \u043b\u043e\u0433\u0438\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u0438.\u00a0<\/p>\n<pre><code class=\"r\">glm_rs &lt;- penguin_wf %>%   add_model(glm_spec) %>%   fit_resamples(     resamples = penguin_boot,     control = control_resamples(save_pred = TRUE)   )  glm_rs<\/code><\/pre>\n<pre><code># Resampling results # Bootstrap sampling  # A tibble: 25 \u00d7 5    splits           id          .metrics         .notes           .predictions         &lt;list>           &lt;chr>       &lt;list>           &lt;list>           &lt;list>             1 &lt;split [249\/93]> Bootstrap01 &lt;tibble [2 \u00d7 4]> &lt;tibble [0 \u00d7 3]> &lt;tibble [93 \u00d7 6]>  2 &lt;split [249\/91]> Bootstrap02 &lt;tibble [2 \u00d7 4]> &lt;tibble [0 \u00d7 3]> &lt;tibble [91 \u00d7 6]>  3 &lt;split [249\/90]> Bootstrap03 &lt;tibble [2 \u00d7 4]> &lt;tibble [0 \u00d7 3]> &lt;tibble [90 \u00d7 6]>  4 &lt;split [249\/91]> Bootstrap04 &lt;tibble [2 \u00d7 4]> &lt;tibble [0 \u00d7 3]> &lt;tibble [91 \u00d7 6]>  5 &lt;split [249\/85]> Bootstrap05 &lt;tibble [2 \u00d7 4]> &lt;tibble [1 \u00d7 3]> &lt;tibble [85 \u00d7 6]>  6 &lt;split [249\/87]> Bootstrap06 &lt;tibble [2 \u00d7 4]> &lt;tibble [0 \u00d7 3]> &lt;tibble [87 \u00d7 6]>  7 &lt;split [249\/94]> Bootstrap07 &lt;tibble [2 \u00d7 4]> &lt;tibble [0 \u00d7 3]> &lt;tibble [94 \u00d7 6]>  8 &lt;split [249\/88]> Bootstrap08 &lt;tibble [2 \u00d7 4]> &lt;tibble [1 \u00d7 3]> &lt;tibble [88 \u00d7 6]>  9 &lt;split [249\/95]> Bootstrap09 &lt;tibble [2 \u00d7 4]> &lt;tibble [0 \u00d7 3]> &lt;tibble [95 \u00d7 6]> 10 &lt;split [249\/89]> Bootstrap10 &lt;tibble [2 \u00d7 4]> &lt;tibble [0 \u00d7 3]> &lt;tibble [89 \u00d7 6]> # \u2026 with 15 more rows<\/code><\/pre>\n<p>\u0421\u0434\u0435\u043b\u0430\u0435\u043c \u0442\u043e\u0436\u0435 \u0441\u0430\u043c\u043e\u0435 \u0434\u043b\u044f \u043c\u043e\u0434\u0435\u043b\u0438 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u0433\u043e \u043b\u0435\u0441\u0430:<\/p>\n<pre><code class=\"r\">rf_rs &lt;- penguin_wf %>%   add_model(rf_spec) %>%   fit_resamples(     resamples = penguin_boot,     control = control_resamples(save_pred = TRUE)   )  rf_rs<\/code><\/pre>\n<pre><code># Resampling results # Bootstrap sampling  # A tibble: 25 \u00d7 5    splits           id          .metrics         .notes           .predictions         &lt;list>           &lt;chr>       &lt;list>           &lt;list>           &lt;list>             1 &lt;split [249\/93]> Bootstrap01 &lt;tibble [2 \u00d7 4]> &lt;tibble [0 \u00d7 3]> &lt;tibble [93 \u00d7 6]>  2 &lt;split [249\/91]> Bootstrap02 &lt;tibble [2 \u00d7 4]> &lt;tibble [0 \u00d7 3]> &lt;tibble [91 \u00d7 6]>  3 &lt;split [249\/90]> Bootstrap03 &lt;tibble [2 \u00d7 4]> &lt;tibble [0 \u00d7 3]> &lt;tibble [90 \u00d7 6]>  4 &lt;split [249\/91]> Bootstrap04 &lt;tibble [2 \u00d7 4]> &lt;tibble [0 \u00d7 3]> &lt;tibble [91 \u00d7 6]>  5 &lt;split [249\/85]> Bootstrap05 &lt;tibble [2 \u00d7 4]> &lt;tibble [0 \u00d7 3]> &lt;tibble [85 \u00d7 6]>  6 &lt;split [249\/87]> Bootstrap06 &lt;tibble [2 \u00d7 4]> &lt;tibble [0 \u00d7 3]> &lt;tibble [87 \u00d7 6]>  7 &lt;split [249\/94]> Bootstrap07 &lt;tibble [2 \u00d7 4]> &lt;tibble [0 \u00d7 3]> &lt;tibble [94 \u00d7 6]>  8 &lt;split [249\/88]> Bootstrap08 &lt;tibble [2 \u00d7 4]> &lt;tibble [0 \u00d7 3]> &lt;tibble [88 \u00d7 6]>  9 &lt;split [249\/95]> Bootstrap09 &lt;tibble [2 \u00d7 4]> &lt;tibble [0 \u00d7 3]> &lt;tibble [95 \u00d7 6]> 10 &lt;split [249\/89]> Bootstrap10 &lt;tibble [2 \u00d7 4]> &lt;tibble [0 \u00d7 3]> &lt;tibble [89 \u00d7 6]> # \u2026 with 15 more rows<\/code><\/pre>\n<h2>\u041e\u0446\u0435\u043d\u0438\u0432\u0430\u0435\u043c \u043c\u043e\u0434\u0435\u043b\u044c<\/h2>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043c, \u0447\u0442\u043e \u0443 \u043d\u0430\u0441 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c. <\/p>\n<p>\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043c\u0435\u0442\u0440\u0438\u043a\u0438 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438 \u0434\u043b\u044f \u043c\u043e\u0434\u0435\u043b\u0438 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u0433\u043e \u043b\u0435\u0441\u0430:<\/p>\n<pre><code class=\"r\">collect_metrics(rf_rs)<\/code><\/pre>\n<pre><code># A tibble: 2 \u00d7 6   .metric  .estimator  mean     n std_err .config                &lt;chr>    &lt;chr>      &lt;dbl> &lt;int>   &lt;dbl> &lt;chr>                1 accuracy binary     0.914    25 0.00545 Preprocessor1_Model1 2 roc_auc  binary     0.977    25 0.00202 Preprocessor1_Model1<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043c\u0435\u0442\u0440\u0438\u043a\u0438 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438 \u0434\u043b\u044f \u043b\u043e\u0433\u0438\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u0438:<\/p>\n<pre><code class=\"r\">collect_metrics(glm_rs)<\/code><\/pre>\n<pre><code># A tibble: 2 \u00d7 6   .metric  .estimator  mean     n std_err .config                &lt;chr>    &lt;chr>      &lt;dbl> &lt;int>   &lt;dbl> &lt;chr>                1 accuracy binary     0.918    25 0.00639 Preprocessor1_Model1 2 roc_auc  binary     0.979    25 0.00254 Preprocessor1_Model1<\/code><\/pre>\n<p>\u041c\u044b \u0432\u0438\u0434\u0438\u043c, \u0447\u0442\u043e \u043c\u043e\u0434\u0435\u043b\u044c\u00a0<code>glm_rs<\/code>\u0441\u0440\u0430\u0431\u043e\u0442\u0430\u043b\u0430 \u0447\u0443\u0442\u044c \u043b\u0443\u0447\u0448\u0435, \u0447\u0435\u043c \u043c\u043e\u0434\u0435\u043b\u044c\u00a0<code>rf_rs<\/code>. \u0423\u0447\u0438\u0442\u044b\u0432\u0430\u044f, \u0447\u0442\u043e \u044d\u0442\u0438 \u043c\u043e\u0434\u0435\u043b\u0438 \u0434\u0430\u044e\u0442 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442, \u0435\u0441\u0442\u044c \u0441\u043c\u044b\u0441\u043b \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u0442\u0443, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e \u0441\u0432\u043e\u0435\u0439 \u0441\u0443\u0442\u0438 \u043f\u0440\u043e\u0449\u0435. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u044b \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c\u0441\u044f \u043d\u0430 \u043c\u043e\u0434\u0435\u043b\u0438 \u043b\u043e\u0433\u0438\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u0438.<\/p>\n<p>\u041f\u043e\u0441\u0442\u0440\u043e\u0438\u043c \u043c\u0430\u0442\u0440\u0438\u0446\u0443 \u043e\u0448\u0438\u0431\u043e\u043a:<\/p>\n<pre><code class=\"r\">glm_rs %>%   conf_mat_resampled()<\/code><\/pre>\n<pre><code># A tibble: 4 \u00d7 3   Prediction Truth   Freq   &lt;fct>      &lt;fct>  &lt;dbl> 1 female     female  41.1 2 female     male     3   3 male       female   4.4 4 male       male    42.3<\/code><\/pre>\n<p>\u041c\u044b \u0432\u0438\u0434\u0438\u043c, \u0447\u0442\u043e \u0443 \u043d\u0430\u0441 \u043d\u0435\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0441 \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u043d\u0438\u0435\u043c \u043f\u043e\u043b\u0430 \u043e\u0441\u043e\u0431\u0438. \u041c\u043e\u0434\u0435\u043b\u044c \u0441\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0445\u043e\u0440\u043e\u0448\u043e.<\/p>\n<p>\u041e\u0434\u043d\u0438\u043c \u0438\u0437 \u043d\u0430\u0448\u0438\u0445 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0435\u0439 \u0431\u044b\u043b\u00a0<code>roc_auc<\/code>\u00a0\u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0431\u044b\u043b\u043e \u0431\u044b \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430\u00a0<a href=\"https:\/\/ru.wikipedia.org\/wiki\/ROC-%D0%BA%D1%80%D0%B8%D0%B2%D0%B0%D1%8F\" rel=\"noopener noreferrer nofollow\">ROC-\u043a\u0440\u0438\u0432\u044b\u0435<\/a>.<\/p>\n<pre><code class=\"r\">glm_rs %>%   collect_predictions() %>%   group_by(id) %>%   roc_curve(sex, .pred_female) %>%   ggplot(aes(1 - specificity, sensitivity, color = id)) +   geom_abline(lty = 2, color = \"gray80\", size = 1.5) +   geom_path(show.legend = FALSE, alpha = 0.6, size = 1.2) +   coord_equal() +   theme_light()<\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/e31\/fa2\/179\/e31fa2179b29e1fd034d9202d5ae8b53.png\" width=\"5840\" height=\"4131\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/e31\/fa2\/179\/e31fa2179b29e1fd034d9202d5ae8b53.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u041c\u044b \u0432\u0438\u0434\u0438\u043c, \u0447\u0442\u043e ROC-\u043a\u0440\u0438\u0432\u0430\u044f \u0441\u0442\u0443\u043f\u0435\u043d\u0447\u0430\u0442\u0430\u044f \u2014 \u044d\u0442\u043e \u0441\u0432\u044f\u0437\u0430\u043d\u043e \u0441 \u0442\u0435\u043c, \u0447\u0442\u043e \u0443 \u043d\u0430\u0441 \u043d\u0435 \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043d\u0430\u0431\u043e\u0440 \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0432\u0435\u0440\u043d\u0443\u0442\u044c\u0441\u044f \u043a \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u043c\u0443 \u043d\u0430\u0431\u043e\u0440\u0443. \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u043c\u044b \u0435\u0449\u0435 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 \u0442\u0435\u0441\u0442\u043e\u0432\u0443\u044e \u0432\u044b\u0431\u043e\u0440\u043a\u0443. \u0415\u0435 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u043e\u0446\u0435\u043d\u043a\u0438 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043c\u043e\u0434\u0435\u043b\u0438 \u043d\u0430 \u043d\u043e\u0432\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<pre><code class=\"r\">penguin_final &lt;- penguin_wf %>%   add_model(glm_spec) %>%   last_fit(penguin_split)  penguin_final<\/code><\/pre>\n<pre><code># Resampling results # Manual resampling  # A tibble: 1 \u00d7 6   splits           id               .metrics         .notes   .predictions .workflow    &lt;list>           &lt;chr>            &lt;list>           &lt;list>   &lt;list>       &lt;list>     1 &lt;split [249\/84]> train\/test split &lt;tibble [2 \u00d7 4]> &lt;tibble> &lt;tibble>     &lt;workflow><\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430 \u043e\u0446\u0435\u043d\u043a\u0438 \u043c\u043e\u0434\u0435\u043b\u0438 \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0433\u043e \u043d\u0430\u0431\u043e\u0440\u0430 \u0434\u0430\u043d\u043d\u044b\u0445:<\/p>\n<pre><code class=\"r\">collect_metrics(penguin_final)<\/code><\/pre>\n<pre><code># A tibble: 2 \u00d7 4   .metric  .estimator .estimate .config                &lt;chr>    &lt;chr>          &lt;dbl> &lt;chr>                1 accuracy binary         0.857 Preprocessor1_Model1 2 roc_auc  binary         0.938 Preprocessor1_Model1<\/code><\/pre>\n<p>\u041c\u044b \u0432\u0438\u0434\u0438\u043c, \u0447\u0442\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043d\u0435 \u0441\u0438\u043b\u044c\u043d\u043e \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442 \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0432\u044b\u0448\u0435, \u0447\u0442\u043e \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0445\u043e\u0440\u043e\u0448\u0438\u043c \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u043c.<\/p>\n<p>\u041c\u044b \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u0435\u043c \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430 \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0438 \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043c\u0430\u0442\u0440\u0438\u0446\u0443 \u043e\u0448\u0438\u0431\u043e\u043a.<\/p>\n<pre><code class=\"r\">collect_predictions(penguin_final)<\/code><\/pre>\n<pre><code># A tibble: 84 \u00d7 7    id               .pred_female .pred_male  .row .pred_class sex    .config              &lt;chr>                   &lt;dbl>      &lt;dbl> &lt;int> &lt;fct>       &lt;fct>  &lt;chr>              1 train\/test split   0.597         0.403       2 female      female Preprocessor1_Mo\u2026  2 train\/test split   0.928         0.0724      3 female      female Preprocessor1_Mo\u2026  3 train\/test split   0.647         0.353       4 female      female Preprocessor1_Mo\u2026  4 train\/test split   0.219         0.781      18 male        female Preprocessor1_Mo\u2026  5 train\/test split   0.0132        0.987      25 male        male   Preprocessor1_Mo\u2026  6 train\/test split   0.970         0.0298     28 female      female Preprocessor1_Mo\u2026  7 train\/test split   0.0000232     1.00       31 male        male   Preprocessor1_Mo\u2026  8 train\/test split   0.872         0.128      34 female      female Preprocessor1_Mo\u2026  9 train\/test split   0.998         0.00250    38 female      female Preprocessor1_Mo\u2026 10 train\/test split   0.00000253    1.00       39 male        male   Preprocessor1_Mo\u2026 # \u2026 with 74 more rows<\/code><\/pre>\n<p>\u0421\u0442\u0440\u043e\u0438\u043c \u043c\u0430\u0442\u0440\u0438\u0446\u0443 \u043e\u0448\u0438\u0431\u043e\u043a:<\/p>\n<pre><code class=\"r\">collect_predictions(penguin_final) %>%   conf_mat(sex, .pred_class)<\/code><\/pre>\n<pre><code>          Truth Prediction female male     female     37    7     male        5   35<\/code><\/pre>\n<p>\u041c\u044b \u0432\u0438\u0434\u0438\u043c, \u0447\u0442\u043e \u043d\u0430\u0448\u0430 \u043c\u043e\u0434\u0435\u043b\u044c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0445\u043e\u0440\u043e\u0448\u043e \u0441\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430 \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0438\u0439 \u0440\u0430\u0431\u043e\u0447\u0438\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043d\u0430\u0448\u0435\u0439 \u043c\u043e\u0434\u0435\u043b\u0438.<\/p>\n<pre><code class=\"r\">penguin_final$.workflow[[1]]<\/code><\/pre>\n<pre><code>\u2550\u2550 Workflow [trained] \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550 Preprocessor: Formula Model: logistic_reg()  \u2500\u2500 Preprocessor \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 sex ~ .  \u2500\u2500 Model \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500  Call:  stats::glm(formula = ..y ~ ., family = stats::binomial, data = data)  Coefficients:       (Intercept)   speciesChinstrap      speciesGentoo     bill_length_mm          -1.042e+02         -8.892e+00         -1.138e+01          6.459e-01       bill_depth_mm  flipper_length_mm        body_mass_g           2.124e+00          5.654e-02          8.102e-03    Degrees of Freedom: 248 Total (i.e. Null);  242 Residual Null Deviance:    345.2  Residual Deviance: 70.02 AIC: 84.02<\/code><\/pre>\n<p>\u0417\u0434\u0435\u0441\u044c \u043c\u044b \u0432\u0438\u0434\u0438\u043c \u043a\u0430\u043a\u0443\u044e \u043c\u043e\u0434\u0435\u043b\u044c \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u0430\u043d\u043d\u044b\u0435 \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u044b \u043d\u0430\u0448\u0435\u0439 \u043c\u043e\u0434\u0435\u043b\u0438.<\/p>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044e\u00a0<code>tidy()<\/code>\u00a0, \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u044b \u0432 \u0430\u043a\u043a\u0443\u0440\u0430\u0442\u043d\u043e\u043c \u0432\u0438\u0434\u0435. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u00a0<code>exponentiate = TRUE<\/code>\u00a0, \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0432 \u0438\u0445 \u0432 \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u044b \u0448\u0430\u043d\u0441\u043e\u0432.<\/p>\n<pre><code class=\"r\">penguin_final$.workflow[[1]] %>%   tidy(exponentiate = TRUE)<\/code><\/pre>\n<pre><code># A tibble: 7 \u00d7 5   term              estimate std.error statistic     p.value   &lt;chr>                &lt;dbl>     &lt;dbl>     &lt;dbl>       &lt;dbl> 1 (Intercept)       5.75e-46  19.6        -5.31  0.000000110 2 speciesChinstrap  1.37e- 4   2.34       -3.79  0.000148    3 speciesGentoo     1.14e- 5   3.75       -3.03  0.00243     4 bill_length_mm    1.91e+ 0   0.180       3.60  0.000321    5 bill_depth_mm     8.36e+ 0   0.478       4.45  0.00000868  6 flipper_length_mm 1.06e+ 0   0.0611      0.926 0.355       7 body_mass_g       1.01e+ 0   0.00176     4.59  0.00000442 <\/code><\/pre>\n<p>\u041c\u044b \u0432\u0438\u0434\u0438\u043c, \u0447\u0442\u043e \u0433\u043b\u0443\u0431\u0438\u043d\u0430 \u0438 \u0434\u043b\u0438\u043d\u0430 \u043a\u043b\u044e\u0432\u0430 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u043c\u0438 \u043f\u0440\u0435\u0434\u0438\u043a\u0442\u043e\u0440\u0430\u043c\u0438 \u0434\u043b\u044f \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u043f\u043e\u043b\u0430 \u043e\u0441\u043e\u0431\u0438. \u0423\u0432\u0435\u043b\u0438\u0447\u0435\u043d\u0438\u0435 \u0433\u043b\u0443\u0431\u0438\u043d\u044b \u043a\u043b\u044e\u0432\u0430 \u043d\u0430 1 \u043c\u043c \u043f\u043e\u0447\u0442\u0438 \u0432 8 \u0440\u0430\u0437\u0430 \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0435\u0442 \u0448\u0430\u043d\u0441 \u0431\u044b\u0442\u044c \u0441\u0430\u043c\u0446\u043e\u043c.<\/p>\n<p>\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u043d\u0430\u0448 \u0433\u0440\u0430\u0444\u0438\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u0441\u0442\u0440\u043e\u0438\u043b\u0438 \u0432 \u043d\u0430\u0447\u0430\u043b\u0435, \u043d\u043e \u0437\u0430\u043c\u0435\u043d\u0438\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e <code>flipper_length_mm<\/code>\u043d\u0430 <code>bill_depth_mm<\/code>:<\/p>\n<pre><code class=\"r\">penguins %>%   filter(!is.na(sex)) %>%   ggplot(aes(bill_depth_mm,              bill_length_mm,              color = sex,              size = body_mass_g)) +   geom_point(alpha = 0.5) +   facet_wrap(~species) +   theme_light()<\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/2e3\/ab0\/7be\/2e3ab07be6b7abaf81ba024ad57730c0.png\" width=\"5840\" height=\"4131\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/2e3\/ab0\/7be\/2e3ab07be6b7abaf81ba024ad57730c0.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0414\u0430, \u043c\u043e\u0436\u043d\u043e \u0441 \u0443\u0432\u0435\u0440\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f <code>bill_depth_mm<\/code>\u0434\u0435\u043b\u0438\u0442 \u043e\u0441\u043e\u0431\u0435\u0439 \u043f\u043e \u043f\u043e\u043b\u0443 \u0431\u043e\u043b\u0435\u0435 \u0447\u0435\u0442\u043a\u043e.<\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"v-portal\" style=\"display:none;\"><\/div>\n<\/div>\n<p> <!----> <!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/686460\/\"> https:\/\/habr.com\/ru\/post\/686460\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0412 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u044f \u043f\u0443\u0431\u043b\u0438\u043a\u0443\u044e \u0437\u0430\u043c\u0435\u0442\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u0443\u044e\u0442 \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 \u043f\u0430\u043a\u0435\u0442\u043e\u043c\u00a0<code>tidymodels<\/code>\u00a0. \u042f \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u044e \u043a\u0430\u043a \u043f\u0440\u043e\u0441\u0442\u044b\u0435, \u0442\u0430\u043a \u0438 \u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u0435 \u043c\u043e\u0434\u0435\u043b\u0438. \u0421\u0435\u0433\u043e\u0434\u043d\u044f\u0448\u043d\u044f\u044f \u0437\u0430\u043c\u0435\u0442\u043a\u0430 \u043f\u043e\u0434\u043e\u0439\u0434\u0435\u0442 \u0442\u0435\u043c, \u043a\u0442\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442 \u0441\u0432\u043e\u0435 \u0437\u043d\u0430\u043a\u043e\u043c\u0441\u0442\u0432\u043e \u0441 \u043f\u0430\u043a\u0435\u0442\u043e\u043c\u00a0<code>tidymodels<\/code>.\u00a0<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<h2>\u0417\u043d\u0430\u043a\u043e\u043c\u0438\u043c\u0441\u044f \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438<\/h2>\n<p>\u041c\u044b \u0431\u0443\u0434\u0435\u043c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u043d\u0430\u0431\u043e\u0440\u043e\u043c \u0434\u0430\u043d\u043d\u044b\u0445, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u043f\u0438\u043d\u0433\u0432\u0438\u043d\u0430\u0445, \u0436\u0438\u0432\u0443\u0449\u0438\u0445 \u043d\u0430 \u0430\u0440\u0445\u0438\u043f\u0435\u043b\u0430\u0433\u0435 \u041f\u0430\u043b\u043c\u0435\u0440\u0430. \u041d\u0430\u0448\u0430 \u0437\u0430\u0434\u0430\u0447\u0430 \u2014 \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043f\u043e\u043b \u043f\u0438\u043d\u0433\u0432\u0438\u043d\u043e\u0432. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u044c \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438.\u00a0<\/p>\n<pre><code class=\"r\">library(tidyverse) library(palmerpenguins)  penguins<\/code><\/pre>\n<pre><code># A tibble: 344 \u00d7 8    species island    bill_length_mm bill_depth_mm flipper_length_mm body_mass_g sex       &lt;fct>   &lt;fct>              &lt;dbl>         &lt;dbl>             &lt;int>       &lt;int> &lt;fct>   1 Adelie  Torgersen           39.1          18.7               181        3750 male    2 Adelie  Torgersen           39.5          17.4               186        3800 female  3 Adelie  Torgersen           40.3          18                 195        3250 female  4 Adelie  Torgersen           NA            NA                  NA          NA NA      5 Adelie  Torgersen           36.7          19.3               193        3450 female  6 Adelie  Torgersen           39.3          20.6               190        3650 male    7 Adelie  Torgersen           38.9          17.8               181        3625 female  8 Adelie  Torgersen           39.2          19.6               195        4675 male    9 Adelie  Torgersen           34.1          18.1               193        3475 NA     10 Adelie  Torgersen           42            20.2               190        4250 NA     # \u2026 with 334 more rows, and 1 more variable: year &lt;int><\/code><\/pre>\n<p>\u0412 \u043d\u0430\u0448\u0435\u043c \u0434\u0430\u0442\u0430\u0441\u0435\u0442\u0435 \u0435\u0441\u0442\u044c \u0442\u0430\u043a\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043a\u0430\u043a:<\/p>\n<ul>\n<li>\n<p><code>species<\/code>\u00a0&#8212; \u0432\u0438\u0434 \u043f\u0438\u043d\u0433\u0432\u0438\u043d\u0430;<\/p>\n<\/li>\n<li>\n<p><code>island<\/code>\u00a0\u2014 \u043e\u0441\u0442\u0440\u043e\u0432, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043e\u0431\u0438\u0442\u0430\u0435\u0442 \u043e\u0441\u043e\u0431\u044c;<\/p>\n<\/li>\n<li>\n<p><code>bill_length_mm<\/code>\u00a0\u2014 \u0434\u043b\u0438\u043d\u0430 \u043a\u043b\u044e\u0432\u0430;<\/p>\n<\/li>\n<li>\n<p><code>bill_depth_mm<\/code>\u00a0\u2014 \u0433\u043b\u0443\u0431\u0438\u043d\u0430 \u043a\u043b\u044e\u0432\u0430;<\/p>\n<\/li>\n<li>\n<p><code>flipper_length_mm<\/code>\u00a0\u2014 \u0434\u043b\u0438\u043d\u0430 \u043f\u043b\u0430\u0432\u043d\u0438\u043a\u0430;<\/p>\n<\/li>\n<li>\n<p><code>body_mass_g<\/code>\u00a0\u2014 \u043c\u0430\u0441\u0441\u0430 \u0442\u0435\u043b\u0430;<\/p>\n<\/li>\n<li>\n<p><code>sex<\/code>\u00a0\u2014 \u043f\u043e\u043b;<\/p>\n<\/li>\n<li>\n<p><code>year<\/code>\u00a0\u2014 \u0433\u043e\u0434 \u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u044f.<\/p>\n<\/li>\n<\/ul>\n<p>\u0425\u043e\u0447\u0443 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u043c\u044b \u0440\u0435\u0448\u0438\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u044c \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0434\u043b\u044f \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u043d\u0438\u044f \u0432\u0438\u0434\u0430 \u043f\u0438\u043d\u0433\u0432\u0438\u043d\u0430, \u0442\u043e \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u043c, \u0447\u0442\u043e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043e \u043a\u043b\u044e\u0432\u0435 \u0438 \u043c\u0430\u0441\u0441\u0435 \u0442\u0435\u043b\u0430 \u0434\u0430\u044e\u0442 \u0432\u044b\u0441\u043e\u043a\u0443\u044e \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u043e\u0433\u043d\u043e\u0437\u0430. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u044b \u0441\u043e\u0441\u0440\u0435\u0434\u043e\u0442\u043e\u0447\u0438\u043c\u0441\u044f \u043d\u0430 \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u043d\u0438\u0438 \u043f\u043e\u043b\u0430 \u043e\u0441\u043e\u0431\u0438, \u0442\u0430\u043a \u043a\u0430\u043a \u044d\u0442\u0430 \u0437\u0430\u0434\u0430\u0447\u0430 \u0447\u0443\u0442\u044c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0435\u0439.<\/p>\n<p>\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u043f\u043e\u043b\u0430 \u043e\u0441\u043e\u0431\u0438:<\/p>\n<pre><code class=\"r\">penguins %>%    count(sex)<\/code><\/pre>\n<pre><code># A tibble: 3 \u00d7 2   sex        n   &lt;fct>  &lt;int> 1 female   165 2 male     168 3 NA        11<\/code><\/pre>\n<p>\u0412 \u043d\u0430\u0448\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0435\u0441\u0442\u044c 11 \u043f\u0440\u043e\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439, \u0447\u0442\u043e, \u0432 \u0446\u0435\u043b\u043e\u043c, \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043a\u0440\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043e\u0439 \u0434\u043b\u044f \u043d\u0430\u0441.<\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u043d\u0430\u0448\u0438 \u0434\u0430\u043d\u043d\u044b\u0435:<\/p>\n<pre><code class=\"r\">penguins %>%   #\u0438\u0441\u043a\u043b\u044e\u0447\u0438\u043c \u043f\u0440\u043e\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f   filter(!is.na(sex)) %>%    ggplot(aes(flipper_length_mm,              bill_length_mm,              color = sex,              size = body_mass_g)) +   geom_point(alpha = 0.5) +   facet_wrap(~species) +   theme_light()<\/code><\/pre>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u041f\u043e\u0445\u043e\u0436\u0435, \u0447\u0442\u043e \u0441\u0430\u043c\u043a\u0438 \u0431\u043e\u043b\u0435\u0435 \u043c\u0435\u043b\u043a\u0438\u0435, \u0447\u0435\u043c \u043e\u0441\u043e\u0431\u0438 \u043c\u0443\u0436\u0441\u043a\u043e\u0433\u043e \u043f\u043e\u043b\u0430. \u0427\u0442\u043e, \u0432 \u0446\u0435\u043b\u043e\u043c, \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u043e. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u043c \u043a \u043d\u0430\u0448\u0435\u043c\u0443 \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044e. \u0421\u0442\u043e\u0438\u0442 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u043c\u044b \u043d\u0435 \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435\u00a0<code>island<\/code>\u00a0\u0438\u00a0<code>year<\/code>.<\/p>\n<pre><code class=\"r\">penguins_df &lt;- penguins %>%    #\u0423\u0434\u0430\u043b\u0438\u043c \u0438\u0437 \u043d\u0430\u0448\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u0440\u043e\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f   filter(!is.na(sex)) %>%   #\u0423\u0434\u0430\u043b\u0438\u043c \u0438\u0437 \u043d\u0430\u0448\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 island \u0438 year   select(-year, -island)<\/code><\/pre>\n<h2>\u041f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0438<\/h2>\n<p>\u041d\u0430\u0447\u043d\u0435\u043c \u043d\u0430\u0448\u0435 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 \u0441 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043f\u0430\u043a\u0435\u0442\u0430\u00a0<code>tidymodels<\/code> \u0438 \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0430 \u0442\u0435\u0441\u0442\u043e\u0432\u0443\u044e \u0438 \u043e\u0431\u0443\u0447\u0430\u044e\u0449\u0443\u044e \u0432\u044b\u0431\u043e\u0440\u043a\u0438.\u00a0<\/p>\n<pre><code class=\"r\">library(tidymodels)  set.seed(123) # \u041c\u044b \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u043c \u043d\u0430\u0448\u0443 \u0432\u044b\u0431\u043e\u0440\u043a\u0443 \u043f\u043e \u043f\u043e\u043b\u0443, \u0447\u0442\u043e\u0431\u044b \u0441\u043e\u0431\u043b\u044e\u0441\u0442\u0438 \u043f\u0440\u043e\u043f\u043e\u0440\u0446\u0438\u0438 \u0441\u0430\u043c\u0446\u043e\u0432 \u0438 \u0441\u0430\u043c\u043e\u043a penguin_split &lt;- initial_split(penguins_df, strata = sex)  penguin_train &lt;- training(penguin_split) penguin_test &lt;- testing(penguin_split)<\/code><\/pre>\n<p>\u0422\u0430\u043a \u043a\u0430\u043a \u0443 \u043d\u0430\u0441 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u0439 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043d\u0430\u0431\u043e\u0440 \u0434\u0430\u043d\u043d\u044b\u0445 \u0441 \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e\u0439 \u0432\u044b\u0431\u043e\u0440\u043a\u043e\u0439.<\/p>\n<pre><code class=\"r\">set.seed(123) penguin_boot &lt;- bootstraps(penguin_train) penguin_boot<\/code><\/pre>\n<pre><code># Bootstrap sampling  # A tibble: 25 \u00d7 2    splits           id             &lt;list>           &lt;chr>        1 &lt;split [249\/93]> Bootstrap01  2 &lt;split [249\/91]> Bootstrap02  3 &lt;split [249\/90]> Bootstrap03  4 &lt;split [249\/91]> Bootstrap04  5 &lt;split [249\/85]> Bootstrap05  6 &lt;split [249\/87]> Bootstrap06  7 &lt;split [249\/94]> Bootstrap07  8 &lt;split [249\/88]> Bootstrap08  9 &lt;split [249\/95]> Bootstrap09 10 &lt;split [249\/89]> Bootstrap10 # \u2026 with 15 more rows<\/code><\/pre>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0441\u0440\u0430\u0432\u043d\u0438\u043c \u0434\u0432\u0435 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u043c\u043e\u0434\u0435\u043b\u0438: \u043c\u043e\u0434\u0435\u043b\u044c \u043b\u043e\u0433\u0438\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u0438 \u0438 \u043c\u043e\u0434\u0435\u043b\u044c \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u0433\u043e \u043b\u0435\u0441\u0430. \u041d\u0430\u0447\u043d\u0435\u043c \u0441 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0439 \u043c\u043e\u0434\u0435\u043b\u0435\u0439.<\/p>\n<pre><code class=\"r\"># \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f \u0434\u043b\u044f \u043b\u043e\u0433\u0438\u0441\u0442\u0438\u0447\u0441\u0435\u043a\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 glm_spec &lt;- logistic_reg() %>%   set_engine(\"glm\")  glm_spec<\/code><\/pre>\n<pre><code>Logistic Regression Model Specification (classification)  Computational engine: glm <\/code><\/pre>\n<pre><code class=\"r\"># \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f \u0434\u043b\u044f \u043c\u043e\u0434\u0435\u043b\u0438 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u0433\u043e \u043b\u0435\u0441\u0430 rf_spec &lt;- rand_forest() %>%   set_mode(\"classification\") %>%   set_engine(\"ranger\")  rf_spec<\/code><\/pre>\n<pre><code>Random Forest Model Specification (classification)  Computational engine: ranger <\/code><\/pre>\n<p>\u0421\u0435\u0439\u0447\u0430\u0441 \u044d\u0442\u043e \u043f\u0443\u0441\u0442\u044b\u0435 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u043c\u043e\u0434\u0435\u043b\u0438, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043d\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0445. \u041d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u201c\u0441\u043e\u0431\u0440\u0430\u0442\u044c\u201d \u043c\u043e\u0434\u0435\u043b\u044c \u0438 \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e\u00a0<code>workflow()<\/code><\/p>\n<p>\u041d\u0430 \u043f\u0435\u0440\u0432\u043e\u043c \u0448\u0430\u0433\u0435 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0444\u043e\u0440\u043c\u0443\u043b\u0443, \u0433\u0434\u0435 \u043c\u044b \u0432\u044b\u0431\u0435\u0440\u0435\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u043d\u0438\u044f \u043f\u043e\u043b\u0430 \u043e\u0441\u043e\u0431\u0438.<\/p>\n<pre><code class=\"r\">penguin_wf &lt;- workflow() %>%   add_formula(sex ~ .) # \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u0441\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u043d\u0438\u044f \u043f\u043e\u043b\u0430 \u043e\u0441\u043e\u0431\u0438  penguin_wf<\/code><\/pre>\n<pre><code>\u2550\u2550 Workflow \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550 Preprocessor: Formula Model: None  \u2500\u2500 Preprocessor \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 sex ~ .<\/code><\/pre>\n<p>\u041d\u0430 \u0432\u0442\u043e\u0440\u043e\u043c \u0448\u0430\u0433\u0435, \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e \u043c\u043e\u0434\u0435\u043b\u0438. \u041d\u0430\u0447\u043d\u0435\u043c \u0441 \u043b\u043e\u0433\u0438\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u0438.\u00a0<\/p>\n<pre><code class=\"r\">glm_rs &lt;- penguin_wf %>%   add_model(glm_spec) %>%   fit_resamples(     resamples = penguin_boot,     control = control_resamples(save_pred = TRUE)   )  glm_rs<\/code><\/pre>\n<pre><code># Resampling results # Bootstrap sampling  # A tibble: 25 \u00d7 5    splits           id          .metrics         .notes           .predictions         &lt;list>           &lt;chr>       &lt;list>           &lt;list>           &lt;list>             1 &lt;split [249\/93]> Bootstrap01 &lt;tibble [2 \u00d7 4]> &lt;tibble [0 \u00d7 3]> &lt;tibble [93 \u00d7 6]>  2 &lt;split [249\/91]> Bootstrap02 &lt;tibble [2 \u00d7 4]> &lt;tibble [0 \u00d7 3]> &lt;tibble [91 \u00d7 6]>  3 &lt;split [249\/90]> Bootstrap03 &lt;tibble [2 \u00d7 4]> &lt;tibble [0 \u00d7 3]> &lt;tibble [90 \u00d7 6]>  4 &lt;split [249\/91]> Bootstrap04 &lt;tibble [2 \u00d7 4]> &lt;tibble [0 \u00d7 3]> &lt;tibble [91 \u00d7 6]>  5 &lt;split [249\/85]> Bootstrap05 &lt;tibble [2 \u00d7 4]> &lt;tibble [1 \u00d7 3]> &lt;tibble [85 \u00d7 6]>  6 &lt;split [249\/87]> Bootstrap06 &lt;tibble [2 \u00d7 4]> &lt;tibble [0 \u00d7 3]> &lt;tibble [87 \u00d7 6]>  7 &lt;split [249\/94]> Bootstrap07 &lt;tibble [2 \u00d7 4]> &lt;tibble [0 \u00d7 3]> &lt;tibble [94 \u00d7 6]>  8 &lt;split [249\/88]> Bootstrap08 &lt;tibble [2 \u00d7 4]> &lt;tibble [1 \u00d7 3]> &lt;tibble [88 \u00d7 6]>  9 &lt;split [249\/95]> Bootstrap09 &lt;tibble [2 \u00d7 4]> &lt;tibble [0 \u00d7 3]> &lt;tibble [95 \u00d7 6]> 10 &lt;split [249\/89]> Bootstrap10 &lt;tibble [2 \u00d7 4]> &lt;tibble [0 \u00d7 3]> &lt;tibble [89 \u00d7 6]> # \u2026 with 15 more rows<\/code><\/pre>\n<p>\u0421\u0434\u0435\u043b\u0430\u0435\u043c \u0442\u043e\u0436\u0435 \u0441\u0430\u043c\u043e\u0435 \u0434\u043b\u044f \u043c\u043e\u0434\u0435\u043b\u0438 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u0433\u043e \u043b\u0435\u0441\u0430:<\/p>\n<pre><code class=\"r\">rf_rs &lt;- penguin_wf %>%   add_model(rf_spec) %>%   fit_resamples(     resamples = penguin_boot,     control = control_resamples(save_pred = TRUE)   )  rf_rs<\/code><\/pre>\n<pre><code># Resampling results # Bootstrap sampling  # A tibble: 25 \u00d7 5    splits           id          .metrics         .notes           .predictions         &lt;list>           &lt;chr>       &lt;list>           &lt;list>           &lt;list>             1 &lt;split [249\/93]> Bootstrap01 &lt;tibble [2 \u00d7 4]> &lt;tibble [0 \u00d7 3]> &lt;tibble [93 \u00d7 6]>  2 &lt;split [249\/91]> Bootstrap02 &lt;tibble [2 \u00d7 4]> &lt;tibble [0 \u00d7 3]> &lt;tibble [91 \u00d7 6]>  3 &lt;split [249\/90]> Bootstrap03 &lt;tibble [2 \u00d7 4]> &lt;tibble [0 \u00d7 3]> &lt;tibble [90 \u00d7 6]>  4 &lt;split [249\/91]> Bootstrap04 &lt;tibble [2 \u00d7 4]> &lt;tibble [0 \u00d7 3]> &lt;tibble [91 \u00d7 6]>  5 &lt;split [249\/85]> Bootstrap05 &lt;tibble [2 \u00d7 4]> &lt;tibble [0 \u00d7 3]> &lt;tibble [85 \u00d7 6]>  6 &lt;split [249\/87]> Bootstrap06 &lt;tibble [2 \u00d7 4]> &lt;tibble [0 \u00d7 3]> &lt;tibble [87 \u00d7 6]>  7 &lt;split [249\/94]> Bootstrap07 &lt;tibble [2 \u00d7 4]> &lt;tibble [0 \u00d7 3]> &lt;tibble [94 \u00d7 6]>  8 &lt;split [249\/88]> Bootstrap08 &lt;tibble [2 \u00d7 4]> &lt;tibble [0 \u00d7 3]> &lt;tibble [88 \u00d7 6]>  9 &lt;split [249\/95]> Bootstrap09 &lt;tibble [2 \u00d7 4]> &lt;tibble [0 \u00d7 3]> &lt;tibble [95 \u00d7 6]> 10 &lt;split [249\/89]> Bootstrap10 &lt;tibble [2 \u00d7 4]> &lt;tibble [0 \u00d7 3]> &lt;tibble [89 \u00d7 6]> # \u2026 with 15 more rows<\/code><\/pre>\n<h2>\u041e\u0446\u0435\u043d\u0438\u0432\u0430\u0435\u043c \u043c\u043e\u0434\u0435\u043b\u044c<\/h2>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043c, \u0447\u0442\u043e \u0443 \u043d\u0430\u0441 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c. <\/p>\n<p>\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043c\u0435\u0442\u0440\u0438\u043a\u0438 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438 \u0434\u043b\u044f \u043c\u043e\u0434\u0435\u043b\u0438 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u0433\u043e \u043b\u0435\u0441\u0430:<\/p>\n<pre><code class=\"r\">collect_metrics(rf_rs)<\/code><\/pre>\n<pre><code># A tibble: 2 \u00d7 6   .metric  .estimator  mean     n std_err .config                &lt;chr>    &lt;chr>      &lt;dbl> &lt;int>   &lt;dbl> &lt;chr>                1 accuracy binary     0.914    25 0.00545 Preprocessor1_Model1 2 roc_auc  binary     0.977    25 0.00202 Preprocessor1_Model1<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043c\u0435\u0442\u0440\u0438\u043a\u0438 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438 \u0434\u043b\u044f \u043b\u043e\u0433\u0438\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u0438:<\/p>\n<pre><code class=\"r\">collect_metrics(glm_rs)<\/code><\/pre>\n<pre><code># A tibble: 2 \u00d7 6   .metric  .estimator  mean     n std_err .config                &lt;chr>    &lt;chr>      &lt;dbl> &lt;int>   &lt;dbl> &lt;chr>                1 accuracy binary     0.918    25 0.00639 Preprocessor1_Model1 2 roc_auc  binary     0.979    25 0.00254 Preprocessor1_Model1<\/code><\/pre>\n<p>\u041c\u044b \u0432\u0438\u0434\u0438\u043c, \u0447\u0442\u043e \u043c\u043e\u0434\u0435\u043b\u044c\u00a0<code>glm_rs<\/code>\u0441\u0440\u0430\u0431\u043e\u0442\u0430\u043b\u0430 \u0447\u0443\u0442\u044c \u043b\u0443\u0447\u0448\u0435, \u0447\u0435\u043c \u043c\u043e\u0434\u0435\u043b\u044c\u00a0<code>rf_rs<\/code>. \u0423\u0447\u0438\u0442\u044b\u0432\u0430\u044f, \u0447\u0442\u043e \u044d\u0442\u0438 \u043c\u043e\u0434\u0435\u043b\u0438 \u0434\u0430\u044e\u0442 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442, \u0435\u0441\u0442\u044c \u0441\u043c\u044b\u0441\u043b \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u0442\u0443, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e \u0441\u0432\u043e\u0435\u0439 \u0441\u0443\u0442\u0438 \u043f\u0440\u043e\u0449\u0435. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u044b \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c\u0441\u044f \u043d\u0430 \u043c\u043e\u0434\u0435\u043b\u0438 \u043b\u043e\u0433\u0438\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u0438.<\/p>\n<p>\u041f\u043e\u0441\u0442\u0440\u043e\u0438\u043c \u043c\u0430\u0442\u0440\u0438\u0446\u0443 \u043e\u0448\u0438\u0431\u043e\u043a:<\/p>\n<pre><code class=\"r\">glm_rs %>%   conf_mat_resampled()<\/code><\/pre>\n<pre><code># A tibble: 4 \u00d7 3   Prediction Truth   Freq   &lt;fct>      &lt;fct>  &lt;dbl> 1 female     female  41.1 2 female     male     3   3 male       female   4.4 4 male       male    42.3<\/code><\/pre>\n<p>\u041c\u044b \u0432\u0438\u0434\u0438\u043c, \u0447\u0442\u043e \u0443 \u043d\u0430\u0441 \u043d\u0435\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0441 \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u043d\u0438\u0435\u043c \u043f\u043e\u043b\u0430 \u043e\u0441\u043e\u0431\u0438. \u041c\u043e\u0434\u0435\u043b\u044c \u0441\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0445\u043e\u0440\u043e\u0448\u043e.<\/p>\n<p>\u041e\u0434\u043d\u0438\u043c \u0438\u0437 \u043d\u0430\u0448\u0438\u0445 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0435\u0439 \u0431\u044b\u043b\u00a0<code>roc_auc<\/code>\u00a0\u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0431\u044b\u043b\u043e \u0431\u044b \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430\u00a0<a href=\"https:\/\/ru.wikipedia.org\/wiki\/ROC-%D0%BA%D1%80%D0%B8%D0%B2%D0%B0%D1%8F\" rel=\"noopener noreferrer nofollow\">ROC-\u043a\u0440\u0438\u0432\u044b\u0435<\/a>.<\/p>\n<pre><code class=\"r\">glm_rs %>%   collect_predictions() %>%   group_by(id) %>%   roc_curve(sex, .pred_female) %>%   ggplot(aes(1 - specificity, sensitivity, color = id)) +   geom_abline(lty = 2, color = \"gray80\", size = 1.5) +   geom_path(show.legend = FALSE, alpha = 0.6, size = 1.2) +   coord_equal() +   theme_light()<\/code><\/pre>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u041c\u044b \u0432\u0438\u0434\u0438\u043c, \u0447\u0442\u043e ROC-\u043a\u0440\u0438\u0432\u0430\u044f \u0441\u0442\u0443\u043f\u0435\u043d\u0447\u0430\u0442\u0430\u044f \u2014 \u044d\u0442\u043e \u0441\u0432\u044f\u0437\u0430\u043d\u043e \u0441 \u0442\u0435\u043c, \u0447\u0442\u043e \u0443 \u043d\u0430\u0441 \u043d\u0435 \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043d\u0430\u0431\u043e\u0440 \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0432\u0435\u0440\u043d\u0443\u0442\u044c\u0441\u044f \u043a \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u043c\u0443 \u043d\u0430\u0431\u043e\u0440\u0443. \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u043c\u044b \u0435\u0449\u0435 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 \u0442\u0435\u0441\u0442\u043e\u0432\u0443\u044e \u0432\u044b\u0431\u043e\u0440\u043a\u0443. \u0415\u0435 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u043e\u0446\u0435\u043d\u043a\u0438 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043c\u043e\u0434\u0435\u043b\u0438 \u043d\u0430 \u043d\u043e\u0432\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<pre><code class=\"r\">penguin_final &lt;- penguin_wf %>%   add_model(glm_spec) %>%   last_fit(penguin_split)  penguin_final<\/code><\/pre>\n<pre><code># Resampling results # Manual resampling  # A tibble: 1 \u00d7 6   splits<\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-337947","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/337947","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=337947"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/337947\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=337947"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=337947"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=337947"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}