{"id":363062,"date":"2024-05-21T01:48:10","date_gmt":"2024-05-21T01:48:10","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=363062"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=363062","title":{"rendered":"<span>\u041a\u043e\u043d\u0442\u0440\u043e\u043b\u0438\u0440\u0443\u0435\u043c \u043f\u043e\u0433\u0440\u0443\u0437\u0447\u0438\u043a \u043d\u0430 \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437 \u0448\u0442\u0430\u0442\u043d\u043e\u0439 \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0434\u0432\u0438\u0433\u0430\u0442\u0435\u043b\u044f<\/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<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/26e\/8b7\/456\/26e8b74565a0487d0ba903aa75c21b26.png\" alt=\"\u0418\u043b\u043b\u044e\u0441\u0442\u0440\u0430\u0446\u0438\u044f: \" title=\"\u0418\u043b\u043b\u044e\u0441\u0442\u0440\u0430\u0446\u0438\u044f: \" width=\"4001\" height=\"2251\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/26e\/8b7\/456\/26e8b74565a0487d0ba903aa75c21b26.png\"\/><\/p>\n<div><figcaption>\u0418\u043b\u043b\u044e\u0441\u0442\u0440\u0430\u0446\u0438\u044f: <a class=\"mention\" href=\"\/users\/golts\">@GOLTS<\/a><\/figcaption><\/div>\n<\/figure>\n<p>\u041f\u0440\u0438\u0432\u0435\u0442, \u0425\u0430\u0431\u0440! <\/p>\n<p>\u041c\u0435\u043d\u044f \u0437\u043e\u0432\u0443\u0442 \u0418\u043b\u044c\u044f \u0420\u043e\u0434\u0438\u043d, \u044f \u0438\u043d\u0436\u0435\u043d\u0435\u0440 \u043f\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u00ab\u0420\u0435\u043a\u0441\u043e\u0444\u0442\u00bb. \u0421\u0435\u0439\u0447\u0430\u0441 \u044f \u0440\u0430\u0431\u043e\u0442\u0430\u044e \u0432 \u043a\u043e\u043c\u0430\u043d\u0434\u0435 \u0434\u0435\u043f\u0430\u0440\u0442\u0430\u043c\u0435\u043d\u0442\u0430 \u0433\u043e\u0440\u043d\u043e\u0434\u043e\u0431\u044b\u0432\u0430\u044e\u0449\u0438\u0445 \u0440\u0435\u0448\u0435\u043d\u0438\u0439 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0438\u0448\u0443 \u043e \u043d\u0430\u0441\u0443\u0449\u043d\u043e\u043c: \u043a\u0430\u043a \u0443\u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c \u0440\u0430\u0431\u043e\u0442\u044b \u0446\u0438\u043a\u043b\u043e\u0432 \u043f\u043e\u0433\u0440\u0443\u0437\u0447\u0438\u043a\u0430, \u0437\u0430\u0431\u0438\u0440\u0430\u044f \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u0448\u0442\u0430\u0442\u043d\u043e\u0439 \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0434\u0432\u0438\u0433\u0430\u0442\u0435\u043b\u044f. \u042d\u0442\u0443 \u0441\u0442\u0430\u0442\u044c\u044e \u044f \u043f\u0438\u0441\u0430\u043b \u0432\u043c\u0435\u0441\u0442\u0435 \u0441\u043e \u0441\u0432\u043e\u0438\u043c \u043a\u043e\u043b\u043b\u0435\u0433\u043e\u0439 <a class=\"mention\" href=\"\/users\/vlebedev_22\">@VLebedev_22<\/a>. <\/p>\n<p>\u0418\u0442\u0430\u043a, \u043f\u043e\u0435\u0445\u0430\u043b\u0438!<\/p>\n<h3>\u041f\u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0437\u0430\u0434\u0430\u0447\u0438<\/h3>\n<p>\u041d\u0430 \u0433\u043e\u0440\u043d\u043e\u0434\u043e\u0431\u044b\u0432\u0430\u044e\u0449\u0438\u0445 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0441\u0442\u0432\u0430\u0445, \u0432 \u0441\u0442\u0440\u043e\u0438\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u0435 \u0438 \u0432 \u0434\u0440\u0443\u0433\u0438\u0445 \u0441\u0444\u0435\u0440\u0430\u0445 \u043f\u0440\u043e\u043c\u044b\u0448\u043b\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0448\u0438\u0440\u043e\u043a\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0442\u0435\u0445\u043d\u0438\u043a\u0430 \u0434\u043b\u044f \u043f\u043e\u0433\u0440\u0443\u0437\u043a\u0438 \u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u0438\u044f \u0433\u043e\u0440\u043d\u043e\u0439 \u043c\u0430\u0441\u0441\u044b \u0438\u043b\u0438 \u0441\u044b\u043f\u0443\u0447\u0438\u0445 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u043e\u0432, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0444\u0440\u043e\u043d\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u043e\u0433\u0440\u0443\u0437\u0447\u0438\u043a\u0438 \u0438 \u044d\u043a\u0441\u043a\u0430\u0432\u0430\u0442\u043e\u0440\u044b. \u041e\u0434\u043d\u0430 \u0438\u0437 \u0432\u0430\u0436\u043d\u044b\u0445 \u0437\u0430\u0434\u0430\u0447 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0442\u0430\u043a\u0438\u043c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0441\u0442\u0432\u043e\u043c \u2013 \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u0442\u044c \u0432\u0440\u0435\u043c\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u043c\u0430\u0448\u0438\u043d\u044b, \u0434\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u043e\u0435\u0432, \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c, \u0436\u0435\u043b\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0441 \u043f\u0440\u0438\u0432\u044f\u0437\u043a\u043e\u0439 \u043a \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u043c\u0443 \u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044e\/\u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0443. \u042d\u0442\u043e \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0442\u044c \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u0438.<\/p>\n<p>\u041f\u0440\u0438 \u0442\u0440\u0430\u0434\u0438\u0446\u0438\u043e\u043d\u043d\u043e\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u0435 \u043a \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044f, \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0434\u0430\u0442\u0447\u0438\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u043b\u0438 \u0431\u044b \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0440\u0430\u0431\u043e\u0447\u0438\u0445 \u043e\u0440\u0433\u0430\u043d\u043e\u0432 \u043c\u0430\u0448\u0438\u043d\u044b, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0438\u0437\u043c\u0435\u0440\u044f\u043b\u0438 \u0434\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0432 \u0433\u0438\u0434\u0440\u0430\u0432\u043b\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043a\u043e\u043d\u0442\u0443\u0440\u0430\u0445 \u0438\u043b\u0438 \u0441\u0438\u043b\u0443 \u0442\u043e\u043a\u0430 \u043d\u0430 \u044d\u043b\u0435\u043a\u0442\u0440\u043e\u043f\u0440\u0438\u0432\u043e\u0434\u0430\u0445 (\u0435\u0441\u043b\u0438 \u044d\u0442\u043e \u043a\u0430\u043d\u0430\u0442\u043d\u044b\u0439 \u044d\u043a\u0441\u043a\u0430\u0432\u0430\u0442\u043e\u0440). \u041d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u044d\u0442\u0438\u0445 \u0441\u0438\u0433\u043d\u0430\u043b\u043e\u0432 \u0432\u044b\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438 \u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0440\u0430\u0431\u043e\u0447\u0438\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438, \u0438 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u0435\u0442 \u043e\u0442\u0434\u0435\u043b\u0438\u0442\u044c \u00ab\u0445\u043e\u043b\u043e\u0441\u0442\u044b\u0435\u00bb \u0446\u0438\u043a\u043b\u044b \u043e\u0442 \u0446\u0438\u043a\u043b\u043e\u0432 \u0441 \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0439 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u043e\u0439 (\u0432 \u043d\u0430\u0448\u0435\u043c \u043e\u043f\u044b\u0442\u0435 \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u043b\u0438\u0441\u044c \u043f\u0440\u0435\u0434\u043f\u0440\u0438\u0438\u043c\u0447\u0438\u0432\u044b\u0435 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0440\u0430\u0437\u0433\u0430\u0434\u044b\u0432\u0430\u043b\u0438 \u043b\u043e\u0433\u0438\u043a\u0443 \u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u0432 \u0438 \u043c\u043e\u0433\u043b\u0438 \u043f\u043e-\u0431\u044b\u0441\u0442\u0440\u043e\u043c\u0443 \u0437\u0430\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441\u0435\u0431\u0435 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u043e\u0447\u043a\u043e\u0432 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438, \u0441\u043e\u0432\u0435\u0440\u0448\u0430\u044f \u043c\u0430\u043d\u0438\u043f\u0443\u043b\u044f\u0446\u0438\u0438 \u043f\u0443\u0441\u0442\u044b\u043c \u043a\u043e\u0432\u0448\u043e\u043c).<br \/> \u041d\u0430\u0434\u043e \u043b\u0438 \u0433\u043e\u0432\u043e\u0440\u0438\u0442\u044c, \u0447\u0442\u043e \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0434\u0430\u0442\u0447\u0438\u043a\u043e\u0432 \u0438 \u043f\u0440\u043e\u0432\u043e\u0434\u043e\u0432 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u043b\u0430\u0431\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u043e\u0439 \u0442\u0430\u043a\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b? \u0420\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0451\u043d\u043d\u044b\u0439 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0439: \u043f\u0440\u0435\u0434\u043f\u0440\u0438\u044f\u0442\u0438\u0435 \u0432\u043d\u0435\u0434\u0440\u044f\u0435\u0442 \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0434\u0438\u0441\u043f\u0435\u0442\u0447\u0435\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u0430\u0440\u043a\u043e\u043c \u0442\u0435\u0445\u043d\u0438\u043a\u0438, \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0432\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u044d\u043a\u0441\u043f\u043b\u0443\u0430\u0442\u0430\u0446\u0438\u044e, \u0430 \u0447\u0435\u0440\u0435\u0437 \u0433\u043e\u0434 \u0443\u0436\u0435 30% \u0434\u0430\u0442\u0447\u0438\u043a\u043e\u0432 \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u043e\u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u044c \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0442\u0440\u0443\u0434\u043e\u0451\u043c\u043a\u043e, \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c \u0441\u043d\u0438\u0436\u0430\u0435\u0442\u0441\u044f.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/5d4\/dd1\/74f\/5d4dd174ffcce427c6d39fc9d39b8041.jpg\" width=\"1474\" height=\"817\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/5d4\/dd1\/74f\/5d4dd174ffcce427c6d39fc9d39b8041.jpg\" data-blurred=\"true\"\/><\/figure>\n<p><a href=\"https:\/\/habr.com\/ru\/articles\/748958\/\">\u0412 \u0434\u0440\u0443\u0433\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435<\/a> \u043a\u0430\u043a \u0440\u0430\u0437 <a href=\"https:\/\/habr.com\/ru\/users\/VLebedev_22\/\">@VLebedev_22<\/a> \u0443\u0436\u0435 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u043b \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0440\u0435\u0448\u0430\u0442\u044c \u044d\u0442\u0443 \u0437\u0430\u0434\u0430\u0447\u0443 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0433\u043e \u0437\u0440\u0435\u043d\u0438\u044f. \u00a0\u041d\u043e \u043d\u0430\u0448\u0430 \u043c\u044b\u0441\u043b\u044c \u043d\u0435 \u0441\u0442\u043e\u0438\u0442 \u043d\u0430 \u043c\u0435\u0441\u0442\u0435. \u041c\u044b \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u043b\u0438, \u0447\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u043e\u0431\u043e\u0439\u0442\u0438\u0441\u044c \u0435\u0449\u0451 \u043c\u0435\u043d\u044c\u0448\u0438\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u043e\u0431\u043e\u0440\u0443\u0434\u043e\u0432\u0430\u043d\u0438\u044f, \u0437\u0430\u0431\u0438\u0440\u0430\u044f \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u0448\u0442\u0430\u0442\u043d\u043e\u0439 \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0434\u0432\u0438\u0433\u0430\u0442\u0435\u043b\u044f. \u041e\u0431 \u044d\u0442\u043e\u043c \u0438 \u043f\u043e\u0432\u0435\u0434\u0435\u043c \u0440\u0430\u0441\u0441\u043a\u0430\u0437. <\/p>\n<p>\u0421\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043c\u0430\u0448\u0438\u043d\u044b \u043e\u0431\u043b\u0430\u0434\u0430\u044e\u0442 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0431\u043e\u0433\u0430\u0442\u044b\u043c \u043d\u0430\u0431\u043e\u0440\u043e\u043c \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0442\u0435\u043b\u0435\u043c\u0435\u0442\u0440\u0438\u0438 \u0434\u0432\u0438\u0433\u0430\u0442\u0435\u043b\u044f, \u0438 \u043e\u0442 \u043e\u0434\u043d\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u044b \u043a \u0434\u0440\u0443\u0433\u043e\u0439 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b CAN \u0438 \u043d\u0430\u0431\u043e\u0440 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0432 \u0446\u0435\u043b\u043e\u043c \u043d\u0435 \u043c\u0435\u043d\u044f\u044e\u0442\u0441\u044f (\u0432\u0435\u0437\u0434\u0435 \u0435\u0441\u0442\u044c \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435 \u00ab\u043e\u0431\u043e\u0440\u043e\u0442\u044b\u00bb, \u00ab\u043a\u0440\u0443\u0442\u044f\u0449\u0438\u0439 \u043c\u043e\u043c\u0435\u043d\u0442\u00bb \u0438 \u0442.\u043f.). \u0417\u043d\u0430\u0447\u0438\u0442, \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0438\u0441\u043a\u0430\u0442\u044c \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u044b \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0434\u0432\u0438\u0433\u0430\u0442\u0435\u043b\u044f \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b. \u041a\u0430\u0436\u0435\u0442\u0441\u044f, \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430 \u043d\u0430 \u0445\u043e\u043b\u043e\u0441\u0442\u043e\u043c \u0445\u043e\u0434\u0443 \u0431\u0443\u0434\u0435\u0442 \u044f\u0432\u043d\u043e \u043e\u0442\u043b\u0438\u0447\u0430\u0442\u044c\u0441\u044f \u043e\u0442 \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u043e\u0434 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u043e\u0439. \u0410 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f \u043b\u0438 \u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0440\u0430\u0431\u043e\u0447\u0438\u0435 \u0446\u0438\u043a\u043b\u044b (\u0440\u0435\u0439\u0441\u044b)? \u041e\u0442\u0434\u0435\u043b\u044f\u0442\u044c \u043f\u043e\u0433\u0440\u0443\u0437\u043a\u0443 \u043e\u0442 \u0440\u0430\u0437\u0433\u0440\u0443\u0437\u043a\u0438?<\/p>\n<p><strong>\u041a\u043e\u043d\u043a\u0440\u0435\u0442\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u0437\u0430\u0434\u0430\u0447\u0443.<\/strong> \u0412 \u0442\u0435\u0447\u0435\u043d\u0438\u0435 \u0440\u0430\u0431\u043e\u0447\u0435\u0439 \u0441\u043c\u0435\u043d\u044b \u0444\u0440\u043e\u043d\u0442\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u043e\u0433\u0440\u0443\u0437\u0447\u0438\u043a \u0441\u043e\u0432\u0435\u0440\u0448\u0430\u0435\u0442 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0440\u0430\u0431\u043e\u0447\u0438\u0445 \u0440\u0435\u0439\u0441\u043e\u0432. \u0420\u0435\u0439\u0441 \u2013 \u044d\u0442\u043e \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439: \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0433\u043e\u0440\u043d\u043e\u0439 \u043f\u043e\u0440\u043e\u0434\u044b \u0432 \u043a\u043e\u0432\u0448, \u0435\u0435 \u0442\u0440\u0430\u043d\u0441\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0430 \u0438 \u0432\u044b\u0433\u0440\u0443\u0437\u043a\u0430. <\/p>\n<blockquote>\n<p><em>\u0417\u0430\u0434\u0430\u0447\u0430 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u043f\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c \u0440\u044f\u0434\u0430\u043c \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0435\u0439 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0448\u0442\u0430\u0442\u043d\u044b\u0445 \u0434\u0430\u0442\u0447\u0438\u043a\u043e\u0432, \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u043e\u0434\u0441\u0447\u0438\u0442\u0430\u0442\u044c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u044b\u0445 \u0440\u0435\u0439\u0441\u043e\u0432. \u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u043f\u043e\u0436\u0435\u043b\u0430\u043d\u0438\u0435: \u043f\u043e\u0441\u0442\u0430\u0440\u0430\u0435\u043c\u0441\u044f \u043e\u0431\u043e\u0439\u0442\u0438\u0441\u044c \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u043c\u0435\u043d\u044c\u0448\u0438\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u0434\u0430\u0442\u0447\u0438\u043a\u043e\u0432, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u043e\u0441\u0442\u044b\u0435 \u0438 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435 \u0438\u0437 \u043d\u0438\u0445, \u0447\u0442\u043e\u0431\u044b \u0443\u043d\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0434\u043b\u044f \u0434\u0440\u0443\u0433\u0438\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0444\u0440\u043e\u043d\u0442\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u043e\u0433\u0440\u0443\u0437\u0447\u0438\u043a\u043e\u0432.<\/em><\/p>\n<p><em>\u0415\u0449\u0435 \u043e\u0434\u043d\u043e \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u0435 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043f\u043e\u0434\u0441\u0447\u0435\u0442 \u0440\u0435\u0439\u0441\u043e\u0432 \u0434\u043e\u043b\u0436\u0435\u043d \u0432\u0435\u0441\u0442\u0438\u0441\u044c \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438.<\/em><\/p>\n<\/blockquote>\n<h3>\u0414\u0430\u043d\u043d\u044b\u0435<\/h3>\n<p>\u0423 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u043b\u043e\u0433\u0438 \u0441 CAN-\u0448\u0438\u043d\u044b, \u0432\u043a\u043b\u044e\u0447\u0430\u044e\u0449\u0438\u0435 \u0432 \u0441\u0435\u0431\u044f \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0438:<\/p>\n<pre><code class=\"python\">sensors = [      '\u0422\u0435\u043a\u0443\u0449\u0438\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0434\u0432\u0438\u0433\u0430\u0442\u0435\u043b\u044f',      '\u041e\u0431\u043e\u0440\u043e\u0442\u044b \u0434\u0432\u0438\u0433\u0430\u0442\u0435\u043b\u044f',      '\u041f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043f\u0435\u0434\u0430\u043b\u0438 \u0433\u0430\u0437\u0430',      '\u041c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0430 \u0434\u0432\u0438\u0433\u0430\u0442\u0435\u043b\u0435',      '\u041d\u043e\u043c\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0435 \u0442\u0440\u0435\u043d\u0438\u0435 \u2014 \u043a\u0440\u0443\u0442\u044f\u0449\u0438\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0432 \u043f\u0440\u043e\u0446\u0435\u043d\u0442\u0430\u0445',      '\u041d\u0430\u043f\u0440\u044f\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 \u0432\u044b\u043a\u043b\u044e\u0447\u0430\u0442\u0435\u043b\u0435 \u0410\u041a\u0411',      '\u0422\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u0430 \u043e\u0445\u043b\u0430\u0436\u0434\u0430\u044e\u0449\u0435\u0439 \u0436\u0438\u0434\u043a\u043e\u0441\u0442\u0438',      '\u0414\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043d\u0430 \u0432\u0445\u043e\u0434\u0435 \u0432 \u043a\u043e\u043b\u043b\u0435\u043a\u0442\u043e\u0440 \u0434\u0432\u0438\u0433\u0430\u0442\u0435\u043b\u044f 1',      '\u0414\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043c\u043e\u0442\u043e\u0440\u043d\u043e\u0433\u043e \u043c\u0430\u0441\u043b\u0430',      '\u0422\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u0430 \u0432\u044b\u0445\u043b\u043e\u043f\u043d\u044b\u0445 \u0433\u0430\u0437\u043e\u0432 \u0434\u0432\u0438\u0433\u0430\u0442\u0435\u043b\u044f \u2014 \u043f\u0440\u0430\u0432\u044b\u0439 \u043a\u043e\u043b\u043b\u0435\u043a\u0442\u043e\u0440'  ]<\/code><\/pre>\n<p>\u0422\u0430\u043a\u0436\u0435 \u0435\u0441\u0442\u044c \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0430 \u044d\u0442\u0438\u0445 \u043b\u043e\u0433\u043e\u0432: \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0442\u043e\u0447\u043a\u0438 \u043c\u044b \u0437\u043d\u0430\u0435\u043c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0435 \u0435\u0439 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043f\u043e\u0433\u0440\u0443\u0437\u0447\u0438\u043a\u0430. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0439 \u0443 \u043d\u0430\u0441 4: \u043f\u0443\u0441\u0442\u043e\u0439, \u043f\u043e\u0433\u0440\u0443\u0437\u043a\u0430, \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u044b\u0439, \u0440\u0430\u0437\u0433\u0440\u0443\u0437\u043a\u0430:<\/p>\n<pre><code class=\"python\">from enum import Enum  class LoaderState(Enum):      EMPTY = 0      LOADING = 2      LOADED = 1      UNLOADING = 3<\/code><\/pre>\n<p>\u0412\u043e\u0442 \u0433\u0440\u0430\u0444\u0438\u043a \u0441 \u0443\u0447\u0430\u0441\u0442\u043a\u043e\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0433\u043e \u0440\u044f\u0434\u0430 \u043e\u0434\u043d\u043e\u0433\u043e \u0438\u0437 \u043d\u0430\u0448\u0438\u0445 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0435\u0439 (\u043e\u0431\u043e\u0440\u043e\u0442\u044b \u0434\u0432\u0438\u0433\u0430\u0442\u0435\u043b\u044f) \u0441 \u043d\u0430\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u043c\u0438 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f\u043c\u0438 \u043f\u043e\u0433\u0440\u0443\u0437\u0447\u0438\u043a\u0430:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/98c\/487\/422\/98c48742208b8f26da1b4eb6b3a750e8.png\" width=\"904\" height=\"424\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/98c\/487\/422\/98c48742208b8f26da1b4eb6b3a750e8.png\"\/><\/figure>\n<p>\u0421\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u043d\u0430 \u044d\u0442\u043e\u043c \u0433\u0440\u0430\u0444\u0438\u043a\u0435 \u043e\u043a\u0440\u0430\u0448\u0435\u043d\u044b \u0437\u0435\u043b\u0435\u043d\u044b\u043c, \u0444\u0438\u043e\u043b\u0435\u0442\u043e\u0432\u044b\u043c, \u0441\u0435\u0440\u044b\u043c \u0438 \u0436\u0435\u043b\u0442\u044b\u043c \u0446\u0432\u0435\u0442\u0430\u043c\u0438 (\u0441\u043c. \u043b\u0435\u0433\u0435\u043d\u0434\u0443). \u0412\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u0433\u0440\u0430\u0444\u0438\u043a \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f (\u043e\u0431\u043e\u0440\u043e\u0442\u043e\u0432 \u0434\u0432\u0438\u0433\u0430\u0442\u0435\u043b\u044f \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435) \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u0441 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0439 \u043f\u043e\u0433\u0440\u0443\u0437\u0447\u0438\u043a\u0430, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0445\u043e\u0440\u043e\u0448\u043e \u044d\u0442\u043e \u0437\u0430\u043c\u0435\u0442\u043d\u043e \u043f\u043e \u00ab\u0432\u0441\u043f\u043b\u0435\u0441\u043a\u0430\u043c\u00bb \u043f\u0440\u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0435 (\u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 LOADING \u0444\u0438\u043e\u043b\u0435\u0442\u043e\u0432\u043e\u0433\u043e \u0446\u0432\u0435\u0442\u0430). \u0410 \u0432\u043e\u0442, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u0440\u0438 \u0440\u0430\u0437\u0433\u0440\u0443\u0437\u043a\u0435 (UNLOADING \u0436\u0435\u043b\u0442\u043e\u0433\u043e \u0446\u0432\u0435\u0442\u0430) \u0432\u0441\u043f\u043b\u0435\u0441\u043a\u0438 \u043d\u0435 \u0442\u0430\u043a \u0437\u0430\u043c\u0435\u0442\u043d\u044b (\u0441\u043f\u043e\u0439\u043b\u0435\u0440: \u0438 \u0432 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c \u043d\u0430\u043c \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0445\u0438\u0442\u0440\u043e \u0438\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u044c\u0441\u044f, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c \u044d\u0442\u043e \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435).<\/p>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043c\u044b \u0438\u043c\u0435\u0435\u043c \u0437\u0430\u0434\u0430\u0447\u0443 supervised learning \u0441\u043e \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u043e\u0439 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0440\u044f\u0434\u043e\u0432: \u0434\u043b\u044f \u043d\u043e\u0432\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u2013 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0440\u044f\u0434\u043e\u0432 \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u044b\u0445 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0435\u0439 \u0441 \u0434\u0430\u0442\u0447\u0438\u043a\u043e\u0432 \u043d\u0430 \u043f\u043e\u0433\u0440\u0443\u0437\u0447\u0438\u043a\u0435 \u2013 \u043d\u0430\u043c \u043d\u0430\u0434\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u043a\u0430\u0436\u0434\u043e\u0439 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0442\u043e\u0447\u043a\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u043f\u043e\u0433\u0440\u0443\u0437\u0447\u0438\u043a\u0430, \u0447\u0442\u043e\u0431\u044b \u0437\u0430\u0442\u0435\u043c \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u0430\u0442\u044c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u044b\u0445 \u044d\u0442\u0438\u043c \u043f\u043e\u0433\u0440\u0443\u0437\u0447\u0438\u043a\u043e\u043c \u0440\u0435\u0439\u0441\u043e\u0432.<\/p>\n<p>\u0414\u0440\u0443\u0433\u0438\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438, \u044d\u0442\u043e \u0437\u0430\u0434\u0430\u0447\u0430 \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0440\u044f\u0434\u043e\u0432.<\/p>\n<h3>Feature engineering<\/h3>\n<p>\u0424\u0438\u0447\u0438 \u0438\u0437 \u043d\u0430\u0448\u0438\u0445 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0440\u044f\u0434\u043e\u0432 \u0431\u0443\u0434\u0435\u043c \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 tsfresh:<\/p>\n<pre><code class=\"python\">import tsfresh  from tsfresh import extract_features as extract_tsfresh_features, select_features  from tsfresh.utilities.dataframe_functions import impute  from tsfresh.feature_extraction import settings as tsfresh_settings  settings = tsfresh_settings.MinimalFCParameters()  settings.update(      tsfresh_settings.TimeBasedFCParameters()  )  settings.update(      tsfresh_settings.EfficientFCParameters()  )  def extract_features(df: pd.DataFrame) -> pd.DataFrame:      # \u0424\u0438\u043a\u0442\u0438\u0432\u043d\u0430\u044f \u043a\u043e\u043b\u043e\u043d\u043a\u0430 \u0434\u043b\u044f \u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u043a\u0438     copy_df = df.copy()     group_col = \"tsfresh\"     copy_df.loc[:, group_col] = 0          return extract_tsfresh_features(          copy_df,          column_id=group_col,          impute_function=impute,          default_fc_parameters=settings      )<\/code><\/pre>\n<p>\u0422\u0430\u043a\u0436\u0435 tsfresh \u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438 \u0443\u043c\u0435\u0435\u0442 \u043e\u0442\u043e\u0431\u0440\u0430\u0442\u044c \u0444\u0438\u0447\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u0435\u0442\u043e\u0434\u0430 relevant_features. \u0423\u0434\u043e\u0431\u043d\u043e \u043e\u0431\u0435\u0440\u043d\u0443\u0442\u044c \u043e\u0442\u0431\u043e\u0440 \u0444\u0438\u0447 \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441, \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u044b\u0439 \u0441 sklearn Pipeline:<\/p>\n<pre><code class=\"python\">from sklearn.base import BaseEstimator, TransformerMixin   class FeatureSelector(BaseEstimator, TransformerMixin):     def fit(self, X, y=None, **kwargs):         relevant_features = set()          for label in np.unique(y):             # select_features \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 \u0431\u0438\u043d\u0430\u0440\u043d\u043e\u0439 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0435\u0439, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0438\u043c \u0437\u0430\u0434\u0430\u0447\u0443             # \u0432 \u0431\u0438\u043d\u0430\u0440\u043d\u0443\u044e \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 \u0438 \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u0435\u043c \u043f\u043e \u0432\u0441\u0435\u043c \u043a\u043b\u0430\u0441\u0441\u0430\u043c             y_binary = y == label             X_filtered = tsfresh.select_features(X, y_binary)             relevant_features = relevant_features.union(set(X_filtered.columns))          self.relevant_features_ = relevant_features          return self      def transform(self, X, y=None):         return X[list(self.relevant_features_)]<\/code><\/pre>\n<h3>\u041e\u0431\u0449\u0435\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u0430 \u043a \u0440\u0435\u0448\u0435\u043d\u0438\u044e<\/h3>\n<p>\u041d\u0430\u0448\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u0442\u0430\u043a: \u0434\u0432\u0438\u0433\u0430\u0435\u043c\u0441\u044f \u043f\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u043c\u0443 \u0440\u044f\u0434\u0443 \u0441\u043a\u043e\u043b\u044c\u0437\u044f\u0449\u0438\u043c \u043e\u043a\u043d\u043e\u043c \u0440\u0430\u0437\u043c\u0435\u0440\u0430 window_size = 5 \u0441\u0435\u043a\u0443\u043d\u0434 \u0441 \u0448\u0430\u0433\u043e\u043c \u0442\u043e\u0436\u0435 window_size (\u0442.\u0435. \u043e\u043a\u043d\u0430 \u043d\u0435 \u043f\u0435\u0440\u0435\u0441\u0435\u043a\u0430\u044e\u0442\u0441\u044f). \u0418 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043e\u043a\u043d\u0430 \u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u0435\u0441\u0442\u044c \u043b\u0438 \u0432\u043d\u0443\u0442\u0440\u0438 \u043d\u0435\u0433\u043e \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0439 \u043f\u043e\u0433\u0440\u0443\u0437\u0447\u0438\u043a\u0430. \u0414\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 \u043c\u044b \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043c\u0435\u043d\u044f\u0435\u043c \u043d\u0430\u0448 \u0442\u0430\u0440\u0433\u0435\u0442: \u0431\u0443\u0434\u0435\u043c \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043d\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435(-\u044f) \u0432\u043d\u0443\u0442\u0440\u0438 \u043e\u043a\u043d\u0430, \u0430 \u0438\u0445 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f. <\/p>\n<p>\u0412\u0432\u0435\u0434\u0435\u043c \u043d\u043e\u0432\u044b\u0439 Enum:<\/p>\n<pre><code class=\"python\">class LoaderStateTransition(Enum):      EMPTY_NO_TRANSITION = 0      EMPTY_TO_LOADING = 1      LOADING_NO_TRANSITION = 2      LOADING_TO_LOADED = 3      LOADED_NO_TRANSITION = 4      LOADED_TO_UNLOADING = 5      UNLOADING_NO_TRANSITION = 6      UNLOADING_TO_EMPTY = 7      LOADING_TO_EMPTY = 8 # \u043d\u0435\u0443\u0434\u0430\u0447\u043d\u0430\u044f \u043f\u043e\u0433\u0440\u0443\u0437\u043a\u0430<\/code><\/pre>\n<p>\u0418\u043c\u0435\u043d\u0430 \u0442\u0443\u0442 self-explanatory, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, EMPTY_NO_TRANSITION \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u0432\u043d\u0443\u0442\u0440\u0438 \u043e\u043a\u043d\u0430 \u0435\u0441\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u043d\u043e \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u2013 EMPTY, \u0430 EMPTY_TO_LOADING \u2013 \u0447\u0442\u043e \u0432\u043d\u0443\u0442\u0440\u0438 \u043e\u043a\u043d\u0430 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 EMPTY \u0432 \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u043c\u043e\u043c\u0435\u043d\u0442 \u0441\u043c\u0435\u043d\u0438\u043b\u043e\u0441\u044c \u043d\u0430 LOADING. \u041a\u043e\u0434 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0430 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0445 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0439 LoaderState \u0432 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u044b \u043c\u0435\u0436\u0434\u0443 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f\u043c\u0438  LoaderStateTransition \u043e\u043f\u0443\u0441\u0442\u0438\u043c, \u043e\u043d \u0442\u0440\u0438\u0432\u0438\u0430\u043b\u0435\u043d.<\/p>\n<p>\u0421\u0430\u043c\u0430\u044f \u0433\u043b\u0430\u0432\u043d\u0430\u044f \u0438\u0434\u0435\u044f: <strong>\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f<\/strong>. \u041a\u0430\u0436\u0434\u0430\u044f \u0438\u0437 \u044d\u0442\u0438\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0442\u0440\u0435\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0430 \u043d\u0430 <strong>\u0441\u043c\u0435\u043d\u0443 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0439<\/strong> \u043f\u043e\u0433\u0440\u0443\u0437\u0447\u0438\u043a\u0430 \u0432 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u043c \u043c\u0435\u0441\u0442\u0435 \u043e\u043a\u043d\u0430. \u041d\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u044e, \u0447\u0442\u043e \u043c\u044b \u0434\u0432\u0438\u0433\u0430\u0435\u043c\u0441\u044f \u043f\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u043c\u0443 \u0440\u044f\u0434\u043e\u043c \u0441\u043a\u043e\u043b\u044c\u0437\u044f\u0449\u0438\u043c \u043e\u043a\u043d\u043e\u043c \u0440\u0430\u0437\u043c\u0435\u0440\u0430 window_size = 5 \u0441\u0435\u043a\u0443\u043d\u0434.<\/p>\n<p>\u0422\u0440\u0435\u043d\u0438\u0440\u0443\u0435\u043c n_models = windows_size &#8212; 2 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c: \u0435\u0441\u043b\u0438 \u0442\u0435\u043a\u0443\u0449\u0435\u0435 \u043e\u043a\u043d\u043e \u043d\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u043f\u043e\u0433\u0440\u0443\u0437\u0447\u0438\u043a\u0430, \u0441\u043a\u0430\u0440\u043c\u043b\u0438\u0432\u0430\u0435\u043c \u0435\u0433\u043e \u0434\u043b\u044f \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u0432\u0441\u0435\u043c \u043c\u043e\u0434\u0435\u043b\u044f\u043c, \u0438\u043d\u0430\u0447\u0435 \u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u0432 \u043a\u0430\u043a\u043e\u0439 \u0442\u043e\u0447\u043a\u0435 i \u043e\u043a\u043d\u0430 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f, \u0438 \u0441\u043a\u0430\u0440\u043c\u043b\u0438\u0432\u0430\u0435\u043c \u0444\u0438\u0447\u0438 \u043e\u043a\u043d\u0430 \u043d\u0430 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435 i-\u0439 \u043c\u043e\u0434\u0435\u043b\u0438.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/fe5\/ec4\/23f\/fe5ec423faa977d9283d0f32657f7fb4.jpg\" alt=\"\u0418\u043b\u043b\u044e\u0441\u0442\u0440\u0430\u0446\u0438\u044f: \" title=\"\u0418\u043b\u043b\u044e\u0441\u0442\u0440\u0430\u0446\u0438\u044f: \" width=\"1280\" height=\"720\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/fe5\/ec4\/23f\/fe5ec423faa977d9283d0f32657f7fb4.jpg\" data-blurred=\"true\"\/><\/p>\n<div><figcaption>\u0418\u043b\u043b\u044e\u0441\u0442\u0440\u0430\u0446\u0438\u044f: <a class=\"mention\" href=\"\/users\/golts\">@GOLTS<\/a><\/figcaption><\/div>\n<\/figure>\n<p>\u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0431\u0430\u0437\u043e\u0432\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u043d\u044b\u0439 \u0431\u0443\u0441\u0442\u0438\u043d\u0433 \u2014 XGBClassifier \u0438\u0437 xgboost.<\/p>\n<p>\u041d\u0430\u043f\u0438\u0448\u0435\u043c \u0443\u0434\u043e\u0431\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 CompositePipeline, \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u044b\u0439 \u0441 sklearn, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0432\u043d\u0443\u0442\u0440\u0438 \u0441\u0435\u0431\u044f \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u043f\u043e \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d\u0443 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438:<\/p>\n<pre><code class=\"python\">import numpy as np from sklearn.base import BaseEstimator, ClassifierMixin from sklearn.pipeline import Pipeline from sklearn.utils.validation import check_X_y, check_array  from dataclasses import dataclass from enum import Enum from typing import Optional   @dataclass class CompositePrediction:     label: int     prob: float     model_ind: Optional[int]     target_class: Optional[type[Enum]]      def as_enum(self) -> Optional[Enum]:         if self.target_class is not None:             return self.target_class(self.label)         return None      def __lt__(self, other):         return self.prob &lt; other.prob      def __str__(self) -> str:         if (enum_obj := self.as_enum()) is not None:             name = enum_obj.name         else:             name = str(self.label)         return f\"{name}: p={self.prob:0.4f}; model {self.model_ind}\"   class CompositePipeline(BaseEstimator, ClassifierMixin):     def __init__(self, steps_info: list[tuple[str, type, dict]], n_models: int = 1, target_class: Optional[type[Enum]] = None):         self.steps_info = steps_info         self.n_models = n_models         self.target_class = target_class      def fit(self, X, y, **kwargs):         # Check that X and y have correct shape         check_X_y(X, y)          if self.n_models > 1:             model_indices = kwargs['model_indices']             model_indices = model_indices.values if hasattr(model_indices, 'columns') else model_indices         else:             model_indices = np.ones((X.shape[0], 1), dtype=int)          if model_indices.shape[1] != self.n_models:             raise ValueError(\"Number of columns in model_indices and n_models mismatch!\")         if X.shape[0] != model_indices.shape[0]:             raise ValueError(\"Shapes of data and model_indices mismatch!\")          # Create pipelines:         pipes = []         for _ in range(self.n_models):             steps = []             for (name, cls, step_kwargs) in self.steps_info:                 estimator = cls(**step_kwargs)                 steps.append((name, estimator))             pipe = Pipeline(steps)             pipes.append(pipe)         self.pipes = pipes          # Fit pipelines:         for i, pipe in enumerate(self.pipes):             # \u041e\u0442\u0431\u0438\u0440\u0430\u0435\u043c \u0432\u0441\u0435 \u0441\u0442\u0440\u043e\u043a\u0438 \u0438\u0437 X \u0438 \u044d\u043b-\u0442\u044b \u0438\u0437 y, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u044d\u0442\u043e\u0439 \u0442\u0440\u0443\u0431\u0435:             mask_i = model_indices[:, i] == 1             X_i = X[mask_i]             y_i = y[mask_i]              pipe.fit(X_i, y_i)          self.classes_ = self.pipes[0][-1].classes_         self.n_features_in_ = X.shape[1]          return self      def predict(self, X) -> np.ndarray:         # Input validation         check_array(X)          # \u0421\u043e\u0431\u0438\u0440\u0430\u0435\u043c \u0432\u0441\u0435 \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u043d\u0438\u044f \u043e\u0442 \u0432\u0441\u0435\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439         n_rows = X.shape[0]         n_classes = len(self.classes_)         all_predictions = np.zeros((self.n_models, n_rows, n_classes), dtype=object)         for model_ind, clf in enumerate(self.pipes):             model_probs = clf.predict_proba(X)              model_predictions = []             for row_probs in model_probs:                 model_predictions.append([])                 for label, prob in zip(self.classes_, row_probs):                     prediction_obj = CompositePrediction(                         label=label,                         prob=prob,                         model_ind=model_ind,                         target_class=self.target_class                     )                     model_predictions[-1].append(prediction_obj)              all_predictions[model_ind] = model_predictions          # \u0414\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 \u0431\u0435\u0440\u0435\u043c \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0435\u0433\u043e \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u043d\u0438\u0435 \u0441\u0440\u0435\u0434\u0438 \u0432\u0441\u0435\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439:         predictions_table = np.sort(all_predictions, axis=0)[-1, :, :]          return predictions_table<\/code><\/pre>\n<p>\u0415\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:<\/p>\n<pre><code class=\"python\">from sklearn.preprocessing import StandardScaler  from sklearn.decomposition import PCA  from xgboost import XGBClassifier   pipe = CompositePipeline(steps_info=[      ('tsfresh_feature_selector', FeatureSelector, {}),      ('scaler', StandardScaler, {}),      ('pca', PCA, {'n_components': 0.95}),      ('model', XGBClassifier, {'objective': 'multi:softmax'})  ], n_models=n_models, target_class=LoaderStateTransition)  pipe.fit(X_train, y_train, model_indices=model_indices_train)  y_pred = pipe.predict(X_test)<\/code><\/pre>\n<p>\u0417\u0434\u0435\u0441\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 model_indices \u0432 \u043c\u0435\u0442\u043e\u0434\u0435 fit \u2014 \u044d\u0442\u043e \u0434\u0430\u0442\u0430-\u0444\u0440\u0435\u0439\u043c \u0438\u043b\u0438 \u0434\u0432\u0443\u043c\u0435\u0440\u043d\u044b\u0439 \u043c\u0430\u0441\u0441\u0438\u0432 \u043d\u0443\u043b\u0435\u0439 \u0438 \u0435\u0434\u0438\u043d\u0438\u0446, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c i-\u044f \u043a\u043e\u043b\u043e\u043d\u043a\u0430 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 1 \u0432 \u0442\u0435\u0445 \u0441\u0442\u0440\u043e\u043a\u0430\u0445, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0434\u043e\u043b\u0436\u043d\u0430 \u043e\u0431\u0443\u0447\u0430\u0442\u044c\u0441\u044f i-\u044f \u043c\u043e\u0434\u0435\u043b\u044c, \u0438 0 &#8212; \u0432\u043e \u0432\u0441\u0435\u0445 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0445 \u0441\u0442\u0440\u043e\u043a\u0430\u0445 (one-hot encoding).<\/p>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 (\u0442.\u0435. \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0433\u043e \u043e\u043a\u043d\u0430) \u043c\u044b \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e CompositePipeline \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0430\u0431\u043e\u0440 \u043f\u0440\u043e\u0433\u043d\u043e\u0437\u043e\u0432 \u2014 \u043f\u043e \u043e\u0434\u043d\u043e\u043c\u0443 \u043e\u0442 \u043a\u0430\u0436\u0434\u043e\u0439 \u0438\u0437 \u043d\u0430\u0448\u0438\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439. \u041f\u0440\u043e\u0433\u043d\u043e\u0437 \u043a\u0430\u0436\u0434\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 \u0434\u043b\u044f \u043e\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u2014 \u044d\u0442\u043e \u043c\u0430\u0441\u0441\u0438\u0432 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0435\u0439 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0433\u043e \u043b\u0435\u0439\u0431\u043b\u0430-\u0442\u0430\u0440\u0433\u0435\u0442\u0430 \u0442\u0438\u043f\u0430 LoaderStateTransition. \u041e\u0441\u0442\u0430\u0432\u0438\u043c \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e LoaderStateTransition \u043d\u0430\u0438\u0431\u043e\u043b\u044c\u0448\u0435\u0435 \u0435\u0433\u043e \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u043d\u0438\u0435 \u0441\u0440\u0435\u0434\u0438 \u0432\u0441\u0435\u0445 \u043e\u043f\u0440\u043e\u0448\u0435\u043d\u043d\u044b\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 (\u0442.\u0435. \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u043d\u0438\u0435 \u0441 \u043d\u0430\u0438\u0431\u043e\u043b\u044c\u0448\u0435\u0439 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c\u044e). \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043f\u043e \u043c\u0435\u0440\u0435 \u043f\u0440\u043e\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u044f n \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043e\u043a\u043e\u043d \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u043f\u0440\u043e\u0433\u043d\u043e\u0437\u043e\u0432 \u0438\u0437 n \u0441\u0442\u0440\u043e\u043a (= \u0447\u0438\u0441\u043b\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043e\u043a\u043e\u043d) \u0438 m=9 \u0441\u0442\u043e\u043b\u0431\u0446\u043e\u0432 (\u043f\u043e \u0447\u0438\u0441\u043b\u0443 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 LoaderStateTransition):<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td data-colwidth=\"85\" width=\"85\">\n<p align=\"left\">\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"108\" width=\"108\">\n<p align=\"left\">EMPTY_NO_TRANSITION<\/p>\n<\/td>\n<td data-colwidth=\"108\" width=\"108\">\n<p align=\"left\">EMPTY_TO_LOADING<\/p>\n<\/td>\n<td data-colwidth=\"125\" width=\"125\">\n<p align=\"left\">LOADING_NO_TRANSITION<\/p>\n<\/td>\n<td data-colwidth=\"126\" width=\"126\">\n<p align=\"left\">LOADING_TO_LOADED<\/p>\n<\/td>\n<td data-colwidth=\"120\" width=\"120\">\n<p align=\"left\">LOADED_NO_TRANSITION<\/p>\n<\/td>\n<td data-colwidth=\"120\" width=\"120\">\n<p align=\"left\">LOADED_TO_UNLOADING<\/p>\n<\/td>\n<td data-colwidth=\"154\" width=\"154\">\n<p align=\"left\">UNLOADING_NO_TRANSITION<\/p>\n<\/td>\n<td data-colwidth=\"147\" width=\"147\">\n<p align=\"left\">UNLOADING_TO_EMPTY<\/p>\n<\/td>\n<td data-colwidth=\"124\" width=\"124\">\n<p align=\"left\">LOADING_TO_EMPTY<\/p>\n<\/td>\n<td>\n<p align=\"left\">\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"85\" width=\"85\">\n<p align=\"left\">13:08:06-13:08:10<\/p>\n<\/td>\n<td data-colwidth=\"108\" width=\"108\">\n<p align=\"left\"><strong>0.9935<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"108\" width=\"108\">\n<p align=\"left\">0.0002<\/p>\n<\/td>\n<td data-colwidth=\"125\" width=\"125\">\n<p align=\"left\">0.0002<\/p>\n<\/td>\n<td data-colwidth=\"126\" width=\"126\">\n<p align=\"left\">0.0014 <\/p>\n<\/td>\n<td data-colwidth=\"120\" width=\"120\">\n<p align=\"left\">0.0246<\/p>\n<\/td>\n<td data-colwidth=\"120\" width=\"120\">\n<p align=\"left\">0.0008<\/p>\n<\/td>\n<td data-colwidth=\"154\" width=\"154\">\n<p align=\"left\">0.0025<\/p>\n<\/td>\n<td data-colwidth=\"147\" width=\"147\">\n<p align=\"left\">0.0040<\/p>\n<\/td>\n<td data-colwidth=\"124\" width=\"124\">\n<p align=\"left\">0.0002<\/p>\n<\/td>\n<td>\n<p align=\"left\">\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"85\" width=\"85\">\n<p align=\"left\">13:08:11-13:08:15<\/p>\n<\/td>\n<td data-colwidth=\"108\" width=\"108\">\n<p align=\"left\">0.0091<\/p>\n<\/td>\n<td data-colwidth=\"108\" width=\"108\">\n<p align=\"left\"><strong>0.9945<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"125\" width=\"125\">\n<p align=\"left\">0.0017<\/p>\n<\/td>\n<td data-colwidth=\"126\" width=\"126\">\n<p align=\"left\">0.0008<\/p>\n<\/td>\n<td data-colwidth=\"120\" width=\"120\">\n<p align=\"left\">0.0052<\/p>\n<\/td>\n<td data-colwidth=\"120\" width=\"120\">\n<p align=\"left\">0.0006<\/p>\n<\/td>\n<td data-colwidth=\"154\" width=\"154\">\n<p align=\"left\">0.0009<\/p>\n<\/td>\n<td data-colwidth=\"147\" width=\"147\">\n<p align=\"left\">0.0003 <\/p>\n<\/td>\n<td data-colwidth=\"124\" width=\"124\">\n<p align=\"left\">0.0003<\/p>\n<\/td>\n<td>\n<p align=\"left\">\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"85\" width=\"85\">\n<p align=\"left\">13:08:16-13:08:20<\/p>\n<\/td>\n<td data-colwidth=\"108\" width=\"108\">\n<p align=\"left\">0.0054<\/p>\n<\/td>\n<td data-colwidth=\"108\" width=\"108\">\n<p align=\"left\">0.0002<\/p>\n<\/td>\n<td data-colwidth=\"125\" width=\"125\">\n<p align=\"left\"><strong>0.9987<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"126\" width=\"126\">\n<p align=\"left\">0.0001<\/p>\n<\/td>\n<td data-colwidth=\"120\" width=\"120\">\n<p align=\"left\">0.0019<\/p>\n<\/td>\n<td data-colwidth=\"120\" width=\"120\">\n<p align=\"left\">0.0001<\/p>\n<\/td>\n<td data-colwidth=\"154\" width=\"154\">\n<p align=\"left\">0.0001<\/p>\n<\/td>\n<td data-colwidth=\"147\" width=\"147\">\n<p align=\"left\">0.0001<\/p>\n<\/td>\n<td data-colwidth=\"124\" width=\"124\">\n<p align=\"left\">0.0000<\/p>\n<\/td>\n<td>\n<p align=\"left\">\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"85\" width=\"85\">\n<p align=\"left\">&#8230;<\/p>\n<\/td>\n<td data-colwidth=\"108\" width=\"108\">\n<p align=\"left\">\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"108\" width=\"108\">\n<p align=\"left\">\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"125\" width=\"125\">\n<p align=\"left\">\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"126\" width=\"126\">\n<p align=\"left\">\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"120\" width=\"120\">\n<p align=\"left\">\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"120\" width=\"120\">\n<p align=\"left\">\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"154\" width=\"154\">\n<p align=\"left\">\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"147\" width=\"147\">\n<p align=\"left\">\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"124\" width=\"124\">\n<p align=\"left\">\u00a0<\/p>\n<\/td>\n<td>\n<p align=\"left\">\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<h3>\u0422\u0435\u043e\u0440\u0438\u044f \u0433\u0440\u0430\u0444\u043e\u0432<\/h3>\n<p>\u041d\u0430\u043c \u043e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u043f\u043e\u043d\u044f\u0442\u044c, \u043a\u0430\u043a \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u00ab\u043d\u0430\u0438\u043b\u0443\u0447\u0448\u0435\u0435\u00bb \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u043d\u0438\u0435 \u0432 \u043a\u0430\u0436\u0434\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435, \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u0439 \u043d\u0430\u043c\u0438 \u0442\u0430\u0431\u043b\u0438\u0446\u044b. \u041d\u0430 \u0443\u043c \u0441\u0440\u0430\u0437\u0443 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442 \u0436\u0430\u0434\u043d\u044b\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u2014 \u0430 \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043e\u043a\u043d\u0430 (\u0441\u0442\u0440\u043e\u043a\u0438 \u0442\u0430\u0431\u043b\u0438\u0446\u044b) \u0431\u0440\u0430\u0442\u044c \u043f\u0440\u043e\u0433\u043d\u043e\u0437 \u0441\u0430\u043c\u043e\u0439 \u0443\u0432\u0435\u0440\u0435\u043d\u043d\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438, \u0442.\u0435. \u043f\u0440\u043e\u0433\u043d\u043e\u0437 \u0441 \u043d\u0430\u0438\u0431\u043e\u043b\u044c\u0448\u0438\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0438. \u041a \u043f\u0440\u0438\u043c\u0435\u0440\u0443, \u0434\u043b\u044f \u043f\u0435\u0440\u0432\u044b\u0445 \u0442\u0440\u0435\u0445 \u0441\u0442\u0440\u043e\u043a \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0432\u044b\u0448\u0435 \u0446\u0435\u043f\u043e\u0447\u043a\u0430 \u043f\u0440\u043e\u0433\u043d\u043e\u0437\u043e\u0432 \u0431\u0443\u0434\u0435\u0442 \u0442\u0430\u043a\u0430\u044f: EMPTY_NO_TRANSITION \u2014 EMPTY_TO_LOADING \u2014 LOADING_NO_TRANSITION.<\/p>\n<p>\u041d\u043e \u0432\u043e\u0442 \u0431\u0435\u0434\u0430: \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0431\u0443\u0434\u0435\u0442 \u043f\u043b\u043e\u0445\u0438\u043c. \u041d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043a\u043b\u0430\u0441\u0441\u044b \u0432 \u043d\u0430\u0448\u0435\u0439 \u0437\u0430\u0434\u0430\u0447\u0435 \u043f\u043b\u043e\u0445\u043e \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u043c\u044b \u043c\u0435\u0436\u0434\u0443 \u0441\u043e\u0431\u043e\u0439, \u0438 \u043c\u043e\u0434\u0435\u043b\u0438 \u0431\u0443\u0434\u0443\u0442 \u0438\u0445 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u043f\u0443\u0442\u0430\u0442\u044c. \u0412 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438, \u043a\u043b\u0430\u0441\u0441 EMPTY_NO_TRANSITION \u043f\u043b\u043e\u0445\u043e \u0440\u0430\u0437\u043b\u0438\u0447\u0438\u043c \u0441 LOADING_TO_EMPTY.<\/p>\n<p>\u0412\u043e\u0442 \u0433\u0440\u0430\u0444\u0438\u043a \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0438\u0445 (ground truth) \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0439 \u043f\u043e\u0433\u0440\u0443\u0437\u0447\u0438\u043a\u0430 \u0432 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/528\/641\/51e\/52864151eea7367c499933d967d197af.png\" alt=\"\u0427\u0438\u0441\u043b\u043e \u0440\u0435\u0439\u0441\u043e\u0432: 13 \u0427\u0438\u0441\u043b\u043e \u043d\u0435\u0443\u0434\u0430\u0447\u043d\u044b\u0445 \u043f\u043e\u0433\u0440\u0443\u0437\u043e\u043a: 2\" title=\"\u0427\u0438\u0441\u043b\u043e \u0440\u0435\u0439\u0441\u043e\u0432: 13 \u0427\u0438\u0441\u043b\u043e \u043d\u0435\u0443\u0434\u0430\u0447\u043d\u044b\u0445 \u043f\u043e\u0433\u0440\u0443\u0437\u043e\u043a: 2\" width=\"851\" height=\"177\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/528\/641\/51e\/52864151eea7367c499933d967d197af.png\"\/><\/p>\n<div><figcaption>\u0427\u0438\u0441\u043b\u043e \u0440\u0435\u0439\u0441\u043e\u0432: 13<br \/> \u0427\u0438\u0441\u043b\u043e \u043d\u0435\u0443\u0434\u0430\u0447\u043d\u044b\u0445 \u043f\u043e\u0433\u0440\u0443\u0437\u043e\u043a: 2<\/figcaption><\/div>\n<\/figure>\n<p>\u0410 \u0432\u043e\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0440\u0430\u0431\u043e\u0442\u044b \u0436\u0430\u0434\u043d\u043e\u0433\u043e \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 (\u043f\u043e\u0441\u043b\u0435 \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0430\u0446\u0438\u0438 \u0442\u0438\u043f\u0430 \u0442\u0430\u0440\u0433\u0435\u0442\u0430 \u0432 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 LoaderSate):<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/393\/782\/e50\/393782e509573da4af951ce32254b8fb.png\" alt=\"\u0427\u0438\u0441\u043b\u043e \u0440\u0435\u0439\u0441\u043e\u0432: 26 \u0427\u0438\u0441\u043b\u043e \u043d\u0435\u0443\u0434\u0430\u0447\u043d\u044b\u0445 \u043f\u043e\u0433\u0440\u0443\u0437\u043e\u043a: 4\" title=\"\u0427\u0438\u0441\u043b\u043e \u0440\u0435\u0439\u0441\u043e\u0432: 26 \u0427\u0438\u0441\u043b\u043e \u043d\u0435\u0443\u0434\u0430\u0447\u043d\u044b\u0445 \u043f\u043e\u0433\u0440\u0443\u0437\u043e\u043a: 4\" width=\"851\" height=\"177\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/393\/782\/e50\/393782e509573da4af951ce32254b8fb.png\"\/><\/p>\n<div><figcaption>\u0427\u0438\u0441\u043b\u043e \u0440\u0435\u0439\u0441\u043e\u0432: 26<br \/> \u0427\u0438\u0441\u043b\u043e \u043d\u0435\u0443\u0434\u0430\u0447\u043d\u044b\u0445 \u043f\u043e\u0433\u0440\u0443\u0437\u043e\u043a: 4<\/figcaption><\/div>\n<\/figure>\n<p>\u0420\u0430\u0437\u043d\u0438\u0446\u0430 \u043f\u043e \u0447\u0438\u0441\u043b\u0443 \u0440\u0435\u0439\u0441\u043e\u0432 \u0430\u0436 \u0432 2 \u0440\u0430\u0437\u0430, \u0447\u0442\u043e, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u043d\u0438\u043a\u0443\u0434\u0430 \u043d\u0435 \u0433\u043e\u0434\u0438\u0442\u0441\u044f.<\/p>\n<p>\u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0437\u0430\u0434\u0430\u0447\u0435. \u0410 \u0438\u043c\u0435\u043d\u043d\u043e, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f \u043f\u043e \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0430\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0439 \u0434\u0440\u0443\u0433 \u0432 \u0434\u0440\u0443\u0433\u0430. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u043e \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u00ab\u041f\u0443\u0441\u0442\u043e\u0439\u00bb \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0441\u0440\u0430\u0437\u0443 \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u0432 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u00ab\u0420\u0430\u0437\u0433\u0440\u0443\u0436\u0430\u0435\u0442\u0441\u044f\u00bb, \u043c\u0438\u043d\u0443\u044f \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u00ab\u0417\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442\u0441\u044f\u00bb \u0438 \u00ab\u0417\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u00bb.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/8dd\/a68\/348\/8dda68348f979c9883985ec753e53e4c.png\" alt=\"\u0418\u043b\u043b\u044e\u0441\u0442\u0440\u0430\u0446\u0438\u044f: \" title=\"\u0418\u043b\u043b\u044e\u0441\u0442\u0440\u0430\u0446\u0438\u044f: \" width=\"4001\" height=\"2251\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/8dd\/a68\/348\/8dda68348f979c9883985ec753e53e4c.png\"\/><\/p>\n<div><figcaption>\u0418\u043b\u043b\u044e\u0441\u0442\u0440\u0430\u0446\u0438\u044f: <a class=\"mention\" href=\"\/users\/golts\">@GOLTS<\/a><\/figcaption><\/div>\n<\/figure>\n<p>\u041a\u043e\u0434 \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u043e\u0432 \u043c\u0435\u0436\u0434\u0443, \u0438\u0437\u0432\u0438\u043d\u0438\u0442\u0435 \u0437\u0430 \u0442\u0430\u0432\u0442\u043e\u043b\u043e\u0433\u0438\u044e, \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0430\u043c\u0438 LoaderStateTransition:<\/p>\n<pre><code class=\"python\">def get_possible_transitions(         as_int: bool = True ) -> dict[LoaderStateTransition, list[LoaderStateTransition]] | dict[int, list[int]]:     \"\"\"     \u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0441\u043b\u043e\u0432\u0430\u0440\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u043e\u0432 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0439.     \u041a\u043b\u044e\u0447 - \u0438\u0437 \u043a\u0430\u043a\u043e\u0433\u043e \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c, \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f - \u0432 \u043a\u0430\u043a\u0438\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u043c\u043e\u0436\u0435\u043c \u043f\u0435\u0440\u0435\u0439\u0442\u0438.     \"\"\"     d = {         LoaderStateTransition.EMPTY_NO_TRANSITION: [             LoaderStateTransition.EMPTY_NO_TRANSITION,             LoaderStateTransition.EMPTY_TO_LOADING,             LoaderStateTransition.LOADING_NO_TRANSITION,  # \u043a\u043e\u0433\u0434\u0430 \u0441\u043c\u0435\u043d\u0430 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0439 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043d\u0430 \u0433\u0440\u0430\u043d\u0438\u0446\u0435 \u043e\u043a\u043d\u0430         ],         LoaderStateTransition.EMPTY_TO_LOADING: [             LoaderStateTransition.LOADING_NO_TRANSITION,             LoaderStateTransition.LOADING_TO_LOADED,             LoaderStateTransition.LOADING_TO_EMPTY,         ],         LoaderStateTransition.LOADING_NO_TRANSITION: [             LoaderStateTransition.LOADING_NO_TRANSITION,             LoaderStateTransition.LOADING_TO_LOADED,             LoaderStateTransition.LOADING_TO_EMPTY,             LoaderStateTransition.LOADED_NO_TRANSITION,  # \u043a\u043e\u0433\u0434\u0430 \u0441\u043c\u0435\u043d\u0430 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0439 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043d\u0430 \u0433\u0440\u0430\u043d\u0438\u0446\u0435 \u043e\u043a\u043d\u0430         ],         LoaderStateTransition.LOADING_TO_LOADED: [             LoaderStateTransition.LOADED_NO_TRANSITION,             LoaderStateTransition.LOADED_TO_UNLOADING,         ],         LoaderStateTransition.LOADED_NO_TRANSITION: [             LoaderStateTransition.LOADED_NO_TRANSITION,             LoaderStateTransition.LOADED_TO_UNLOADING,             LoaderStateTransition.UNLOADING_NO_TRANSITION,  # \u043a\u043e\u0433\u0434\u0430 \u0441\u043c\u0435\u043d\u0430 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0439 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043d\u0430 \u0433\u0440\u0430\u043d\u0438\u0446\u0435 \u043e\u043a\u043d\u0430         ],         LoaderStateTransition.LOADED_TO_UNLOADING: [             LoaderStateTransition.UNLOADING_NO_TRANSITION,             LoaderStateTransition.UNLOADING_TO_EMPTY,         ],         LoaderStateTransition.UNLOADING_NO_TRANSITION: [             LoaderStateTransition.UNLOADING_NO_TRANSITION,             LoaderStateTransition.UNLOADING_TO_EMPTY,             LoaderStateTransition.EMPTY_NO_TRANSITION,  # \u043a\u043e\u0433\u0434\u0430 \u0441\u043c\u0435\u043d\u0430 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0439 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043d\u0430 \u0433\u0440\u0430\u043d\u0438\u0446\u0435 \u043e\u043a\u043d\u0430         ],         LoaderStateTransition.UNLOADING_TO_EMPTY: [             LoaderStateTransition.EMPTY_NO_TRANSITION,             LoaderStateTransition.EMPTY_TO_LOADING,         ],         LoaderStateTransition.LOADING_TO_EMPTY: [             LoaderStateTransition.EMPTY_NO_TRANSITION,             LoaderStateTransition.EMPTY_TO_LOADING,         ],     }      if as_int:         d = {key.value: [v.value for v in vals] for key, vals in d.items()}      return d<\/code><\/pre>\n<p>\u0418\u0442\u0430\u043a, \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u043f\u0440\u043e\u0433\u043d\u043e\u0437\u043e\u0432. \u041d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0432 \u043a\u0430\u0436\u0434\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u00ab\u043d\u0430\u0438\u043b\u0443\u0447\u0448\u0438\u0439\u00bb \u043f\u0440\u043e\u0433\u043d\u043e\u0437, \u0438 \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0446\u0435\u043f\u043e\u0447\u043a\u0443 \u0442\u0430\u043a\u0438\u0445 \u00ab\u043d\u0430\u0438\u043b\u0443\u0447\u0448\u0438\u0445\u00bb \u043f\u0440\u043e\u0433\u043d\u043e\u0437\u043e\u0432 \u043e\u0442 \u043f\u0435\u0440\u0432\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0434\u043e \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 \u0447\u0435\u0440\u0435\u0437 \u0432\u0441\u0435 \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043e\u0447\u043d\u044b\u0435 \u0441\u0442\u0440\u043e\u043a\u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e. \u041d\u0438\u0447\u0435\u0433\u043e \u0432\u043d\u0443\u0442\u0440\u0438 \u043d\u0435 \u0451\u043a\u0430\u0435\u0442? \u0414\u0430 \u044d\u0442\u043e \u0436 \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430 \u043f\u043e\u0438\u0441\u043a\u0430 \u00ab\u043d\u0430\u0438\u043b\u0443\u0447\u0448\u0435\u0433\u043e\u00bb \u043f\u0443\u0442\u0438 \u0438\u0437 \u0442\u0435\u043e\u0440\u0438\u0438 \u0433\u0440\u0430\u0444\u043e\u0432! \u0413\u0440\u0430\u0444 \u0443 \u043d\u0430\u0441 n-\u0434\u043e\u043b\u044c\u043d\u044b\u0439, \u0442.\u0435. \u043a\u0430\u0436\u0434\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0432\u0435\u0440\u0448\u0438\u043d\u044b \u0433\u0440\u0430\u0444\u0430, \u043f\u0440\u0438\u043d\u0430\u0434\u043b\u0435\u0436\u0430\u0449\u0438\u0435 \u043e\u0434\u043d\u043e\u0439 \u0434\u043e\u043b\u0438, \u0438 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u043e\u0432 \u043c\u0435\u0436\u0434\u0443 \u0432\u0435\u0440\u0448\u0438\u043d\u0430\u043c\u0438 \u043e\u0434\u043d\u043e\u0439 \u0434\u043e\u043b\u0438 \u043d\u0435\u0442. \u0415\u0441\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u044b \u043c\u0435\u0436\u0434\u0443 \u0434\u043e\u043b\u044f\u043c\u0438, \u043f\u0440\u0438\u0447\u0435\u043c \u0440\u0435\u0431\u0440\u0430-\u043f\u0435\u0440\u0435\u0445\u043e\u0434\u044b \u0431\u0443\u0434\u0443\u0442 \u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c\u0438 \u2014 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u0438\u0437 \u043f\u0435\u0440\u0432\u043e\u0439 \u0434\u043e\u043b\u0438-\u0441\u0442\u0440\u043e\u043a\u0438 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0432\u043e \u0432\u0442\u043e\u0440\u0443\u044e, \u043d\u043e \u0438\u0437 \u0432\u0442\u043e\u0440\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438-\u0434\u043e\u043b\u0438 \u043d\u0435 \u043c\u043e\u0436\u0435\u043c \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u043e\u0431\u0440\u0430\u0442\u043d\u043e \u0432\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0432 \u043f\u0435\u0440\u0432\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443. \u041d\u0443 \u0438 \u043a\u0430\u043a \u0431\u044b\u043b\u043e \u0441\u043a\u0430\u0437\u0430\u043d\u043e \u0432\u044b\u0448\u0435, \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u044b \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b \u043d\u0435 \u043c\u0435\u0436\u0434\u0443 \u043b\u044e\u0431\u044b\u043c\u0438 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f\u043c\u0438, \u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441 get_possible_transitions. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0432 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 \u0436\u0430\u0434\u043d\u043e\u0433\u043e \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u043c\u0430\u043a\u0441\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u043d\u0435 \u0432 \u043a\u0430\u0436\u0434\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b, \u0430 \u0434\u043b\u044f \u043f\u0443\u0442\u0438 \u0432 \u0446\u0435\u043b\u043e\u043c, \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u044f \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f.<\/p>\n<p>\u041a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u043f\u043e\u0438\u0441\u043a\u0430 \u00ab\u043d\u0430\u0438\u043b\u0443\u0447\u0448\u0435\u0433\u043e\u00bb \u043f\u0443\u0442\u0438 \u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u2014 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0411\u0435\u043b\u043b\u043c\u0430\u043d\u0430-\u0424\u043e\u0440\u0434\u0430:<\/p>\n<pre><code class=\"python\">from collections import deque   def bellman_ford(adj_list: list[deque], start: int) -> tuple[list[float], list[int]]:     \"\"\"     \u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0411\u0435\u043b\u043b\u043c\u0430\u043d\u0430-\u0424\u043e\u0440\u0434\u0430.     \u0421\u0442\u0440\u043e\u0438\u0442 \"\u043d\u0430\u0438\u043b\u0443\u0447\u0448\u0438\u0439\" \u043f\u0443\u0442\u044c \u043e\u0442 start \u0434\u043e \u0432\u0441\u0435\u0445 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0445 \u0432\u0435\u0440\u0448\u0438\u043d.     \"\"\"     n = len(adj_list)     dist = [float('-inf')] * n     pred = [-1] * n      dist[start] = 0      q = deque([start])     while len(q) > 0:         from_ = q.pop()         for to, d in adj_list[from_]:             if dist[to] &lt; dist[from_] + d:                 dist[to] = dist[from_] + d                 pred[to] = from_                 q.appendleft(to)      return dist, pred<\/code><\/pre>\n<p>\u041e\u043d \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0433\u0440\u0430\u0444\u0430 \u0432 \u0432\u0438\u0434\u0435 \u0441\u043f\u0438\u0441\u043a\u0430 \u0441\u043c\u0435\u0436\u043d\u043e\u0441\u0442\u0438 adj_list, \u0430 \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u044d\u0442\u043e\u0433\u043e \u0441\u043f\u0438\u0441\u043a\u0430 \u0441\u043c\u0435\u0436\u043d\u043e\u0441\u0442\u0438 \u0438\u0437 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u043f\u0440\u043e\u0433\u043d\u043e\u0437\u043e\u0432 \u0438\u043d\u043a\u0430\u043f\u0441\u0443\u043b\u0438\u0440\u0443\u0435\u043c \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 PredictionsTable (\u0436\u0430\u0434\u043d\u044b\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d \u0442\u0430\u043c \u0436\u0435):<\/p>\n<pre><code class=\"python\">import numpy as np  from dataclasses import dataclass, field from collections import deque import operator   @dataclass class PredictionsTable:     init_label: int     target_names: list[str]     table: np.ndarray     transitions: dict[int, list[int]] = field(default_factory=dict)      @property     def shape(self) -> tuple[int, int]:         n_cols = len(self.table[0]) if len(self.table) > 0 else 0         return len(self.table), n_cols      def __str__(self) -> str:         s = 'Columns:\\n'         for i, name in enumerate(self.target_names):             s += f'\\t{i} - {name}\\n'          s += '\\n'         for row in self.table:             s += ' '.join([f'{cp.prob:0.4f}' for cp in row]) + '\\n'          n_rows, n_cols = self.shape         s += f'\\n{n_rows} rows \u00d7 {n_cols} columns'          return s      def get_best_path(self, method: str = 'bf') -> list[int]:         if method == 'bf':  # \u0411\u0435\u043b\u043b\u043c\u0430\u043d-\u0424\u043e\u0440\u0434             return self._get_best_path_bf()         elif method == 'greedy':             return self._get_best_path_greedy()         else:             raise ValueError(\"Unknown method for best path:\", method)      def _get_best_path_bf(self) -> list[int]:         def _get_adj_list() -> list[deque[tuple[int, float]]]:             \"\"\"             \u0424\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442 \u0441\u043f\u0438\u0441\u043e\u043a \u0441\u043c\u0435\u0436\u043d\u043e\u0441\u0442\u0438 \u0432\u0435\u0440\u0448\u0438\u043d \u0433\u0440\u0430\u0444\u0430             \"\"\"              # \u0427\u0438\u0441\u043b\u043e \u0432\u0435\u0440\u0448\u0438\u043d \u043d\u0430\u0448\u0435\u0433\u043e \u0433\u0440\u0430\u0444\u0430 = \u0447\u0438\u0441\u043b\u043e \u0432\u0441\u0435\u0445 \u043f\u0440\u043e\u0433\u043d\u043e\u0437\u043e\u0432 \u0432\u0441\u0435\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 + \u043e\u0434\u043d\u043e \u0434\u043e\u0441\u0442\u043e\u0432\u0435\u0440\u043d\u043e\u0435 \u0441\u0442\u0430\u0440\u0442\u043e\u0432\u043e\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435             n_rows, n_cols = self.shape             n_predictions = 1 + n_cols * n_rows              adj_list = [deque() for _ in range(n_predictions)]              # \u0420\u0435\u0431\u0440\u0430 \u0438\u0437 \u0441\u0442\u0430\u0440\u0442\u043e\u0432\u043e\u0439 \u0432\u0435\u0440\u0448\u0438\u043d\u044b:             for transition in self.transitions[self.init_label]:                 d = self.table[0][transition].prob                 to = 1 + transition                 adj_list[0].append((to, d))              # \u0420\u0435\u0431\u0440\u0430 \u0438\u0437 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0445 \u0432\u0435\u0440\u0448\u0438\u043d:             for i, row in enumerate(self.table[:-1]):                 for j in range(len(row)):                     from_ = 1 + i * n_cols + j                     for transition in self.transitions[j]:                         to = 1 + (i + 1) * n_cols + transition                         d = self.table[i + 1][transition].prob                         adj_list[from_].append((to, d))              return adj_list          def _restore_path(pred: list[int], end: int) -> list[int]:             \"\"\"             \u0412\u043e\u0441\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442 \u043f\u0443\u0442\u044c \u043f\u043e \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0439 \u0432\u0435\u0440\u0448\u0438\u043d\u0435 end \u0438 \u0441\u043f\u0438\u0441\u043a\u0443 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0445 \u0432\u0435\u0440\u0448\u0438\u043d pred             \"\"\"             path = []             n_cols = self.shape[1]             v = end             while v != 0:                 label = (v - 1) % n_cols                 path.append(label)                 v = pred[v]             return path[::-1]          adj_list = _get_adj_list()          dist, pred = bellman_ford(adj_list, start=0)          n_cols = self.shape[1]         end = len(dist[:-n_cols]) + np.array(dist[-n_cols:]).argmax()         best_path = _restore_path(pred, end)          return best_path      def _get_best_path_greedy(self) -> list[int]:         # \u0418\u0437 \u043a\u0430\u0436\u0434\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0431\u0435\u0440\u0435\u043c \u043f\u0440\u043e\u0433\u043d\u043e\u0437 \u0441 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0439 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c\u044e         path = []         for row in self.table:             best_pred = sorted(row, key=operator.attrgetter('prob'), reverse=True)[0]             path.append(best_pred.label)         return path<\/code><\/pre>\n<p>\u0418 \u043a\u043e\u0434 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u044d\u0442\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430:<\/p>\n<pre><code class=\"python\">init_label = y_train[-1]  # \u0434\u043e\u0441\u0442\u043e\u0432\u0435\u0440\u043d\u043e\u0435 \u0441\u0442\u0430\u0440\u0442\u043e\u0432\u043e\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435  transitions = get_possible_transitions()  target_names = [s.name for s in LoaderStateTransition]  predictions_table = PredictionsTable(      init_label=init_label,      table=y_pred,      transitions=transitions,      target_names=target_names  )  best_path_bf = predictions_table.get_best_path(method='bf')<\/code><\/pre>\n<p>\u0412\u043e\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0440\u0430\u0431\u043e\u0442\u044b \u0411\u0435\u043b\u043b\u043c\u0430\u043d\u0430-\u0424\u043e\u0440\u0434\u0430:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/94b\/616\/4f7\/94b6164f7575401fc15e3e080099c349.png\" alt=\"\u0427\u0438\u0441\u043b\u043e \u0440\u0435\u0439\u0441\u043e\u0432: 13 \u0427\u0438\u0441\u043b\u043e \u043d\u0435\u0443\u0434\u0430\u0447\u043d\u044b\u0445 \u043f\u043e\u0433\u0440\u0443\u0437\u043e\u043a: 2\" title=\"\u0427\u0438\u0441\u043b\u043e \u0440\u0435\u0439\u0441\u043e\u0432: 13 \u0427\u0438\u0441\u043b\u043e \u043d\u0435\u0443\u0434\u0430\u0447\u043d\u044b\u0445 \u043f\u043e\u0433\u0440\u0443\u0437\u043e\u043a: 2\" width=\"851\" height=\"177\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/94b\/616\/4f7\/94b6164f7575401fc15e3e080099c349.png\"\/><\/p>\n<div><figcaption>\u0427\u0438\u0441\u043b\u043e \u0440\u0435\u0439\u0441\u043e\u0432: 13<br \/> \u0427\u0438\u0441\u043b\u043e \u043d\u0435\u0443\u0434\u0430\u0447\u043d\u044b\u0445 \u043f\u043e\u0433\u0440\u0443\u0437\u043e\u043a: 2<\/figcaption><\/div>\n<\/figure>\n<p>\u0418 \u0447\u0438\u0441\u043b\u043e \u0440\u0435\u0439\u0441\u043e\u0432, \u0438 \u0447\u0438\u0441\u043b\u043e \u043d\u0435\u0443\u0434\u0430\u0447\u043d\u044b\u0445 \u043f\u043e\u0433\u0440\u0443\u0437\u043e\u043a \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u0435\u0442 \u0441 ground truth.<\/p>\n<p>\u0412\u043e\u0442 \u0442\u0430\u043a \u043a\u043e\u043c\u0431\u0438\u043d\u0430\u0446\u0438\u044f \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u0438 \u0442\u0435\u043e\u0440\u0438\u0438 \u0433\u0440\u0430\u0444\u043e\u0432 \u043f\u043e\u043c\u043e\u0433\u043b\u0430 \u0440\u0435\u0448\u0438\u0442\u044c \u044d\u0442\u0443 \u0437\u0430\u0434\u0430\u0447\u0443.<\/p>\n<p>\u0412 \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0438\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u043c\u044b \u0443\u0436\u0435 \u043f\u0440\u043e\u0432\u043e\u0434\u0438\u043c \u0442\u0435\u0441\u0442\u044b \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 \u0432 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u0445 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0430 \u0431\u043e\u0440\u0442\u0443 \u043f\u043e\u0433\u0440\u0443\u0437\u0447\u0438\u043a\u0430, \u0438 \u0432 \u0441\u043a\u043e\u0440\u043e\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043d\u0430\u043a\u043e\u043f\u0438\u043c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a\u0438, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u0442\u044c \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e \u0434\u0435\u0442\u0435\u043a\u0446\u0438\u0438 \u0440\u0430\u0431\u043e\u0447\u0438\u0445 \u0446\u0438\u043a\u043b\u043e\u0432, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0440\u0430\u0437\u0431\u0435\u0440\u0451\u043c, \u0432 \u043a\u0430\u043a\u0438\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 \u0434\u0430\u0436\u0435 \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u0443 \u0441\u043b\u043e\u0436\u043d\u043e \u043f\u043e\u043d\u044f\u0442\u044c, \u0441\u0442\u043e\u0438\u0442 \u0437\u0430\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c \u0437\u0434\u0435\u0441\u044c \u0440\u0435\u0439\u0441 \u0438\u043b\u0438 \u043d\u0435\u0442.<\/p>\n<p>\u041d\u0435 \u043e\u0442\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u0441\u044c, \u043f\u043e\u0434\u043f\u0438\u0441\u044b\u0432\u0430\u0439\u0442\u0435\u0441\u044c, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u043f\u0440\u043e\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b \u043f\u043e \u0442\u0435\u043c\u0435, \u0435\u0441\u043b\u0438 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e. \u0418 \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u0431\u0443\u0434\u0435\u043c \u0440\u0430\u0434\u044b \u043e\u0442\u0432\u0435\u0442\u0438\u0442\u044c \u043d\u0430 \u0432\u0430\u0448\u0438 \u0432\u043e\u043f\u0440\u043e\u0441\u044b \u0438 \u0443\u0441\u043b\u044b\u0448\u0430\u0442\u044c \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438 \u0437\u0430\u043c\u0435\u0447\u0430\u043d\u0438\u044f.<\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/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\/articles\/780930\/\"> https:\/\/habr.com\/ru\/articles\/780930\/<\/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<figure class=\"full-width\">\n<div><figcaption>\u0418\u043b\u043b\u044e\u0441\u0442\u0440\u0430\u0446\u0438\u044f: <a class=\"mention\" href=\"\/users\/golts\">@GOLTS<\/a><\/figcaption><\/div>\n<\/figure>\n<p>\u041f\u0440\u0438\u0432\u0435\u0442, \u0425\u0430\u0431\u0440! <\/p>\n<p>\u041c\u0435\u043d\u044f \u0437\u043e\u0432\u0443\u0442 \u0418\u043b\u044c\u044f \u0420\u043e\u0434\u0438\u043d, \u044f \u0438\u043d\u0436\u0435\u043d\u0435\u0440 \u043f\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u00ab\u0420\u0435\u043a\u0441\u043e\u0444\u0442\u00bb. \u0421\u0435\u0439\u0447\u0430\u0441 \u044f \u0440\u0430\u0431\u043e\u0442\u0430\u044e \u0432 \u043a\u043e\u043c\u0430\u043d\u0434\u0435 \u0434\u0435\u043f\u0430\u0440\u0442\u0430\u043c\u0435\u043d\u0442\u0430 \u0433\u043e\u0440\u043d\u043e\u0434\u043e\u0431\u044b\u0432\u0430\u044e\u0449\u0438\u0445 \u0440\u0435\u0448\u0435\u043d\u0438\u0439 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0438\u0448\u0443 \u043e \u043d\u0430\u0441\u0443\u0449\u043d\u043e\u043c: \u043a\u0430\u043a \u0443\u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c \u0440\u0430\u0431\u043e\u0442\u044b \u0446\u0438\u043a\u043b\u043e\u0432 \u043f\u043e\u0433\u0440\u0443\u0437\u0447\u0438\u043a\u0430, \u0437\u0430\u0431\u0438\u0440\u0430\u044f \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u0448\u0442\u0430\u0442\u043d\u043e\u0439 \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0434\u0432\u0438\u0433\u0430\u0442\u0435\u043b\u044f. \u042d\u0442\u0443 \u0441\u0442\u0430\u0442\u044c\u044e \u044f \u043f\u0438\u0441\u0430\u043b \u0432\u043c\u0435\u0441\u0442\u0435 \u0441\u043e \u0441\u0432\u043e\u0438\u043c \u043a\u043e\u043b\u043b\u0435\u0433\u043e\u0439 <a class=\"mention\" href=\"\/users\/vlebedev_22\">@VLebedev_22<\/a>. <\/p>\n<p>\u0418\u0442\u0430\u043a, \u043f\u043e\u0435\u0445\u0430\u043b\u0438!<\/p>\n<h3>\u041f\u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0437\u0430\u0434\u0430\u0447\u0438<\/h3>\n<p>\u041d\u0430 \u0433\u043e\u0440\u043d\u043e\u0434\u043e\u0431\u044b\u0432\u0430\u044e\u0449\u0438\u0445 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0441\u0442\u0432\u0430\u0445, \u0432 \u0441\u0442\u0440\u043e\u0438\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u0435 \u0438 \u0432 \u0434\u0440\u0443\u0433\u0438\u0445 \u0441\u0444\u0435\u0440\u0430\u0445 \u043f\u0440\u043e\u043c\u044b\u0448\u043b\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0448\u0438\u0440\u043e\u043a\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0442\u0435\u0445\u043d\u0438\u043a\u0430 \u0434\u043b\u044f \u043f\u043e\u0433\u0440\u0443\u0437\u043a\u0438 \u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u0438\u044f \u0433\u043e\u0440\u043d\u043e\u0439 \u043c\u0430\u0441\u0441\u044b \u0438\u043b\u0438 \u0441\u044b\u043f\u0443\u0447\u0438\u0445 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u043e\u0432, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0444\u0440\u043e\u043d\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u043e\u0433\u0440\u0443\u0437\u0447\u0438\u043a\u0438 \u0438 \u044d\u043a\u0441\u043a\u0430\u0432\u0430\u0442\u043e\u0440\u044b. \u041e\u0434\u043d\u0430 \u0438\u0437 \u0432\u0430\u0436\u043d\u044b\u0445 \u0437\u0430\u0434\u0430\u0447 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0442\u0430\u043a\u0438\u043c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0441\u0442\u0432\u043e\u043c \u2013 \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u0442\u044c \u0432\u0440\u0435\u043c\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u043c\u0430\u0448\u0438\u043d\u044b, \u0434\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u043e\u0435\u0432, \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c, \u0436\u0435\u043b\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0441 \u043f\u0440\u0438\u0432\u044f\u0437\u043a\u043e\u0439 \u043a \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u043c\u0443 \u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044e\/\u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0443. \u042d\u0442\u043e \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0442\u044c \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u0438.<\/p>\n<p>\u041f\u0440\u0438 \u0442\u0440\u0430\u0434\u0438\u0446\u0438\u043e\u043d\u043d\u043e\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u0435 \u043a \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044f, \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0434\u0430\u0442\u0447\u0438\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u043b\u0438 \u0431\u044b \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0440\u0430\u0431\u043e\u0447\u0438\u0445 \u043e\u0440\u0433\u0430\u043d\u043e\u0432 \u043c\u0430\u0448\u0438\u043d\u044b, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0438\u0437\u043c\u0435\u0440\u044f\u043b\u0438 \u0434\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0432 \u0433\u0438\u0434\u0440\u0430\u0432\u043b\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043a\u043e\u043d\u0442\u0443\u0440\u0430\u0445 \u0438\u043b\u0438 \u0441\u0438\u043b\u0443 \u0442\u043e\u043a\u0430 \u043d\u0430 \u044d\u043b\u0435\u043a\u0442\u0440\u043e\u043f\u0440\u0438\u0432\u043e\u0434\u0430\u0445 (\u0435\u0441\u043b\u0438 \u044d\u0442\u043e \u043a\u0430\u043d\u0430\u0442\u043d\u044b\u0439 \u044d\u043a\u0441\u043a\u0430\u0432\u0430\u0442\u043e\u0440). \u041d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u044d\u0442\u0438\u0445 \u0441\u0438\u0433\u043d\u0430\u043b\u043e\u0432 \u0432\u044b\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438 \u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0440\u0430\u0431\u043e\u0447\u0438\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438, \u0438 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u0435\u0442 \u043e\u0442\u0434\u0435\u043b\u0438\u0442\u044c \u00ab\u0445\u043e\u043b\u043e\u0441\u0442\u044b\u0435\u00bb \u0446\u0438\u043a\u043b\u044b \u043e\u0442 \u0446\u0438\u043a\u043b\u043e\u0432 \u0441 \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0439 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u043e\u0439 (\u0432 \u043d\u0430\u0448\u0435\u043c \u043e\u043f\u044b\u0442\u0435 \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u043b\u0438\u0441\u044c \u043f\u0440\u0435\u0434\u043f\u0440\u0438\u0438\u043c\u0447\u0438\u0432\u044b\u0435 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0440\u0430\u0437\u0433\u0430\u0434\u044b\u0432\u0430\u043b\u0438 \u043b\u043e\u0433\u0438\u043a\u0443 \u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u0432 \u0438 \u043c\u043e\u0433\u043b\u0438 \u043f\u043e-\u0431\u044b\u0441\u0442\u0440\u043e\u043c\u0443 \u0437\u0430\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441\u0435\u0431\u0435 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u043e\u0447\u043a\u043e\u0432 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438, \u0441\u043e\u0432\u0435\u0440\u0448\u0430\u044f \u043c\u0430\u043d\u0438\u043f\u0443\u043b\u044f\u0446\u0438\u0438 \u043f\u0443\u0441\u0442\u044b\u043c \u043a\u043e\u0432\u0448\u043e\u043c).<br \/> \u041d\u0430\u0434\u043e \u043b\u0438 \u0433\u043e\u0432\u043e\u0440\u0438\u0442\u044c, \u0447\u0442\u043e \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0434\u0430\u0442\u0447\u0438\u043a\u043e\u0432 \u0438 \u043f\u0440\u043e\u0432\u043e\u0434\u043e\u0432 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u043b\u0430\u0431\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u043e\u0439 \u0442\u0430\u043a\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b? \u0420\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0451\u043d\u043d\u044b\u0439 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0439: \u043f\u0440\u0435\u0434\u043f\u0440\u0438\u044f\u0442\u0438\u0435 \u0432\u043d\u0435\u0434\u0440\u044f\u0435\u0442 \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0434\u0438\u0441\u043f\u0435\u0442\u0447\u0435\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u0430\u0440\u043a\u043e\u043c \u0442\u0435\u0445\u043d\u0438\u043a\u0438, \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0432\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u044d\u043a\u0441\u043f\u043b\u0443\u0430\u0442\u0430\u0446\u0438\u044e, \u0430 \u0447\u0435\u0440\u0435\u0437 \u0433\u043e\u0434 \u0443\u0436\u0435 30% \u0434\u0430\u0442\u0447\u0438\u043a\u043e\u0432 \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u043e\u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u044c \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0442\u0440\u0443\u0434\u043e\u0451\u043c\u043a\u043e, \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c \u0441\u043d\u0438\u0436\u0430\u0435\u0442\u0441\u044f.<\/p>\n<figure class=\"full-width\"><\/figure>\n<p><a href=\"https:\/\/habr.com\/ru\/articles\/748958\/\">\u0412 \u0434\u0440\u0443\u0433\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435<\/a> \u043a\u0430\u043a \u0440\u0430\u0437 <a href=\"https:\/\/habr.com\/ru\/users\/VLebedev_22\/\">@VLebedev_22<\/a> \u0443\u0436\u0435 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u043b \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0440\u0435\u0448\u0430\u0442\u044c \u044d\u0442\u0443 \u0437\u0430\u0434\u0430\u0447\u0443 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0433\u043e \u0437\u0440\u0435\u043d\u0438\u044f. \u00a0\u041d\u043e \u043d\u0430\u0448\u0430 \u043c\u044b\u0441\u043b\u044c \u043d\u0435 \u0441\u0442\u043e\u0438\u0442 \u043d\u0430 \u043c\u0435\u0441\u0442\u0435. \u041c\u044b \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u043b\u0438, \u0447\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u043e\u0431\u043e\u0439\u0442\u0438\u0441\u044c \u0435\u0449\u0451 \u043c\u0435\u043d\u044c\u0448\u0438\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u043e\u0431\u043e\u0440\u0443\u0434\u043e\u0432\u0430\u043d\u0438\u044f, \u0437\u0430\u0431\u0438\u0440\u0430\u044f \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u0448\u0442\u0430\u0442\u043d\u043e\u0439 \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0434\u0432\u0438\u0433\u0430\u0442\u0435\u043b\u044f. \u041e\u0431 \u044d\u0442\u043e\u043c \u0438 \u043f\u043e\u0432\u0435\u0434\u0435\u043c \u0440\u0430\u0441\u0441\u043a\u0430\u0437. <\/p>\n<p>\u0421\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043c\u0430\u0448\u0438\u043d\u044b \u043e\u0431\u043b\u0430\u0434\u0430\u044e\u0442 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0431\u043e\u0433\u0430\u0442\u044b\u043c \u043d\u0430\u0431\u043e\u0440\u043e\u043c \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0442\u0435\u043b\u0435\u043c\u0435\u0442\u0440\u0438\u0438 \u0434\u0432\u0438\u0433\u0430\u0442\u0435\u043b\u044f, \u0438 \u043e\u0442 \u043e\u0434\u043d\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u044b \u043a \u0434\u0440\u0443\u0433\u043e\u0439 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b CAN \u0438 \u043d\u0430\u0431\u043e\u0440 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0432 \u0446\u0435\u043b\u043e\u043c \u043d\u0435 \u043c\u0435\u043d\u044f\u044e\u0442\u0441\u044f (\u0432\u0435\u0437\u0434\u0435 \u0435\u0441\u0442\u044c \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435 \u00ab\u043e\u0431\u043e\u0440\u043e\u0442\u044b\u00bb, \u00ab\u043a\u0440\u0443\u0442\u044f\u0449\u0438\u0439 \u043c\u043e\u043c\u0435\u043d\u0442\u00bb \u0438 \u0442.\u043f.). \u0417\u043d\u0430\u0447\u0438\u0442, \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0438\u0441\u043a\u0430\u0442\u044c \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u044b \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0434\u0432\u0438\u0433\u0430\u0442\u0435\u043b\u044f \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b. \u041a\u0430\u0436\u0435\u0442\u0441\u044f, \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430 \u043d\u0430 \u0445\u043e\u043b\u043e\u0441\u0442\u043e\u043c \u0445\u043e\u0434\u0443 \u0431\u0443\u0434\u0435\u0442 \u044f\u0432\u043d\u043e \u043e\u0442\u043b\u0438\u0447\u0430\u0442\u044c\u0441\u044f \u043e\u0442 \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u043e\u0434 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u043e\u0439. \u0410 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f \u043b\u0438 \u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0440\u0430\u0431\u043e\u0447\u0438\u0435 \u0446\u0438\u043a\u043b\u044b (\u0440\u0435\u0439\u0441\u044b)? \u041e\u0442\u0434\u0435\u043b\u044f\u0442\u044c \u043f\u043e\u0433\u0440\u0443\u0437\u043a\u0443 \u043e\u0442 \u0440\u0430\u0437\u0433\u0440\u0443\u0437\u043a\u0438?<\/p>\n<p><strong>\u041a\u043e\u043d\u043a\u0440\u0435\u0442\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u0437\u0430\u0434\u0430\u0447\u0443.<\/strong> \u0412 \u0442\u0435\u0447\u0435\u043d\u0438\u0435 \u0440\u0430\u0431\u043e\u0447\u0435\u0439 \u0441\u043c\u0435\u043d\u044b \u0444\u0440\u043e\u043d\u0442\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u043e\u0433\u0440\u0443\u0437\u0447\u0438\u043a \u0441\u043e\u0432\u0435\u0440\u0448\u0430\u0435\u0442 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0440\u0430\u0431\u043e\u0447\u0438\u0445 \u0440\u0435\u0439\u0441\u043e\u0432. \u0420\u0435\u0439\u0441 \u2013 \u044d\u0442\u043e \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439: \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0433\u043e\u0440\u043d\u043e\u0439 \u043f\u043e\u0440\u043e\u0434\u044b \u0432 \u043a\u043e\u0432\u0448, \u0435\u0435 \u0442\u0440\u0430\u043d\u0441\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0430 \u0438 \u0432\u044b\u0433\u0440\u0443\u0437\u043a\u0430. <\/p>\n<blockquote>\n<p><em>\u0417\u0430\u0434\u0430\u0447\u0430 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u043f\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c \u0440\u044f\u0434\u0430\u043c \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0435\u0439 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0448\u0442\u0430\u0442\u043d\u044b\u0445 \u0434\u0430\u0442\u0447\u0438\u043a\u043e\u0432, \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u043e\u0434\u0441\u0447\u0438\u0442\u0430\u0442\u044c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u044b\u0445 \u0440\u0435\u0439\u0441\u043e\u0432. \u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u043f\u043e\u0436\u0435\u043b\u0430\u043d\u0438\u0435: \u043f\u043e\u0441\u0442\u0430\u0440\u0430\u0435\u043c\u0441\u044f \u043e\u0431\u043e\u0439\u0442\u0438\u0441\u044c \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u043c\u0435\u043d\u044c\u0448\u0438\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u0434\u0430\u0442\u0447\u0438\u043a\u043e\u0432, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u043e\u0441\u0442\u044b\u0435 \u0438 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435 \u0438\u0437 \u043d\u0438\u0445, \u0447\u0442\u043e\u0431\u044b \u0443\u043d\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0434\u043b\u044f \u0434\u0440\u0443\u0433\u0438\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0444\u0440\u043e\u043d\u0442\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u043e\u0433\u0440\u0443\u0437\u0447\u0438\u043a\u043e\u0432.<\/em><\/p>\n<p><em>\u0415\u0449\u0435 \u043e\u0434\u043d\u043e \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u0435 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043f\u043e\u0434\u0441\u0447\u0435\u0442 \u0440\u0435\u0439\u0441\u043e\u0432 \u0434\u043e\u043b\u0436\u0435\u043d \u0432\u0435\u0441\u0442\u0438\u0441\u044c \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438.<\/em><\/p>\n<\/blockquote>\n<h3>\u0414\u0430\u043d\u043d\u044b\u0435<\/h3>\n<p>\u0423 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u043b\u043e\u0433\u0438 \u0441 CAN-\u0448\u0438\u043d\u044b, \u0432\u043a\u043b\u044e\u0447\u0430\u044e\u0449\u0438\u0435 \u0432 \u0441\u0435\u0431\u044f \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0438:<\/p>\n<pre><code class=\"python\">sensors = [      '\u0422\u0435\u043a\u0443\u0449\u0438\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0434\u0432\u0438\u0433\u0430\u0442\u0435\u043b\u044f',      '\u041e\u0431\u043e\u0440\u043e\u0442\u044b \u0434\u0432\u0438\u0433\u0430\u0442\u0435\u043b\u044f',      '\u041f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043f\u0435\u0434\u0430\u043b\u0438 \u0433\u0430\u0437\u0430',      '\u041c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0430 \u0434\u0432\u0438\u0433\u0430\u0442\u0435\u043b\u0435',      '\u041d\u043e\u043c\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0435 \u0442\u0440\u0435\u043d\u0438\u0435 \u2014 \u043a\u0440\u0443\u0442\u044f\u0449\u0438\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0432 \u043f\u0440\u043e\u0446\u0435\u043d\u0442\u0430\u0445',      '\u041d\u0430\u043f\u0440\u044f\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 \u0432\u044b\u043a\u043b\u044e\u0447\u0430\u0442\u0435\u043b\u0435 \u0410\u041a\u0411',      '\u0422\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u0430 \u043e\u0445\u043b\u0430\u0436\u0434\u0430\u044e\u0449\u0435\u0439 \u0436\u0438\u0434\u043a\u043e\u0441\u0442\u0438',      '\u0414\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043d\u0430 \u0432\u0445\u043e\u0434\u0435 \u0432 \u043a\u043e\u043b\u043b\u0435\u043a\u0442\u043e\u0440 \u0434\u0432\u0438\u0433\u0430\u0442\u0435\u043b\u044f 1',      '\u0414\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043c\u043e\u0442\u043e\u0440\u043d\u043e\u0433\u043e \u043c\u0430\u0441\u043b\u0430',      '\u0422\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u0430 \u0432\u044b\u0445\u043b\u043e\u043f\u043d\u044b\u0445 \u0433\u0430\u0437\u043e\u0432 \u0434\u0432\u0438\u0433\u0430\u0442\u0435\u043b\u044f \u2014 \u043f\u0440\u0430\u0432\u044b\u0439 \u043a\u043e\u043b\u043b\u0435\u043a\u0442\u043e\u0440'  ]<\/code><\/pre>\n<p>\u0422\u0430\u043a\u0436\u0435 \u0435\u0441\u0442\u044c \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0430 \u044d\u0442\u0438\u0445 \u043b\u043e\u0433\u043e\u0432: \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0442\u043e\u0447\u043a\u0438 \u043c\u044b \u0437\u043d\u0430\u0435\u043c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0435 \u0435\u0439 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043f\u043e\u0433\u0440\u0443\u0437\u0447\u0438\u043a\u0430. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0439 \u0443 \u043d\u0430\u0441 4: \u043f\u0443\u0441\u0442\u043e\u0439, \u043f\u043e\u0433\u0440\u0443\u0437\u043a\u0430, \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u044b\u0439, \u0440\u0430\u0437\u0433\u0440\u0443\u0437\u043a\u0430:<\/p>\n<pre><code class=\"python\">from enum import Enum  class LoaderState(Enum):      EMPTY = 0      LOADING = 2      LOADED = 1      UNLOADING = 3<\/code><\/pre>\n<p>\u0412\u043e\u0442 \u0433\u0440\u0430\u0444\u0438\u043a \u0441 \u0443\u0447\u0430\u0441\u0442\u043a\u043e\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0433\u043e \u0440\u044f\u0434\u0430 \u043e\u0434\u043d\u043e\u0433\u043e \u0438\u0437 \u043d\u0430\u0448\u0438\u0445 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0435\u0439 (\u043e\u0431\u043e\u0440\u043e\u0442\u044b \u0434\u0432\u0438\u0433\u0430\u0442\u0435\u043b\u044f) \u0441 \u043d\u0430\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u043c\u0438 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f\u043c\u0438 \u043f\u043e\u0433\u0440\u0443\u0437\u0447\u0438\u043a\u0430:<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u0421\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u043d\u0430 \u044d\u0442\u043e\u043c \u0433\u0440\u0430\u0444\u0438\u043a\u0435 \u043e\u043a\u0440\u0430\u0448\u0435\u043d\u044b \u0437\u0435\u043b\u0435\u043d\u044b\u043c, \u0444\u0438\u043e\u043b\u0435\u0442\u043e\u0432\u044b\u043c, \u0441\u0435\u0440\u044b\u043c \u0438 \u0436\u0435\u043b\u0442\u044b\u043c \u0446\u0432\u0435\u0442\u0430\u043c\u0438 (\u0441\u043c. \u043b\u0435\u0433\u0435\u043d\u0434\u0443). \u0412\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u0433\u0440\u0430\u0444\u0438\u043a \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f (\u043e\u0431\u043e\u0440\u043e\u0442\u043e\u0432 \u0434\u0432\u0438\u0433\u0430\u0442\u0435\u043b\u044f \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435) \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u0441 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0439 \u043f\u043e\u0433\u0440\u0443\u0437\u0447\u0438\u043a\u0430, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0445\u043e\u0440\u043e\u0448\u043e \u044d\u0442\u043e \u0437\u0430\u043c\u0435\u0442\u043d\u043e \u043f\u043e \u00ab\u0432\u0441\u043f\u043b\u0435\u0441\u043a\u0430\u043c\u00bb \u043f\u0440\u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0435 (\u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 LOADING \u0444\u0438\u043e\u043b\u0435\u0442\u043e\u0432\u043e\u0433\u043e \u0446\u0432\u0435\u0442\u0430). \u0410 \u0432\u043e\u0442, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u0440\u0438 \u0440\u0430\u0437\u0433\u0440\u0443\u0437\u043a\u0435 (UNLOADING \u0436\u0435\u043b\u0442\u043e\u0433\u043e \u0446\u0432\u0435\u0442\u0430) \u0432\u0441\u043f\u043b\u0435\u0441\u043a\u0438 \u043d\u0435 \u0442\u0430\u043a \u0437\u0430\u043c\u0435\u0442\u043d\u044b (\u0441\u043f\u043e\u0439\u043b\u0435\u0440: \u0438 \u0432 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c \u043d\u0430\u043c \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0445\u0438\u0442\u0440\u043e \u0438\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u044c\u0441\u044f, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c \u044d\u0442\u043e \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435).<\/p>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043c\u044b \u0438\u043c\u0435\u0435\u043c \u0437\u0430\u0434\u0430\u0447\u0443 supervised learning \u0441\u043e \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u043e\u0439 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0440\u044f\u0434\u043e\u0432: \u0434\u043b\u044f \u043d\u043e\u0432\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u2013 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0440\u044f\u0434\u043e\u0432 \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u044b\u0445 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0435\u0439 \u0441 \u0434\u0430\u0442\u0447\u0438\u043a\u043e\u0432 \u043d\u0430 \u043f\u043e\u0433\u0440\u0443\u0437\u0447\u0438\u043a\u0435 \u2013 \u043d\u0430\u043c \u043d\u0430\u0434\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u043a\u0430\u0436\u0434\u043e\u0439 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0442\u043e\u0447\u043a\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u043f\u043e\u0433\u0440\u0443\u0437\u0447\u0438\u043a\u0430, \u0447\u0442\u043e\u0431\u044b \u0437\u0430\u0442\u0435\u043c \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u0430\u0442\u044c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u044b\u0445 \u044d\u0442\u0438\u043c \u043f\u043e\u0433\u0440\u0443\u0437\u0447\u0438\u043a\u043e\u043c \u0440\u0435\u0439\u0441\u043e\u0432.<\/p>\n<p>\u0414\u0440\u0443\u0433\u0438\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438, \u044d\u0442\u043e \u0437\u0430\u0434\u0430\u0447\u0430 \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0440\u044f\u0434\u043e\u0432.<\/p>\n<h3>Feature engineering<\/h3>\n<p>\u0424\u0438\u0447\u0438 \u0438\u0437 \u043d\u0430\u0448\u0438\u0445 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0440\u044f\u0434\u043e\u0432 \u0431\u0443\u0434\u0435\u043c \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 tsfresh:<\/p>\n<pre><code class=\"python\">import tsfresh  from tsfresh import extract_features as extract_tsfresh_features, select_features  from tsfresh.utilities.dataframe_functions import impute  from tsfresh.feature_extraction import settings as tsfresh_settings  settings = tsfresh_settings.MinimalFCParameters()  settings.update(      tsfresh_settings.TimeBasedFCParameters()  )  settings.update(      tsfresh_settings.EfficientFCParameters()  )  def extract_features(df: pd.DataFrame) -> pd.DataFrame:      # \u0424\u0438\u043a\u0442\u0438\u0432\u043d\u0430\u044f \u043a\u043e\u043b\u043e\u043d\u043a\u0430 \u0434\u043b\u044f \u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u043a\u0438     copy_df = df.copy()     group_col = \"tsfresh\"     copy_df.loc[:, group_col] = 0          return extract_tsfresh_features(          copy_df,          column_id=group_col,          impute_function=impute,          default_fc_parameters=settings      )<\/code><\/pre>\n<p>\u0422\u0430\u043a\u0436\u0435 tsfresh \u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438 \u0443\u043c\u0435\u0435\u0442 \u043e\u0442\u043e\u0431\u0440\u0430\u0442\u044c \u0444\u0438\u0447\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u0435\u0442\u043e\u0434\u0430 relevant_features. \u0423\u0434\u043e\u0431\u043d\u043e \u043e\u0431\u0435\u0440\u043d\u0443\u0442\u044c \u043e\u0442\u0431\u043e\u0440 \u0444\u0438\u0447 \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441, \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u044b\u0439 \u0441 sklearn Pipeline:<\/p>\n<pre><code class=\"python\">from sklearn.base import BaseEstimator, TransformerMixin   class FeatureSelector(BaseEstimator, TransformerMixin):     def fit(self, X, y=None, **kwargs):         relevant_features = set()          for label in np.unique(y):             # select_features \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 \u0431\u0438\u043d\u0430\u0440\u043d\u043e\u0439 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0435\u0439, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0438\u043c \u0437\u0430\u0434\u0430\u0447\u0443             # \u0432 \u0431\u0438\u043d\u0430\u0440\u043d\u0443\u044e \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 \u0438 \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u0435\u043c \u043f\u043e \u0432\u0441\u0435\u043c \u043a\u043b\u0430\u0441\u0441\u0430\u043c             y_binary = y == label             X_filtered = tsfresh.select_features(X, y_binary)             relevant_features = relevant_features.union(set(X_filtered.columns))          self.relevant_features_ = relevant_features          return self      def transform(self, X, y=None):         return X[list(self.relevant_features_)]<\/code><\/pre>\n<h3>\u041e\u0431\u0449\u0435\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u0430 \u043a \u0440\u0435\u0448\u0435\u043d\u0438\u044e<\/h3>\n<p>\u041d\u0430\u0448\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u0442\u0430\u043a: \u0434\u0432\u0438\u0433\u0430\u0435\u043c\u0441\u044f \u043f\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u043c\u0443 \u0440\u044f\u0434\u0443 \u0441\u043a\u043e\u043b\u044c\u0437\u044f\u0449\u0438\u043c \u043e\u043a\u043d\u043e\u043c \u0440\u0430\u0437\u043c\u0435\u0440\u0430 window_size = 5 \u0441\u0435\u043a\u0443\u043d\u0434 \u0441 \u0448\u0430\u0433\u043e\u043c \u0442\u043e\u0436\u0435 window_size (\u0442.\u0435. \u043e\u043a\u043d\u0430 \u043d\u0435 \u043f\u0435\u0440\u0435\u0441\u0435\u043a\u0430\u044e\u0442\u0441\u044f). \u0418 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043e\u043a\u043d\u0430 \u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u0435\u0441\u0442\u044c \u043b\u0438 \u0432\u043d\u0443\u0442\u0440\u0438 \u043d\u0435\u0433\u043e \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0439 \u043f\u043e\u0433\u0440\u0443\u0437\u0447\u0438\u043a\u0430. \u0414\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 \u043c\u044b \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043c\u0435\u043d\u044f\u0435\u043c \u043d\u0430\u0448 \u0442\u0430\u0440\u0433\u0435\u0442: \u0431\u0443\u0434\u0435\u043c \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043d\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435(-\u044f) \u0432\u043d\u0443\u0442\u0440\u0438 \u043e\u043a\u043d\u0430, \u0430 \u0438\u0445 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f. <\/p>\n<p>\u0412\u0432\u0435\u0434\u0435\u043c \u043d\u043e\u0432\u044b\u0439 Enum:<\/p>\n<pre><code class=\"python\">class LoaderStateTransition(Enum):      EMPTY_NO_TRANSITION = 0      EMPTY_TO_LOADING = 1      LOADING_NO_TRANSITION = 2      LOADING_TO_LOADED = 3      LOADED_NO_TRANSITION = 4      LOADED_TO_UNLOADING = 5      UNLOADING_NO_TRANSITION = 6      UNLOADING_TO_EMPTY = 7      LOADING_TO_EMPTY = 8 # \u043d\u0435\u0443\u0434\u0430\u0447\u043d\u0430\u044f \u043f\u043e\u0433\u0440\u0443\u0437\u043a\u0430<\/code><\/pre>\n<p>\u0418\u043c\u0435\u043d\u0430 \u0442\u0443\u0442 self-explanatory, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, EMPTY_NO_TRANSITION \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u0432\u043d\u0443\u0442\u0440\u0438 \u043e\u043a\u043d\u0430 \u0435\u0441\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u043d\u043e \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u2013 EMPTY, \u0430 EMPTY_TO_LOADING \u2013 \u0447\u0442\u043e \u0432\u043d\u0443\u0442\u0440\u0438 \u043e\u043a\u043d\u0430 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 EMPTY \u0432 \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u043c\u043e\u043c\u0435\u043d\u0442 \u0441\u043c\u0435\u043d\u0438\u043b\u043e\u0441\u044c \u043d\u0430 LOADING. \u041a\u043e\u0434 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0430 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0445 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0439 LoaderState \u0432 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u044b \u043c\u0435\u0436\u0434\u0443 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f\u043c\u0438  LoaderStateTransition \u043e\u043f\u0443\u0441\u0442\u0438\u043c, \u043e\u043d \u0442\u0440\u0438\u0432\u0438\u0430\u043b\u0435\u043d.<\/p>\n<p>\u0421\u0430\u043c\u0430\u044f \u0433\u043b\u0430\u0432\u043d\u0430\u044f \u0438\u0434\u0435\u044f: <strong>\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f<\/strong>. \u041a\u0430\u0436\u0434\u0430\u044f \u0438\u0437 \u044d\u0442\u0438\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0442\u0440\u0435\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0430 \u043d\u0430 <strong>\u0441\u043c\u0435\u043d\u0443 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0439<\/strong> \u043f\u043e\u0433\u0440\u0443\u0437\u0447\u0438\u043a\u0430 \u0432 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u043c \u043c\u0435\u0441\u0442\u0435 \u043e\u043a\u043d\u0430. \u041d\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u044e, \u0447\u0442\u043e \u043c\u044b \u0434\u0432\u0438\u0433\u0430\u0435\u043c\u0441\u044f \u043f\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u043c\u0443 \u0440\u044f\u0434\u043e\u043c \u0441\u043a\u043e\u043b\u044c\u0437\u044f\u0449\u0438\u043c \u043e\u043a\u043d\u043e\u043c \u0440\u0430\u0437\u043c\u0435\u0440\u0430 window_size = 5 \u0441\u0435\u043a\u0443\u043d\u0434.<\/p>\n<p>\u0422\u0440\u0435\u043d\u0438\u0440\u0443\u0435\u043c n_models = windows_size &#8212; 2 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c: \u0435\u0441\u043b\u0438 \u0442\u0435\u043a\u0443\u0449\u0435\u0435 \u043e\u043a\u043d\u043e \u043d\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u043f\u043e\u0433\u0440\u0443\u0437\u0447\u0438\u043a\u0430, \u0441\u043a\u0430\u0440\u043c\u043b\u0438\u0432\u0430\u0435\u043c \u0435\u0433\u043e \u0434\u043b\u044f \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u0432\u0441\u0435\u043c \u043c\u043e\u0434\u0435\u043b\u044f\u043c, \u0438\u043d\u0430\u0447\u0435 \u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u0432 \u043a\u0430\u043a\u043e\u0439 \u0442\u043e\u0447\u043a\u0435 i \u043e\u043a\u043d\u0430 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f, \u0438 \u0441\u043a\u0430\u0440\u043c\u043b\u0438\u0432\u0430\u0435\u043c \u0444\u0438\u0447\u0438 \u043e\u043a\u043d\u0430 \u043d\u0430 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435 i-\u0439 \u043c\u043e\u0434\u0435\u043b\u0438.<\/p>\n<figure class=\"full-width\">\n<div><figcaption>\u0418\u043b\u043b\u044e\u0441\u0442\u0440\u0430\u0446\u0438\u044f: <a class=\"mention\" href=\"\/users\/golts\">@GOLTS<\/a><\/figcaption><\/div>\n<\/figure>\n<p>\u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0431\u0430\u0437\u043e\u0432\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u043d\u044b\u0439 \u0431\u0443\u0441\u0442\u0438\u043d\u0433 \u2014 XGBClassifier \u0438\u0437 xgboost.<\/p>\n<p>\u041d\u0430\u043f\u0438\u0448\u0435\u043c \u0443\u0434\u043e\u0431\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 CompositePipeline, \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u044b\u0439 \u0441 sklearn, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0432\u043d\u0443\u0442\u0440\u0438 \u0441\u0435\u0431\u044f \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u043f\u043e \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d\u0443 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438:<\/p>\n<pre><code class=\"python\">import numpy as np from sklearn.base import BaseEstimator, ClassifierMixin from sklearn.pipeline import Pipeline from sklearn.utils.validation import check_X_y, check_array  from dataclasses import dataclass from enum import Enum from typing import Optional   @dataclass class CompositePrediction:     label: int     prob: float     model_ind: Optional[int]     target_class: Optional[type[Enum]]      def as_enum(self) -> Optional[Enum]:         if self.target_class is not None:             return self.target_class(self.label)         return None      def __lt__(self, other):         return self.prob &lt; other.prob      def __str__(self) -> str:         if (enum_obj := self.as_enum()) is not None:             name = enum_obj.name         else:             name = str(self.label)         return f\"{name}: p={self.prob:0.4f}; model {self.model_ind}\"   class CompositePipeline(BaseEstimator, ClassifierMixin):     def __init__(self, steps_info: list[tuple[str, type, dict]], n_models: int = 1, target_class: Optional[type[Enum]] = None):         self.steps_info = steps_info         self.n_models = n_models         <\/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-363062","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/363062","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=363062"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/363062\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=363062"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=363062"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=363062"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}