{"id":330474,"date":"2022-03-10T09:01:04","date_gmt":"2022-03-10T09:01:04","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=330474"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=330474","title":{"rendered":"<span>\u0414\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u0414\u0436\u0438\u043d\u0438 \u0438\u043b\u0438 \u043d\u0435\u0442: \u0432\u043e\u0442 \u0432 \u0447\u0435\u043c \u0432\u043e\u043f\u0440\u043e\u0441<\/span>"},"content":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/7d4\/eab\/281\/7d4eab2810ffb30aeb39c5f1e6fd2043.png\" width=\"559\" height=\"345\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/7d4\/eab\/281\/7d4eab2810ffb30aeb39c5f1e6fd2043.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u041a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442 \u0414\u0436\u0438\u043d\u0438 (\u0438\u043b\u0438 \u0438\u043d\u0434\u0435\u043a\u0441 \u0414\u0436\u0438\u043d\u0438), \u043a\u0440\u0438\u0432\u0430\u044f \u041b\u043e\u0440\u0435\u043d\u0446\u0430, TPR (true positive rate) \u0438 FPR (false positive rate) \u2013 \u043e\u0434\u043d\u0438 \u0438\u0437 \u0441\u0430\u043c\u044b\u0445 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432 \u044d\u043a\u043e\u043d\u043e\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0437\u0430\u0434\u0430\u0447, \u0440\u0435\u0448\u0430\u0435\u043c\u044b\u0445 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f. \u0412\u0441\u0435 \u043e\u043d\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0434\u043b\u044f \u043e\u0446\u0435\u043d\u043a\u0438 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0430 \u043c\u043e\u0434\u0435\u043b\u0438 \u0438, \u0442\u0430\u043a \u0438\u043b\u0438 \u0438\u043d\u0430\u0447\u0435, \u0441\u0432\u044f\u0437\u0430\u043d\u044b \u0434\u0440\u0443\u0433 \u0441 \u0434\u0440\u0443\u0433\u043e\u043c. \u041f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u0432\u0441\u043f\u043e\u043c\u043d\u0438\u0442\u044c, \u043a\u0430\u043a \u043e\u043d\u0438 \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u044e\u0442\u0441\u044f.<\/p>\n<p>\u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043f\u0440\u043e\u0433\u043d\u043e\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u0440\u0435\u0434\u0438\u0442\u043d\u0443\u044e \u0431\u043b\u0430\u0433\u043e\u043d\u0430\u0434\u0435\u0436\u043d\u043e\u0441\u0442\u044c \u0437\u0430\u0435\u043c\u0449\u0438\u043a\u0430. \u0411\u043b\u0430\u0433\u043e\u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u0437\u0430\u0435\u043c\u0449\u0438\u043a \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u044c\u0441\u044f \u043a \u043a\u043b\u0430\u0441\u0441\u0443 1, \u043d\u0435\u0431\u043b\u0430\u0433\u043e\u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u2013 \u043a \u043a\u043b\u0430\u0441\u0441\u0443 0. \u0422\u043e\u0433\u0434\u0430 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0447\u0435\u0442\u044b\u0440\u0435 \u0432\u0438\u0434\u0430 \u0438\u0441\u0445\u043e\u0434\u0430 \u043f\u0440\u043e\u0433\u043d\u043e\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f: <\/p>\n<p>1)\u00a0\u00a0\u00a0 True Positives \u00a0&#8212; \u0431\u043b\u0430\u0433\u043e\u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u0437\u0430\u0435\u043c\u0449\u0438\u043a \u0441\u043f\u0440\u043e\u0433\u043d\u043e\u0437\u0438\u0440\u043e\u0432\u0430\u043d \u0432\u0435\u0440\u043d\u043e;<\/p>\n<p>2)\u00a0\u00a0\u00a0 False Positives &#8212; \u0431\u043b\u0430\u0433\u043e\u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u0437\u0430\u0435\u043c\u0449\u0438\u043a \u0441\u043f\u0440\u043e\u0433\u043d\u043e\u0437\u0438\u0440\u043e\u0432\u0430\u043d \u043d\u0435\u0432\u0435\u0440\u043d\u043e;<\/p>\n<p>3)\u00a0\u00a0\u00a0 True Negatives \u2013 \u043d\u0435\u0431\u043b\u0430\u0433\u043e\u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u0437\u0430\u0435\u043c\u0449\u0438\u043a \u0441\u043f\u0440\u043e\u0433\u043d\u043e\u0437\u0438\u0440\u043e\u0432\u0430\u043d \u0432\u0435\u0440\u043d\u043e;<\/p>\n<p>4)\u00a0\u00a0\u00a0 False Negatives \u2013 \u043d\u0435\u0431\u043b\u0430\u0433\u043e\u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u0437\u0430\u0435\u043c\u0449\u0438\u043a \u0441\u043f\u0440\u043e\u0433\u043d\u043e\u0437\u0438\u0440\u043e\u0432\u0430\u043d \u043d\u0435\u0432\u0435\u0440\u043d\u043e.<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/104\/cdb\/895\/104cdb895802b340d2db983e4684a2d3.png\" width=\"339\" height=\"251\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/104\/cdb\/895\/104cdb895802b340d2db983e4684a2d3.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0414\u043b\u044f \u043d\u0430\u0448\u0435\u0439 \u0437\u0430\u0434\u0430\u0447\u0438 TPR = True Positives \/ (True Positives + False Negatives) \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0443\u0440\u043e\u0432\u043d\u0435\u043c \u0434\u043e\u0445\u043e\u0434\u043d\u043e\u0441\u0442\u0438 \u0431\u0430\u043d\u043a\u0430, \u0430 FPR = False Positives \/ (False Positives + True Negatives) \u2013 \u0443\u0440\u043e\u0432\u043d\u0435\u043c \u0443\u0431\u044b\u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438 \u0431\u0430\u043d\u043a\u0430. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c, \u0447\u0435\u043c \u043b\u0443\u0447\u0448\u0435 \u043e\u0434\u0438\u043d \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c, \u0442\u0435\u043c \u0445\u0443\u0436\u0435 \u0434\u0440\u0443\u0433\u043e\u0439. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043f\u043e\u0440\u043e\u0433 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u044f, \u0432\u044b\u0448\u0435 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043f\u0440\u043e\u0433\u043d\u043e\u0437\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0431\u0443\u0434\u0443\u0442 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u044c\u0441\u044f \u043a \u043a\u043b\u0430\u0441\u0441\u0443 1, \u043d\u0438\u0436\u0435 \u2013 \u043a \u043a\u043b\u0430\u0441\u0441\u0443 0 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e.<\/p>\n<p>\u041d\u043e \u0434\u043b\u044f \u0431\u0438\u0437\u043d\u0435\u0441\u0430 \u043c\u0430\u043b\u043e \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u0442\u044c \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0438. \u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c \u0440\u0435\u0448\u0435\u043d\u0438\u044f, \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0438 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043e\u0431\u043e\u0441\u043d\u043e\u0432\u0430\u043d\u043d\u044b\u0435. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432 \u0430\u043d\u0430\u043b\u0438\u0437 \u0432\u043a\u043b\u044e\u0447\u0430\u044e\u0442 ROC-\u043a\u0440\u0438\u0432\u0443\u044e, \u043f\u043b\u043e\u0449\u0430\u0434\u044c \u043f\u043e\u0434 \u043a\u0440\u0438\u0432\u043e\u0439 (AUC) \u0438 \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442 \u0414\u0436\u0438\u043d\u0438. \u0422\u043e \u0435\u0441\u0442\u044c, \u0441\u0442\u0440\u043e\u0438\u0442\u0441\u044f \u0433\u0440\u0430\u0444\u0438\u043a \u043e\u0442\u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043f\u0440\u043e\u0433\u043d\u043e\u0437\u043d\u044b\u0445 target-\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 (\u0440\u0438\u0441. 1).<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/a7e\/e03\/445\/a7ee03445865d2812a6540e3c81cd4b9.png\" width=\"628\" height=\"231\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/a7e\/e03\/445\/a7ee03445865d2812a6540e3c81cd4b9.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0417\u0430\u0442\u0435\u043c \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u043b\u043e\u0449\u0430\u0434\u044c \u043f\u043e\u0434 \u043a\u0440\u0438\u0432\u043e\u0439 \u2013 \u043f\u043b\u043e\u0449\u0430\u0434\u044c \u0444\u0438\u0433\u0443\u0440\u044b \u043f\u043e\u0434 \u043b\u0438\u043d\u0438\u0435\u0439 \u043f\u0440\u043e\u0433\u043d\u043e\u0437\u043d\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439. \u0422\u0430\u043a \u043c\u044b \u0443\u0437\u043d\u0430\u0435\u043c \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e \u0440\u0430\u0431\u043e\u0442\u044b \u043d\u0430\u0448\u0435\u0433\u043e \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430. \u0410 \u0443\u0436\u0435 \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442 \u0414\u0436\u0438\u043d\u0438 (Gini = 2 * AUC ROC &#8212; 1) \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043a\u0430\u043a \u0438\u0442\u043e\u0433\u043e\u0432\u0430\u044f \u043c\u0435\u0442\u0440\u0438\u043a\u0430 \u0434\u043b\u044f \u043f\u0440\u0438\u043d\u044f\u0442\u0438\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u0439. <\/p>\n<p>\u0414\u0430\u043d\u043d\u044b\u0439 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043f\u0440\u043e\u0441\u0442 \u0432 \u0440\u0430\u0441\u0447\u0451\u0442\u0435 \u0438 \u043b\u0435\u0433\u043a\u043e \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0438\u0440\u0443\u0435\u043c, \u0430 \u0437\u043d\u0430\u0447\u0438\u0442 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u0435\u043d \u0438 \u0447\u0430\u0441\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432 \u043c\u043e\u0434\u0435\u043b\u044f\u0445 \u0431\u0430\u043d\u043a\u043e\u0432\u0441\u043a\u043e\u0433\u043e \u0441\u043a\u043e\u0440\u0438\u043d\u0433\u0430. \u041d\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043b\u0438 \u043e\u0434\u043d\u043e\u0439 \u043c\u0435\u0442\u0440\u0438\u043a\u0438 \u0438 \u043c\u043e\u0436\u043d\u043e \u00ab\u043f\u043e\u043b\u043e\u0436\u0438\u0442\u044c\u0441\u044f\u00bb \u043d\u0430 Gini \u0432 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0447\u0435\u0441\u043a\u0438\u0445 \u0432\u043e\u043f\u0440\u043e\u0441\u0430\u0445? \u0420\u0430\u0437\u0431\u0435\u0440\u0435\u043c\u0441\u044f.<\/p>\n<p>\u0421 \u0440\u0430\u0437\u0432\u0438\u0442\u0438\u0435\u043c \u044d\u043a\u043e\u043d\u043e\u043c\u0438\u043a\u0438 \u0440\u0430\u0441\u0442\u0451\u0442 \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u043a\u0440\u0435\u0434\u0438\u0442\u043e\u0432\u0430\u043d\u0438\u044f, \u0430 \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u043d\u0438\u043c \u0438 \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u0437\u0430\u0434\u043e\u043b\u0436\u0435\u043d\u043d\u043e\u0441\u0442\u0438. \u0412\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043a\u0440\u0435\u0434\u0438\u0442\u043d\u044b\u043c \u0440\u0438\u0441\u043a\u043e\u043c. \u0410 \u0437\u043d\u0430\u0447\u0438\u0442, \u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0437\u0430\u0434\u0430\u0447\u0430 \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u044f \u043c\u043e\u0434\u0435\u043b\u0438 \u0440\u0435\u0439\u0442\u0438\u043d\u0433\u043e\u0432\u0430\u043d\u0438\u044f \u0437\u0430\u0435\u043c\u0449\u0438\u043a\u043e\u0432. <\/p>\n<p>\u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0432\u043e\u0437\u044c\u043c\u0435\u043c \u0434\u0430\u0442\u0430\u0441\u0435\u0442 \u0441 \u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u044f\u043c\u0438 \u043f\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c \u0438 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u0438\u0441\u0442\u0438\u043a\u0430\u043c \u0437\u0430\u0435\u043c\u0449\u0438\u043a\u043e\u0432 \u043d\u0430 \u043f\u0440\u043e\u0442\u044f\u0436\u0435\u043d\u0438\u0438 \u044d\u043a\u043e\u043d\u043e\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0446\u0438\u043a\u043b\u0430 \u0438 \u0431\u043e\u043b\u0435\u0435, \u0434\u043b\u044f \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043f\u0440\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d \u043f\u0440\u0438\u0437\u043d\u0430\u043a \u0434\u0435\u0444\u043e\u043b\u0442\u0430. \u0412 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 \u043d\u0438\u0436\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d \u043f\u0440\u0438\u043c\u0435\u0440 \u043c\u0430\u0440\u043a\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td>\n<p>\u0418\u041d\u041d<\/p>\n<\/td>\n<td>\n<p>ID \u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u044f<\/p>\n<\/td>\n<td>\n<p>\u0414\u0430\u0442\u0430<\/p>\n<\/td>\n<td>\n<p>F1<\/p>\n<\/td>\n<td>\n<p>F2<\/p>\n<\/td>\n<td>\n<p>F3<\/p>\n<\/td>\n<td>\n<p>F4<\/p>\n<\/td>\n<td>\n<p>\u2026<\/p>\n<\/td>\n<td>\n<p>F17<\/p>\n<\/td>\n<td>\n<p>default<\/p>\n<\/td>\n<td>\n<p>split<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>1234567890<\/p>\n<\/td>\n<td>\n<p>1<\/p>\n<\/td>\n<td>\n<p>2017-30-09<\/p>\n<\/td>\n<td>\n<p>100 000<\/p>\n<\/td>\n<td>\n<p>89<\/p>\n<\/td>\n<td>\n<p>0,4<\/p>\n<\/td>\n<td>\n<p>530<\/p>\n<\/td>\n<td>\n<p>\u2026<\/p>\n<\/td>\n<td>\n<p>A<\/p>\n<\/td>\n<td>\n<p>0<\/p>\n<\/td>\n<td>\n<p>train<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>0987654321<\/p>\n<\/td>\n<td>\n<p>2<\/p>\n<\/td>\n<td>\n<p>2018-09-30<\/p>\n<\/td>\n<td>\n<p>259 058<\/p>\n<\/td>\n<td>\n<p>56<\/p>\n<\/td>\n<td>\n<p>0,78<\/p>\n<\/td>\n<td>\n<p>942<\/p>\n<\/td>\n<td>\n<p>\u2026<\/p>\n<\/td>\n<td>\n<p>C<\/p>\n<\/td>\n<td>\n<p>1<\/p>\n<\/td>\n<td>\n<p>train<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>7418529631<\/p>\n<\/td>\n<td>\n<p>3<\/p>\n<\/td>\n<td>\n<p>2015-12-31<\/p>\n<\/td>\n<td>\n<p>1\u00a0000 680<\/p>\n<\/td>\n<td>\n<p>77<\/p>\n<\/td>\n<td>\n<p>0,63<\/p>\n<\/td>\n<td>\n<p>5 022<\/p>\n<\/td>\n<td>\n<p>\u2026<\/p>\n<\/td>\n<td>\n<p>F<\/p>\n<\/td>\n<td>\n<p>1<\/p>\n<\/td>\n<td>\n<p>test<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>1472583699<\/p>\n<\/td>\n<td>\n<p>4<\/p>\n<\/td>\n<td>\n<p>2020-05-31<\/p>\n<\/td>\n<td>\n<p>68 012<\/p>\n<\/td>\n<td>\n<p>69<\/p>\n<\/td>\n<td>\n<p>0,7<\/p>\n<\/td>\n<td>\n<p>135<\/p>\n<\/td>\n<td>\n<p>\u2026<\/p>\n<\/td>\n<td>\n<p>A<\/p>\n<\/td>\n<td>\n<p>0<\/p>\n<\/td>\n<td>\n<p>test<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0438. \u041c\u043d\u043e\u0433\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0441 \u0447\u0438\u0441\u043b\u043e\u0432\u044b\u043c\u0438 \u0444\u0430\u043a\u0442\u043e\u0440\u0430\u043c\u0438 \u0438 \u043d\u0435 \u0447\u0443\u0432\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u044b \u043a \u0438\u043d\u044b\u043c. \u041e\u0434\u043d\u0430\u043a\u043e, \u0432 \u0431\u0438\u0437\u043d\u0435\u0441\u0435 \u043d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u0432\u0430\u0436\u043d\u044b\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0438 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0447\u0438\u0441\u043b\u043e\u0432\u044b\u043c\u0438. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0441\u043f\u043e\u0441\u043e\u0431\u044b \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445. \u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u043b\u0438 WOE-\u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0435. \u0422\u0430\u043a\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u0440\u0438\u0434\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0438\u043c\u043e\u0441\u0442\u044c \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0443 \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 \u0447\u0438\u0441\u043b\u0430 (WOE-\u0432\u0435\u0441) \u0438 \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0435\u0433\u043e \u0432 \u043d\u0430\u0431\u043e\u0440 \u0444\u0430\u043a\u0442\u043e\u0440\u043e\u0432 \u0434\u043b\u044f \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u043c\u043e\u0434\u0435\u043b\u0438 \u043f\u0440\u043e\u0433\u043d\u043e\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f. \u0412\u0430\u0436\u043d\u043e, \u0447\u0442\u043e\u0431\u044b \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0435\u0439 \u0431\u044b\u043b\u0438 \u0440\u0430\u043d\u0436\u0438\u0440\u043e\u0432\u0430\u043d\u044b, \u0433\u0434\u0435 \u0410 \u2013 \u043b\u0443\u0447\u0448\u0435\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, B \u2013 \u0445\u043e\u0440\u043e\u0448\u0435\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u0421 \u2013 \u0443\u0434\u043e\u0432\u043b\u0435\u0442\u0432\u043e\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0438 \u0442.\u0434. WOE-\u0432\u0435\u0441\u0430 \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043a\u0430\u043a \u043d\u0430\u0442\u0443\u0440\u0430\u043b\u044c\u043d\u044b\u0439 \u043b\u043e\u0433\u0430\u0440\u0438\u0444\u043c \u043e\u0442 \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u044f \u0434\u043e\u043b\u0438 \u0445\u043e\u0440\u043e\u0448\u0438\u0445 \u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u0439 \u043a \u0434\u043e\u043b\u0435 \u043f\u043b\u043e\u0445\u0438\u0445 \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u0439. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e:<\/p>\n<pre><code># df -  \u0434\u0430\u0442\u0430\u0441\u0435\u0442; split_column \u2013 \u0441\u0442\u043e\u043b\u0431\u0435\u0446 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u0435\u043b\u0438\u0442 \u0432\u044b\u0431\u043e\u0440\u043a\u0443 \u043d\u0430 \u0442\u0435\u0441\u0442\u043e\u0432\u0443\u044e \u0438 \u043e\u0431\u0443\u0447\u0430\u044e\u0449\u0443\u044e; split -  train\/test; factor \u2013 \u0441\u0442\u043e\u043b\u0431\u0435\u0446 \u0444\u0430\u043a\u0442\u043e\u0440\u0430. def woe(df, split_column, split, factor): woe = pd.concat([np.log((df[(df[split_column] == split) &amp; (df['default'] == 0)][factor]\\ .value_counts()\/df[(df[split_column] == split) &amp; (df['default'] == 0)][factor].count())\\     \/(df[(df[split_column] == split) &amp; (df['default'] == 1)][factor]\\     .value_counts()\/df[(df[split_column] == split) &amp; (df['default'] ==     1)][factor].count())).rename('WOE train')], axis=1)     return woe # \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0441\u0442\u043e\u043b\u0431\u0435\u0446 \u0434\u043b\u044f \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0444\u0430\u043a\u0442\u043e\u0440\u0430 woe_F13 = {'A': woe(df, 'split', 'train', 'F13')['WOE train']['A'],            'B': woe(df, 'split', 'train', 'F13')['WOE']['B],            'C': woe(df, 'split', 'train', 'F13')['WOE']['C'],            'D': woe(df, 'split', 'train', 'F13')['WOE']['D']             } df['F13_woe'] = df['F13'].replace(woe_F13)<\/code><\/pre>\n<p>\u041f\u043e \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0438 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u044e \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u0444\u0430\u043a\u0442\u043e\u0440\u044b (F14 \u2013 F17).<\/p>\n<p>\u0414\u043b\u044f \u043f\u0440\u043e\u0433\u043d\u043e\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e \u043b\u043e\u0433\u0438\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u043c\u043e\u0434\u0435\u043b\u044c.<\/p>\n<p>\u0417\u0430\u043f\u0438\u0448\u0443 \u0444\u0430\u043a\u0442\u043e\u0440\u044b \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u043b\u0438\u0441\u0442 \u0434\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430.<\/p>\n<pre><code>feat_cols = [F1, F2, F3, F4, F5, F8, F9, F13_woe, F14_woe, F15_woe, F17_woe] # \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u043c \u0434\u0430\u0442\u0430\u0441\u0435\u0442 \u043d\u0430 \u043e\u0431\u0443\u0447\u0430\u044e\u0449\u0443\u044e \u0438 \u0442\u0435\u0441\u0442\u043e\u0432\u0443\u044e \u0432\u044b\u0431\u043e\u0440\u043a\u0438 df_train = df[df['split'] == 'train'][['\u0418\u041d\u041d', 'ID \u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u044f', 'default', 'split'] + feat_cols].copy() df_test = df[df['split'] == 'test'] [['\u0418\u041d\u041d', 'ID \u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u044f', 'default', 'split'] + feat_cols].copy() df_full = pd.concat([df_train, df_test], axis = 0).reset_index() # \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 from sklearn.linear_model import LogisticRegression import statsmodels.api as sm # \u0441\u0442\u0440\u043e\u0438\u043c \u043c\u043e\u0434\u0435\u043b\u044c log_reg = sm.Logit(df_train['default'], df_train[feat_cols]).fit()<\/code><\/pre>\n<p>\u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u044e \u0414\u0436\u0438\u043d\u0438 train \/ test \u0434\u043b\u044f \u043f\u0440\u043e\u0433\u043d\u043e\u0437\u043d\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438.<\/p>\n<pre><code>from sklearn.metrics import roc_auc_score # \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c \u043c\u0435\u0442\u0440\u0438\u043a\u0443 roc auc print('Gini Train: ', 2 * roc_auc_score(df_full[df_full['split'] == 'train']['default'], log_reg.predict(df_full[df_full['split'] == 'train'][feat_cols])) - 1) print('Gini Test : ', 2 * roc_auc_score(df_full[df_full['split'] == 'test']['default'], log_reg.predict(df_full[df_full['split'] == 'test'][feat_cols])) - 1)<\/code><\/pre>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/b22\/50c\/b26\/b2250cb26b344049cc71c4f9c3efe1d9.png\" width=\"253\" height=\"38\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/b22\/50c\/b26\/b2250cb26b344049cc71c4f9c3efe1d9.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u041d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0445 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0431\u044b\u043b\u043e \u043f\u0440\u0438\u043d\u044f\u0442\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0434\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u0434\u0430\u043d\u043d\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438. \u041e\u0434\u043d\u0430\u043a\u043e, \u0432 \u0445\u043e\u0434\u0435 \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u043c\u043e\u0434\u0435\u043b\u0438 \u0431\u044b\u043b\u043e \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u043e \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043d\u043e\u0432\u043e\u0433\u043e \u0444\u0430\u043a\u0442\u043e\u0440\u0430 \u2013 F18. \u0414\u0430\u043d\u043d\u044b\u0439 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e woe \u0444\u0443\u043d\u043a\u0446\u0438\u0438. \u041f\u0435\u0440\u0435\u043e\u0431\u0443\u0447\u0438\u043b\u0438 \u043c\u043e\u0434\u0435\u043b\u044c \u0441 \u0443\u0447\u0435\u0442\u043e\u043c \u043d\u043e\u0432\u043e\u0433\u043e \u043d\u0430\u0431\u043e\u0440\u0430 \u043f\u0440\u0435\u0434\u0438\u043a\u0442\u043e\u0440\u043e\u0432 \u0438 \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u043b\u0438 \u0414\u0436\u0438\u043d\u0438. <\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/e44\/415\/b3a\/e44415b3a003b2515397aa5b4c230f25.png\" width=\"269\" height=\"35\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/e44\/415\/b3a\/e44415b3a003b2515397aa5b4c230f25.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u041f\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430\u043c \u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u043d\u0430 \u043e\u0431\u0443\u0447\u0430\u044e\u0449\u0435\u0439 \u0432\u044b\u0431\u043e\u0440\u043a\u0435 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e \u043c\u043e\u0434\u0435\u043b\u0438 \u043b\u0443\u0447\u0448\u0435 \u0441 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u0444\u0430\u043a\u0442\u043e\u0440\u043e\u043c, \u0430 \u043d\u0430 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0439 \u2013 \u0431\u0435\u0437 \u043d\u0435\u0433\u043e. \u0422\u0430\u043a \u043a\u0430\u043a \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442\u0441\u044f \u0438\u0441\u0445\u043e\u0434\u044f \u0438\u0437 \u0431\u043e\u043b\u044c\u0448\u0435\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u043e Gini test, \u0442\u043e \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0444\u0430\u043a\u0442\u043e\u0440 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d \u0432 \u043c\u043e\u0434\u0435\u043b\u044c.<\/p>\n<p>\u0412\u044b\u0431\u043e\u0440 \u0432 \u043f\u043e\u043b\u044c\u0437\u0443 \u043c\u043e\u0434\u0435\u043b\u0438 \u0431\u0435\u0437 \u043d\u043e\u0432\u043e\u0433\u043e \u0444\u0430\u043a\u0442\u043e\u0440\u0430 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0440\u043e\u0442\u0438\u0432\u043e\u0440\u0435\u0447\u0438\u0432, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u0430\u0435\u043c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u043c\u0435\u0442\u0440\u0438\u043a\u0443 \u2013 \u0441\u0440\u0435\u0434\u043d\u044e\u044e \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u0443\u044e \u043e\u0448\u0438\u0431\u043a\u0443. \u0414\u0430\u043d\u043d\u044b\u0439 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f, \u043a\u0430\u043a \u0441\u0440\u0435\u0434\u043d\u0435\u0435 \u0440\u0430\u0437\u043d\u043e\u0441\u0442\u0435\u0439 \u043c\u0435\u0436\u0434\u0443 \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c\u0438 \u0438 \u043f\u0440\u043e\u0433\u043d\u043e\u0437\u043d\u044b\u043c\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438 \u0438 \u043d\u0435 \u043f\u0440\u043e\u0442\u0438\u0432\u043e\u0440\u0435\u0447\u0438\u0442 \u043b\u043e\u0433\u0438\u043a\u0435 \u0437\u0430\u0434\u0430\u0447\u0438. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u0443\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u0438 \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u043c \u043e\u0448\u0438\u0431\u043a\u0443 \u0434\u043b\u044f \u043c\u043e\u0434\u0435\u043b\u0438 \u0441 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u0444\u0430\u043a\u0442\u043e\u0440\u043e\u043c \u0438 \u0431\u0435\u0437 \u043d\u0435\u0433\u043e.<\/p>\n<pre><code>from sklearn.metrics import mean_absolute_error # MAE \u0434\u043b\u044f \u043c\u043e\u0434\u0435\u043b\u0438 \u0431\u0435\u0437 \u043d\u043e\u0432\u043e\u0433\u043e \u0444\u0430\u043a\u0442\u043e\u0440\u0430 print('MAE Train:', mean_absolute_error(df_full[df_full['split'] == 'train']['default'], log_reg.predict(df_full[df_full['split'] == 'train'][feat_cols]))) print('MAE Test:', mean_absolute_error(df_full[df_full['split'] == 'test']['default'], log_reg.predict(df_full[df_full['split'] == 'test'][feat_cols])))<\/code><\/pre>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/95e\/91b\/3ea\/95e91b3eadce219dcb82d7d1cee22ec1.png\" width=\"246\" height=\"43\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/95e\/91b\/3ea\/95e91b3eadce219dcb82d7d1cee22ec1.png\"\/><figcaption><\/figcaption><\/figure>\n<pre><code># MAE \u0434\u043b\u044f \u043c\u043e\u0434\u0435\u043b\u0438 \u0441 \u043d\u043e\u0432\u044b\u043c \u0444\u0430\u043a\u0442\u043e\u0440\u043e\u043c print('MAE Train \u043c\u043e\u0434\u0435\u043b\u0438 \u0441 \u0444\u0430\u043a\u0442\u043e\u0440\u043e\u043c F18:', mean_absolute_error(df_full[df_full['split'] == 'train']['default'], log_reg.predict(df_full[df_full['split'] == 'train'][feat_cols]))) print('MAE Test \u043c\u043e\u0434\u0435\u043b\u0438 \u0441 \u0444\u0430\u043a\u0442\u043e\u0440\u043e\u043c F18:', mean_absolute_error(df_full[df_full['split'] == 'test']['default'], log_reg.predict(df_full[df_full['split'] == 'test'][feat_cols])))<\/code><\/pre>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/21e\/c97\/1d1\/21ec971d1404c2f55b66e887d11b4d51.png\" width=\"418\" height=\"38\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/21e\/c97\/1d1\/21ec971d1404c2f55b66e887d11b4d51.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0421\u0440\u0435\u0434\u043d\u044f\u044f \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430 \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043a\u0430\u043a \u00ab\u0447\u0435\u043c \u043c\u0435\u043d\u044c\u0448\u0435, \u0442\u0435\u043c \u043b\u0443\u0447\u0448\u0435\u00bb. \u041f\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430\u043c \u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u043c\u043e\u0434\u0435\u043b\u044c \u0441 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u0444\u0430\u043a\u0442\u043e\u0440\u043e\u043c \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u043b\u0430 \u0441 \u043c\u0435\u043d\u044c\u0448\u0435\u0439 \u043e\u0448\u0438\u0431\u043a\u043e\u0439. <\/p>\n<p>\u0421\u0440\u0430\u0432\u043d\u0438\u043c \u0432\u0441\u0435 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043c\u0435\u0442\u0440\u0438\u043a.<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td>\n<p>\u041f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c<\/p>\n<\/td>\n<td>\n<p>Split<\/p>\n<\/td>\n<td>\n<p>\u041c\u043e\u0434\u0435\u043b\u044c \u0431\u0435\u0437 \u0434\u043e\u043f.   \u0444\u0430\u043a\u0442\u043e\u0440\u0430 (1)<\/p>\n<\/td>\n<td>\n<p>\u041c\u043e\u0434\u0435\u043b\u044c \u0441 \u0434\u043e\u043f. \u0444\u0430\u043a\u0442\u043e\u0440\u043e\u043c   (2)<\/p>\n<\/td>\n<td>\n<p>\u041c\u043e\u0434\u0435\u043b\u044c \u0441   \u043b\u0443\u0447\u0448\u0438\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td rowspan=\"2\">\n<p>Gini<\/p>\n<\/td>\n<td>\n<p>Train<\/p>\n<\/td>\n<td>\n<p>0,5119<\/p>\n<\/td>\n<td>\n<p>0,5137<\/p>\n<\/td>\n<td>\n<p>2<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>Test<\/p>\n<\/td>\n<td>\n<p>0,6297<\/p>\n<\/td>\n<td>\n<p>0,6134<\/p>\n<\/td>\n<td>\n<p>1<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td rowspan=\"2\">\n<p>MAE<\/p>\n<\/td>\n<td>\n<p>Train<\/p>\n<\/td>\n<td>\n<p>0,3911<\/p>\n<\/td>\n<td>\n<p>0,3882<\/p>\n<\/td>\n<td>\n<p>2<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>Test<\/p>\n<\/td>\n<td>\n<p>0,3953<\/p>\n<\/td>\n<td>\n<p>0,3948<\/p>\n<\/td>\n<td>\n<p>2<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u0418\u0437 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0441\u043b\u0435\u0434\u0443\u0435\u0442, \u0447\u0442\u043e \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043d\u043e\u0432\u043e\u0433\u043e \u0444\u0430\u043a\u0442\u043e\u0440\u0430 F18 \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0435\u0442 \u043f\u0440\u043e\u0433\u043d\u043e\u0437\u043d\u0443\u044e \u0441\u0438\u043b\u0443 \u043c\u043e\u0434\u0435\u043b\u0438. \u041e\u0434\u043d\u0430\u043a\u043e, \u0442\u0430\u043a\u043e\u0439 \u0432\u044b\u0432\u043e\u0434 \u0441\u0442\u0430\u043b \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u043f\u043e\u0441\u043b\u0435 \u0440\u0430\u0441\u0447\u0435\u0442\u0430 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u043c\u0435\u0442\u0440\u0438\u043a\u0438. \u041d\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0432\u044b\u0432\u043e\u0434, \u0447\u0442\u043e \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u0430 \u0414\u0436\u0438\u043d\u0438 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0434\u043b\u044f \u043e\u0446\u0435\u043d\u043a\u0438 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0430 \u043c\u043e\u0434\u0435\u043b\u0438. \u0427\u0442\u043e\u0431\u044b \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u044c \u0433\u0438\u043f\u043e\u0442\u0435\u0437\u0443, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0431\u043e\u043b\u044c\u0448\u0435\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u043e\u0432. \u0410 \u0432 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u043e \u043d\u0430\u0447\u0430\u043b\u043e \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e.<\/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\/654907\/\"> https:\/\/habr.com\/ru\/post\/654907\/<\/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_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u041a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442 \u0414\u0436\u0438\u043d\u0438 (\u0438\u043b\u0438 \u0438\u043d\u0434\u0435\u043a\u0441 \u0414\u0436\u0438\u043d\u0438), \u043a\u0440\u0438\u0432\u0430\u044f \u041b\u043e\u0440\u0435\u043d\u0446\u0430, TPR (true positive rate) \u0438 FPR (false positive rate) \u2013 \u043e\u0434\u043d\u0438 \u0438\u0437 \u0441\u0430\u043c\u044b\u0445 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432 \u044d\u043a\u043e\u043d\u043e\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0437\u0430\u0434\u0430\u0447, \u0440\u0435\u0448\u0430\u0435\u043c\u044b\u0445 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f. \u0412\u0441\u0435 \u043e\u043d\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0434\u043b\u044f \u043e\u0446\u0435\u043d\u043a\u0438 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0430 \u043c\u043e\u0434\u0435\u043b\u0438 \u0438, \u0442\u0430\u043a \u0438\u043b\u0438 \u0438\u043d\u0430\u0447\u0435, \u0441\u0432\u044f\u0437\u0430\u043d\u044b \u0434\u0440\u0443\u0433 \u0441 \u0434\u0440\u0443\u0433\u043e\u043c. \u041f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u0432\u0441\u043f\u043e\u043c\u043d\u0438\u0442\u044c, \u043a\u0430\u043a \u043e\u043d\u0438 \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u044e\u0442\u0441\u044f.<\/p>\n<p>\u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043f\u0440\u043e\u0433\u043d\u043e\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u0440\u0435\u0434\u0438\u0442\u043d\u0443\u044e \u0431\u043b\u0430\u0433\u043e\u043d\u0430\u0434\u0435\u0436\u043d\u043e\u0441\u0442\u044c \u0437\u0430\u0435\u043c\u0449\u0438\u043a\u0430. \u0411\u043b\u0430\u0433\u043e\u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u0437\u0430\u0435\u043c\u0449\u0438\u043a \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u044c\u0441\u044f \u043a \u043a\u043b\u0430\u0441\u0441\u0443 1, \u043d\u0435\u0431\u043b\u0430\u0433\u043e\u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u2013 \u043a \u043a\u043b\u0430\u0441\u0441\u0443 0. \u0422\u043e\u0433\u0434\u0430 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0447\u0435\u0442\u044b\u0440\u0435 \u0432\u0438\u0434\u0430 \u0438\u0441\u0445\u043e\u0434\u0430 \u043f\u0440\u043e\u0433\u043d\u043e\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f: <\/p>\n<p>1)\u00a0\u00a0\u00a0 True Positives \u00a0&#8212; \u0431\u043b\u0430\u0433\u043e\u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u0437\u0430\u0435\u043c\u0449\u0438\u043a \u0441\u043f\u0440\u043e\u0433\u043d\u043e\u0437\u0438\u0440\u043e\u0432\u0430\u043d \u0432\u0435\u0440\u043d\u043e;<\/p>\n<p>2)\u00a0\u00a0\u00a0 False Positives &#8212; \u0431\u043b\u0430\u0433\u043e\u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u0437\u0430\u0435\u043c\u0449\u0438\u043a \u0441\u043f\u0440\u043e\u0433\u043d\u043e\u0437\u0438\u0440\u043e\u0432\u0430\u043d \u043d\u0435\u0432\u0435\u0440\u043d\u043e;<\/p>\n<p>3)\u00a0\u00a0\u00a0 True Negatives \u2013 \u043d\u0435\u0431\u043b\u0430\u0433\u043e\u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u0437\u0430\u0435\u043c\u0449\u0438\u043a \u0441\u043f\u0440\u043e\u0433\u043d\u043e\u0437\u0438\u0440\u043e\u0432\u0430\u043d \u0432\u0435\u0440\u043d\u043e;<\/p>\n<p>4)\u00a0\u00a0\u00a0 False Negatives \u2013 \u043d\u0435\u0431\u043b\u0430\u0433\u043e\u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u0437\u0430\u0435\u043c\u0449\u0438\u043a \u0441\u043f\u0440\u043e\u0433\u043d\u043e\u0437\u0438\u0440\u043e\u0432\u0430\u043d \u043d\u0435\u0432\u0435\u0440\u043d\u043e.<\/p>\n<figure class=\"\"><figcaption><\/figcaption><\/figure>\n<p>\u0414\u043b\u044f \u043d\u0430\u0448\u0435\u0439 \u0437\u0430\u0434\u0430\u0447\u0438 TPR = True Positives \/ (True Positives + False Negatives) \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0443\u0440\u043e\u0432\u043d\u0435\u043c \u0434\u043e\u0445\u043e\u0434\u043d\u043e\u0441\u0442\u0438 \u0431\u0430\u043d\u043a\u0430, \u0430 FPR = False Positives \/ (False Positives + True Negatives) \u2013 \u0443\u0440\u043e\u0432\u043d\u0435\u043c \u0443\u0431\u044b\u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438 \u0431\u0430\u043d\u043a\u0430. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c, \u0447\u0435\u043c \u043b\u0443\u0447\u0448\u0435 \u043e\u0434\u0438\u043d \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c, \u0442\u0435\u043c \u0445\u0443\u0436\u0435 \u0434\u0440\u0443\u0433\u043e\u0439. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043f\u043e\u0440\u043e\u0433 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u044f, \u0432\u044b\u0448\u0435 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043f\u0440\u043e\u0433\u043d\u043e\u0437\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0431\u0443\u0434\u0443\u0442 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u044c\u0441\u044f \u043a \u043a\u043b\u0430\u0441\u0441\u0443 1, \u043d\u0438\u0436\u0435 \u2013 \u043a \u043a\u043b\u0430\u0441\u0441\u0443 0 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e.<\/p>\n<p>\u041d\u043e \u0434\u043b\u044f \u0431\u0438\u0437\u043d\u0435\u0441\u0430 \u043c\u0430\u043b\u043e \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u0442\u044c \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0438. \u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c \u0440\u0435\u0448\u0435\u043d\u0438\u044f, \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0438 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043e\u0431\u043e\u0441\u043d\u043e\u0432\u0430\u043d\u043d\u044b\u0435. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432 \u0430\u043d\u0430\u043b\u0438\u0437 \u0432\u043a\u043b\u044e\u0447\u0430\u044e\u0442 ROC-\u043a\u0440\u0438\u0432\u0443\u044e, \u043f\u043b\u043e\u0449\u0430\u0434\u044c \u043f\u043e\u0434 \u043a\u0440\u0438\u0432\u043e\u0439 (AUC) \u0438 \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442 \u0414\u0436\u0438\u043d\u0438. \u0422\u043e \u0435\u0441\u0442\u044c, \u0441\u0442\u0440\u043e\u0438\u0442\u0441\u044f \u0433\u0440\u0430\u0444\u0438\u043a \u043e\u0442\u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043f\u0440\u043e\u0433\u043d\u043e\u0437\u043d\u044b\u0445 target-\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 (\u0440\u0438\u0441. 1).<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0417\u0430\u0442\u0435\u043c \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u043b\u043e\u0449\u0430\u0434\u044c \u043f\u043e\u0434 \u043a\u0440\u0438\u0432\u043e\u0439 \u2013 \u043f\u043b\u043e\u0449\u0430\u0434\u044c \u0444\u0438\u0433\u0443\u0440\u044b \u043f\u043e\u0434 \u043b\u0438\u043d\u0438\u0435\u0439 \u043f\u0440\u043e\u0433\u043d\u043e\u0437\u043d\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439. \u0422\u0430\u043a \u043c\u044b \u0443\u0437\u043d\u0430\u0435\u043c \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e \u0440\u0430\u0431\u043e\u0442\u044b \u043d\u0430\u0448\u0435\u0433\u043e \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430. \u0410 \u0443\u0436\u0435 \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442 \u0414\u0436\u0438\u043d\u0438 (Gini = 2 * AUC ROC &#8212; 1) \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043a\u0430\u043a \u0438\u0442\u043e\u0433\u043e\u0432\u0430\u044f \u043c\u0435\u0442\u0440\u0438\u043a\u0430 \u0434\u043b\u044f \u043f\u0440\u0438\u043d\u044f\u0442\u0438\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u0439. <\/p>\n<p>\u0414\u0430\u043d\u043d\u044b\u0439 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043f\u0440\u043e\u0441\u0442 \u0432 \u0440\u0430\u0441\u0447\u0451\u0442\u0435 \u0438 \u043b\u0435\u0433\u043a\u043e \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0438\u0440\u0443\u0435\u043c, \u0430 \u0437\u043d\u0430\u0447\u0438\u0442 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u0435\u043d \u0438 \u0447\u0430\u0441\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432 \u043c\u043e\u0434\u0435\u043b\u044f\u0445 \u0431\u0430\u043d\u043a\u043e\u0432\u0441\u043a\u043e\u0433\u043e \u0441\u043a\u043e\u0440\u0438\u043d\u0433\u0430. \u041d\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043b\u0438 \u043e\u0434\u043d\u043e\u0439 \u043c\u0435\u0442\u0440\u0438\u043a\u0438 \u0438 \u043c\u043e\u0436\u043d\u043e \u00ab\u043f\u043e\u043b\u043e\u0436\u0438\u0442\u044c\u0441\u044f\u00bb \u043d\u0430 Gini \u0432 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0447\u0435\u0441\u043a\u0438\u0445 \u0432\u043e\u043f\u0440\u043e\u0441\u0430\u0445? \u0420\u0430\u0437\u0431\u0435\u0440\u0435\u043c\u0441\u044f.<\/p>\n<p>\u0421 \u0440\u0430\u0437\u0432\u0438\u0442\u0438\u0435\u043c \u044d\u043a\u043e\u043d\u043e\u043c\u0438\u043a\u0438 \u0440\u0430\u0441\u0442\u0451\u0442 \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u043a\u0440\u0435\u0434\u0438\u0442\u043e\u0432\u0430\u043d\u0438\u044f, \u0430 \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u043d\u0438\u043c \u0438 \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u0437\u0430\u0434\u043e\u043b\u0436\u0435\u043d\u043d\u043e\u0441\u0442\u0438. \u0412\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043a\u0440\u0435\u0434\u0438\u0442\u043d\u044b\u043c \u0440\u0438\u0441\u043a\u043e\u043c. \u0410 \u0437\u043d\u0430\u0447\u0438\u0442, \u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0437\u0430\u0434\u0430\u0447\u0430 \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u044f \u043c\u043e\u0434\u0435\u043b\u0438 \u0440\u0435\u0439\u0442\u0438\u043d\u0433\u043e\u0432\u0430\u043d\u0438\u044f \u0437\u0430\u0435\u043c\u0449\u0438\u043a\u043e\u0432. <\/p>\n<p>\u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0432\u043e\u0437\u044c\u043c\u0435\u043c \u0434\u0430\u0442\u0430\u0441\u0435\u0442 \u0441 \u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u044f\u043c\u0438 \u043f\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c \u0438 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u0438\u0441\u0442\u0438\u043a\u0430\u043c \u0437\u0430\u0435\u043c\u0449\u0438\u043a\u043e\u0432 \u043d\u0430 \u043f\u0440\u043e\u0442\u044f\u0436\u0435\u043d\u0438\u0438 \u044d\u043a\u043e\u043d\u043e\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0446\u0438\u043a\u043b\u0430 \u0438 \u0431\u043e\u043b\u0435\u0435, \u0434\u043b\u044f \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043f\u0440\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d \u043f\u0440\u0438\u0437\u043d\u0430\u043a \u0434\u0435\u0444\u043e\u043b\u0442\u0430. \u0412 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 \u043d\u0438\u0436\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d \u043f\u0440\u0438\u043c\u0435\u0440 \u043c\u0430\u0440\u043a\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td>\n<p>\u0418\u041d\u041d<\/p>\n<\/td>\n<td>\n<p>ID \u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u044f<\/p>\n<\/td>\n<td>\n<p>\u0414\u0430\u0442\u0430<\/p>\n<\/td>\n<td>\n<p>F1<\/p>\n<\/td>\n<td>\n<p>F2<\/p>\n<\/td>\n<td>\n<p>F3<\/p>\n<\/td>\n<td>\n<p>F4<\/p>\n<\/td>\n<td>\n<p>\u2026<\/p>\n<\/td>\n<td>\n<p>F17<\/p>\n<\/td>\n<td>\n<p>default<\/p>\n<\/td>\n<td>\n<p>split<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>1234567890<\/p>\n<\/td>\n<td>\n<p>1<\/p>\n<\/td>\n<td>\n<p>2017-30-09<\/p>\n<\/td>\n<td>\n<p>100 000<\/p>\n<\/td>\n<td>\n<p>89<\/p>\n<\/td>\n<td>\n<p>0,4<\/p>\n<\/td>\n<td>\n<p>530<\/p>\n<\/td>\n<td>\n<p>\u2026<\/p>\n<\/td>\n<td>\n<p>A<\/p>\n<\/td>\n<td>\n<p>0<\/p>\n<\/td>\n<td>\n<p>train<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>0987654321<\/p>\n<\/td>\n<td>\n<p>2<\/p>\n<\/td>\n<td>\n<p>2018-09-30<\/p>\n<\/td>\n<td>\n<p>259 058<\/p>\n<\/td>\n<td>\n<p>56<\/p>\n<\/td>\n<td>\n<p>0,78<\/p>\n<\/td>\n<td>\n<p>942<\/p>\n<\/td>\n<td>\n<p>\u2026<\/p>\n<\/td>\n<td>\n<p>C<\/p>\n<\/td>\n<td>\n<p>1<\/p>\n<\/td>\n<td>\n<p>train<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>7418529631<\/p>\n<\/td>\n<td>\n<p>3<\/p>\n<\/td>\n<td>\n<p>2015-12-31<\/p>\n<\/td>\n<td>\n<p>1\u00a0000 680<\/p>\n<\/td>\n<td>\n<p>77<\/p>\n<\/td>\n<td>\n<p>0,63<\/p>\n<\/td>\n<td>\n<p>5 022<\/p>\n<\/td>\n<td>\n<p>\u2026<\/p>\n<\/td>\n<td>\n<p>F<\/p>\n<\/td>\n<td>\n<p>1<\/p>\n<\/td>\n<td>\n<p>test<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>1472583699<\/p>\n<\/td>\n<td>\n<p>4<\/p>\n<\/td>\n<td>\n<p>2020-05-31<\/p>\n<\/td>\n<td>\n<p>68 012<\/p>\n<\/td>\n<td>\n<p>69<\/p>\n<\/td>\n<td>\n<p>0,7<\/p>\n<\/td>\n<td>\n<p>135<\/p>\n<\/td>\n<td>\n<p>\u2026<\/p>\n<\/td>\n<td>\n<p>A<\/p>\n<\/td>\n<td>\n<p>0<\/p>\n<\/td>\n<td>\n<p>test<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0438. \u041c\u043d\u043e\u0433\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0441 \u0447\u0438\u0441\u043b\u043e\u0432\u044b\u043c\u0438 \u0444\u0430\u043a\u0442\u043e\u0440\u0430\u043c\u0438 \u0438 \u043d\u0435 \u0447\u0443\u0432\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u044b \u043a \u0438\u043d\u044b\u043c. \u041e\u0434\u043d\u0430\u043a\u043e, \u0432 \u0431\u0438\u0437\u043d\u0435\u0441\u0435 \u043d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u0432\u0430\u0436\u043d\u044b\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0438 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0447\u0438\u0441\u043b\u043e\u0432\u044b\u043c\u0438. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0441\u043f\u043e\u0441\u043e\u0431\u044b \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445. \u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u043b\u0438 WOE-\u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0435. \u0422\u0430\u043a\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u0440\u0438\u0434\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0438\u043c\u043e\u0441\u0442\u044c \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0443 \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 \u0447\u0438\u0441\u043b\u0430 (WOE-\u0432\u0435\u0441) \u0438 \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0435\u0433\u043e \u0432 \u043d\u0430\u0431\u043e\u0440 \u0444\u0430\u043a\u0442\u043e\u0440\u043e\u0432 \u0434\u043b\u044f \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u043c\u043e\u0434\u0435\u043b\u0438 \u043f\u0440\u043e\u0433\u043d\u043e\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f. \u0412\u0430\u0436\u043d\u043e, \u0447\u0442\u043e\u0431\u044b \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0435\u0439 \u0431\u044b\u043b\u0438 \u0440\u0430\u043d\u0436\u0438\u0440\u043e\u0432\u0430\u043d\u044b, \u0433\u0434\u0435 \u0410 \u2013 \u043b\u0443\u0447\u0448\u0435\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, B \u2013 \u0445\u043e\u0440\u043e\u0448\u0435\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u0421 \u2013 \u0443\u0434\u043e\u0432\u043b\u0435\u0442\u0432\u043e\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0438 \u0442.\u0434. WOE-\u0432\u0435\u0441\u0430 \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043a\u0430\u043a \u043d\u0430\u0442\u0443\u0440\u0430\u043b\u044c\u043d\u044b\u0439 \u043b\u043e\u0433\u0430\u0440\u0438\u0444\u043c \u043e\u0442 \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u044f \u0434\u043e\u043b\u0438 \u0445\u043e\u0440\u043e\u0448\u0438\u0445 \u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u0439 \u043a \u0434\u043e\u043b\u0435 \u043f\u043b\u043e\u0445\u0438\u0445 \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u0439. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e:<\/p>\n<pre><code># df -  \u0434\u0430\u0442\u0430\u0441\u0435\u0442; split_column \u2013 \u0441\u0442\u043e\u043b\u0431\u0435\u0446 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u0435\u043b\u0438\u0442 \u0432\u044b\u0431\u043e\u0440\u043a\u0443 \u043d\u0430 \u0442\u0435\u0441\u0442\u043e\u0432\u0443\u044e \u0438 \u043e\u0431\u0443\u0447\u0430\u044e\u0449\u0443\u044e; split -  train\/test; factor \u2013 \u0441\u0442\u043e\u043b\u0431\u0435\u0446 \u0444\u0430\u043a\u0442\u043e\u0440\u0430. def woe(df, split_column, split, factor): woe = pd.concat([np.log((df[(df[split_column] == split) &amp; (df['default'] == 0)][factor]\\ .value_counts()\/df[(df[split_column] == split) &amp; (df['default'] == 0)][factor].count())\\     \/(df[(df[split_column] == split) &amp; (df['default'] == 1)][factor]\\     .value_counts()\/df[(df[split_column] == split) &amp; (df['default'] ==     1)][factor].count())).rename('WOE train')], axis=1)     return woe # \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0441\u0442\u043e\u043b\u0431\u0435\u0446 \u0434\u043b\u044f \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0444\u0430\u043a\u0442\u043e\u0440\u0430 woe_F13 = {'A': woe(df, 'split', 'train', 'F13')['WOE train']['A'],            'B': woe(df, 'split', 'train', 'F13')['WOE']['B],            'C': woe(df, 'split', 'train', 'F13')['WOE']['C'],            'D': woe(df, 'split', 'train', 'F13')['WOE']['D']             } df['F13_woe'] = df['F13'].replace(woe_F13)<\/code><\/pre>\n<p>\u041f\u043e \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0438 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u044e \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u0444\u0430\u043a\u0442\u043e\u0440\u044b (F14 \u2013 F17).<\/p>\n<p>\u0414\u043b\u044f \u043f\u0440\u043e\u0433\u043d\u043e\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e \u043b\u043e\u0433\u0438\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u043c\u043e\u0434\u0435\u043b\u044c.<\/p>\n<p>\u0417\u0430\u043f\u0438\u0448\u0443 \u0444\u0430\u043a\u0442\u043e\u0440\u044b \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u043b\u0438\u0441\u0442 \u0434\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430.<\/p>\n<pre><code>feat_cols = [F1, F2, F3, F4, F5, F8, F9, F13_woe, F14_woe, F15_woe, F17_woe] # \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u043c \u0434\u0430\u0442\u0430\u0441\u0435\u0442 \u043d\u0430 \u043e\u0431\u0443\u0447\u0430\u044e\u0449\u0443\u044e \u0438 \u0442\u0435\u0441\u0442\u043e\u0432\u0443\u044e \u0432\u044b\u0431\u043e\u0440\u043a\u0438 df_train = df[df['split'] == 'train'][['\u0418\u041d\u041d', 'ID \u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u044f', 'default', 'split'] + feat_cols].copy() df_test = df[df['split'] == 'test'] [['\u0418\u041d\u041d', 'ID \u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u044f', 'default', 'split'] + feat_cols].copy() df_full = pd.concat([df_train, df_test], axis = 0).reset_index() # \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 from sklearn.linear_model import LogisticRegression import statsmodels.api as sm # \u0441\u0442\u0440\u043e\u0438\u043c \u043c\u043e\u0434\u0435\u043b\u044c log_reg = sm.Logit(df_train['default'], df_train[feat_cols]).fit()<\/code><\/pre>\n<p>\u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u044e \u0414\u0436\u0438\u043d\u0438 train \/ test \u0434\u043b\u044f \u043f\u0440\u043e\u0433\u043d\u043e\u0437\u043d\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438.<\/p>\n<pre><code>from sklearn.metrics import roc_auc_score # \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c \u043c\u0435\u0442\u0440\u0438\u043a\u0443 roc auc print('Gini Train: ', 2 * roc_auc_score(df_full[df_full['split'] == 'train']['default'], log_reg.predict(df_full[df_full['split'] == 'train'][feat_cols])) - 1) print('Gini Test : ', 2 * roc_auc_score(df_full[df_full['split'] == 'test']['default'], log_reg.predict(df_full[df_full['split'] == 'test'][feat_cols])) - 1)<\/code><\/pre>\n<figure class=\"\"><figcaption><\/figcaption><\/figure>\n<p>\u041d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0445 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0431\u044b\u043b\u043e \u043f\u0440\u0438\u043d\u044f\u0442\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0434\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u0434\u0430\u043d\u043d\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438. \u041e\u0434\u043d\u0430\u043a\u043e, \u0432 \u0445\u043e\u0434\u0435 \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u043c\u043e\u0434\u0435\u043b\u0438 \u0431\u044b\u043b\u043e \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u043e \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043d\u043e\u0432\u043e\u0433\u043e \u0444\u0430\u043a\u0442\u043e\u0440\u0430 \u2013 F18. \u0414\u0430\u043d\u043d\u044b\u0439 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e woe \u0444\u0443\u043d\u043a\u0446\u0438\u0438. \u041f\u0435\u0440\u0435\u043e\u0431\u0443\u0447\u0438\u043b\u0438 \u043c\u043e\u0434\u0435\u043b\u044c \u0441 \u0443\u0447\u0435\u0442\u043e\u043c \u043d\u043e\u0432\u043e\u0433\u043e \u043d\u0430\u0431\u043e\u0440\u0430 \u043f\u0440\u0435\u0434\u0438\u043a\u0442\u043e\u0440\u043e\u0432 \u0438 \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u043b\u0438 \u0414\u0436\u0438\u043d\u0438. <\/p>\n<figure class=\"\"><figcaption><\/figcaption><\/figure>\n<p>\u041f\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430\u043c \u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u043d\u0430 \u043e\u0431\u0443\u0447\u0430\u044e\u0449\u0435\u0439 \u0432\u044b\u0431\u043e\u0440\u043a\u0435 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e \u043c\u043e\u0434\u0435\u043b\u0438 \u043b\u0443\u0447\u0448\u0435 \u0441 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u0444\u0430\u043a\u0442\u043e\u0440\u043e\u043c, \u0430 \u043d\u0430 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0439 \u2013 \u0431\u0435\u0437 \u043d\u0435\u0433\u043e. \u0422\u0430\u043a \u043a\u0430\u043a \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442\u0441\u044f \u0438\u0441\u0445\u043e\u0434\u044f \u0438\u0437 \u0431\u043e\u043b\u044c\u0448\u0435\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u043e Gini test, \u0442\u043e \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0444\u0430\u043a\u0442\u043e\u0440 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d \u0432 \u043c\u043e\u0434\u0435\u043b\u044c.<\/p>\n<p>\u0412\u044b\u0431\u043e\u0440 \u0432 \u043f\u043e\u043b\u044c\u0437\u0443 \u043c\u043e\u0434\u0435\u043b\u0438 \u0431\u0435\u0437 \u043d\u043e\u0432\u043e\u0433\u043e \u0444\u0430\u043a\u0442\u043e\u0440\u0430 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0440\u043e\u0442\u0438\u0432\u043e\u0440\u0435\u0447\u0438\u0432, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u0430\u0435\u043c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u043c\u0435\u0442\u0440\u0438\u043a\u0443 \u2013 \u0441\u0440\u0435\u0434\u043d\u044e\u044e \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u0443\u044e \u043e\u0448\u0438\u0431\u043a\u0443. \u0414\u0430\u043d\u043d\u044b\u0439 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f, \u043a\u0430\u043a \u0441\u0440\u0435\u0434\u043d\u0435\u0435 \u0440\u0430\u0437\u043d\u043e\u0441\u0442\u0435\u0439 \u043c\u0435\u0436\u0434\u0443 \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c\u0438 \u0438 \u043f\u0440\u043e\u0433\u043d\u043e\u0437\u043d\u044b\u043c\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438 \u0438 \u043d\u0435 \u043f\u0440\u043e\u0442\u0438\u0432\u043e\u0440\u0435\u0447\u0438\u0442 \u043b\u043e\u0433\u0438\u043a\u0435 \u0437\u0430\u0434\u0430\u0447\u0438. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u0443\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u0438 \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u043c \u043e\u0448\u0438\u0431\u043a\u0443 \u0434\u043b\u044f \u043c\u043e\u0434\u0435\u043b\u0438 \u0441 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u0444\u0430\u043a\u0442\u043e\u0440\u043e\u043c \u0438 \u0431\u0435\u0437 \u043d\u0435\u0433\u043e.<\/p>\n<pre><code>from sklearn.metrics import mean_absolute_error # MAE \u0434\u043b\u044f \u043c\u043e\u0434\u0435\u043b\u0438 \u0431\u0435\u0437 \u043d\u043e\u0432\u043e\u0433\u043e \u0444\u0430\u043a\u0442\u043e\u0440\u0430 print('MAE Train:', mean_absolute_error(df_full[df_full['split'] == 'train']['default'], log_reg.predict(df_full[df_full['split'] == 'train'][feat_cols]))) print('MAE Test:', mean_absolute_error(df_full[df_full['split'] == 'test']['default'], log_reg.predict(df_full[df_full['split'] == 'test'][feat_cols])))<\/code><\/pre>\n<figure class=\"\"><figcaption><\/figcaption><\/figure>\n<pre><code># MAE \u0434\u043b\u044f \u043c\u043e\u0434\u0435\u043b\u0438 \u0441 \u043d\u043e\u0432\u044b\u043c \u0444\u0430\u043a\u0442\u043e\u0440\u043e\u043c print('MAE Train \u043c\u043e\u0434\u0435\u043b\u0438 \u0441 \u0444\u0430\u043a\u0442\u043e\u0440\u043e\u043c F18:', mean_absolute_error(df_full[df_full['split'] == 'train']['default'], log_reg.predict(df_full[df_full['split'] == 'train'][feat_cols]))) print('MAE Test \u043c\u043e\u0434\u0435\u043b\u0438 \u0441 \u0444\u0430\u043a\u0442\u043e\u0440\u043e\u043c F18:', mean_absolute_error(df_full[df_full['split'] == 'test']['default'], log_reg.predict(df_full[df_full['split'] == 'test'][feat_cols])))<\/code><\/pre>\n<figure class=\"\"><figcaption><\/figcaption><\/figure>\n<p>\u0421\u0440\u0435\u0434\u043d\u044f\u044f \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430 \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043a\u0430\u043a \u00ab\u0447\u0435\u043c \u043c\u0435\u043d\u044c\u0448\u0435, \u0442\u0435\u043c \u043b\u0443\u0447\u0448\u0435\u00bb. \u041f\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430\u043c \u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u043c\u043e\u0434\u0435\u043b\u044c \u0441 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u0444\u0430\u043a\u0442\u043e\u0440\u043e\u043c \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u043b\u0430 \u0441 \u043c\u0435\u043d\u044c\u0448\u0435\u0439 \u043e\u0448\u0438\u0431\u043a\u043e\u0439. <\/p>\n<p>\u0421\u0440\u0430\u0432\u043d\u0438\u043c \u0432\u0441\u0435 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043c\u0435\u0442\u0440\u0438\u043a.<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td>\n<p>\u041f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c<\/p>\n<\/td>\n<td>\n<p>Split<\/p>\n<\/td>\n<td>\n<p>\u041c\u043e\u0434\u0435\u043b\u044c \u0431\u0435\u0437 \u0434\u043e\u043f.   \u0444\u0430\u043a\u0442\u043e\u0440\u0430 (1)<\/p>\n<\/td>\n<td>\n<p>\u041c\u043e\u0434\u0435\u043b\u044c \u0441 \u0434\u043e\u043f. \u0444\u0430\u043a\u0442\u043e\u0440\u043e\u043c   (2)<\/p>\n<\/td>\n<td>\n<p>\u041c\u043e\u0434\u0435\u043b\u044c \u0441   \u043b\u0443\u0447\u0448\u0438\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td rowspan=\"2\">\n<p>Gini<\/p>\n<\/td>\n<td>\n<p>Train<\/p>\n<\/td>\n<td>\n<p>0,5119<\/p>\n<\/td>\n<td>\n<p>0,5137<\/p>\n<\/td>\n<td>\n<p>2<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>Test<\/p>\n<\/td>\n<td>\n<p>0,6297<\/p>\n<\/td>\n<td>\n<p>0,6134<\/p>\n<\/td>\n<td>\n<p>1<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td rowspan=\"2\">\n<p>MAE<\/p>\n<\/td>\n<td>\n<p>Train<\/p>\n<\/td>\n<td>\n<p>0,3911<\/p>\n<\/td>\n<td>\n<p>0,3882<\/p>\n<\/td>\n<td>\n<p>2<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>Test<\/p>\n<\/td>\n<td>\n<p>0,3953<\/p>\n<\/td>\n<td>\n<p>0,3948<\/p>\n<\/td>\n<td>\n<p>2<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u0418\u0437 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0441\u043b\u0435\u0434\u0443\u0435\u0442, \u0447\u0442\u043e \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043d\u043e\u0432\u043e\u0433\u043e \u0444\u0430\u043a\u0442\u043e\u0440\u0430 F18 \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0435\u0442 \u043f\u0440\u043e\u0433\u043d\u043e\u0437\u043d\u0443\u044e \u0441\u0438\u043b\u0443 \u043c\u043e\u0434\u0435\u043b\u0438. \u041e\u0434\u043d\u0430\u043a\u043e, \u0442\u0430\u043a\u043e\u0439 \u0432\u044b\u0432\u043e\u0434 \u0441\u0442\u0430\u043b \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u043f\u043e\u0441\u043b\u0435 \u0440\u0430\u0441\u0447\u0435\u0442\u0430 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u043c\u0435\u0442\u0440\u0438\u043a\u0438. \u041d\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0432\u044b\u0432\u043e\u0434, \u0447\u0442\u043e \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u0430 \u0414\u0436\u0438\u043d\u0438 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0434\u043b\u044f \u043e\u0446\u0435\u043d\u043a\u0438 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0430 \u043c\u043e\u0434\u0435\u043b\u0438. \u0427\u0442\u043e\u0431\u044b \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u044c \u0433\u0438\u043f\u043e\u0442\u0435\u0437\u0443, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0431\u043e\u043b\u044c\u0448\u0435\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u043e\u0432. \u0410 \u0432 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u043e \u043d\u0430\u0447\u0430\u043b\u043e \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e.<\/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\/654907\/\"> https:\/\/habr.com\/ru\/post\/654907\/<\/a><br \/><\/br><\/br><\/p>\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-330474","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/330474","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=330474"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/330474\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=330474"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=330474"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=330474"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}