{"id":342123,"date":"2022-12-03T03:00:11","date_gmt":"2022-12-03T03:00:11","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=342123"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=342123","title":{"rendered":"<span>\u041f\u0440\u043e\u0433\u043d\u043e\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0434\u0430\u0436 Python. \u041a\u0430\u043a \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c \u0438 \u0441\u0433\u043b\u0430\u0436\u0438\u0432\u0430\u0442\u044c \u0432\u044b\u0431\u0440\u043e\u0441\u044b \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0444\u0438\u043b\u044c\u0442\u0440\u0430 \u0425\u044d\u043c\u043f\u043b\u0435\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\/w780q1\/getpro\/habr\/upload_files\/0ee\/ed5\/474\/0eeed5474eaa3f7cfdec3d3d41756bbb.jpeg\" width=\"1200\" height=\"708\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/0ee\/ed5\/474\/0eeed5474eaa3f7cfdec3d3d41756bbb.jpeg\" data-blurred=\"true\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0422\u0435, \u043a\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c\u0438 \u0440\u044f\u0434\u0430\u043c\u0438, \u0447\u0430\u0441\u0442\u043e \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0441 \u0434\u0432\u0443\u043c\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430\u043c\u0438. \u041f\u0435\u0440\u0432\u0430\u044f \u2013 \u043d\u0435\u0442 \u043f\u043e\u043b\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445. \u0412\u0442\u043e\u0440\u0430\u044f \u2013 \u0431\u0438\u0442\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435, \u043a\u043e\u0433\u0434\u0430 \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u0435\u0442\u0441\u044f \u043c\u043d\u043e\u0433\u043e \u0432\u044b\u0431\u0440\u043e\u0441\u043e\u0432, \u0448\u0443\u043c\u0430 \u0438 \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u043e\u0432. \u0420\u0435\u0434\u043a\u043e \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u044e\u0442\u0441\u044f \u0441\u043b\u0443\u0447\u0430\u0438, \u043a\u043e\u0433\u0434\u0430 \u0432\u0441\u0451 \u0431\u044b\u043b\u043e \u0431\u044b \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u043e. \u0418 \u0434\u0430\u043d\u043d\u044b\u0445 \u043c\u043d\u043e\u0433\u043e, \u0438 \u043c\u043e\u0436\u043d\u043e \u043b\u0435\u0433\u043a\u043e \u043d\u0430\u0439\u0442\u0438 \u043d\u0443\u0436\u043d\u044b\u0435. \u0422\u0430\u043a\u043e\u0435 \u0432\u0441\u0442\u0440\u0435\u0442\u0438\u0448\u044c \u043a\u0440\u0430\u0439\u043d\u0435 \u0440\u0435\u0434\u043a\u043e \u0438\u043b\u0438 \u043f\u043e\u0447\u0442\u0438 \u043d\u0438\u043a\u043e\u0433\u0434\u0430. <\/p>\n<p>\u0412\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u0432\u043e\u043f\u0440\u043e\u0441 &#8212; \u043a\u0430\u043a \u0440\u0435\u0448\u0438\u0442\u044c \u044d\u0442\u0443 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443? \u042f \u043d\u0430\u0448\u0451\u043b \u0440\u0435\u0448\u0435\u043d\u0438\u0435. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u0432\u0430\u043c, \u043a\u0430\u043a \u044f \u0440\u0435\u0448\u0430\u044e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u0431\u0438\u0442\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445, \u0432\u044b\u0431\u0440\u043e\u0441\u043e\u0432, \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u043e\u0432. \u041a\u0430\u043a\u0438\u0435 \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u043c\u0435\u0442\u043e\u0434\u044b, \u0432 \u0447\u0435\u043c \u0438\u0445 \u043e\u0442\u043b\u0438\u0447\u0438\u044f, \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0430 \u0438 \u043a\u0430\u043a\u0438\u0435 \u044f \u0441\u0447\u0438\u0442\u0430\u044e \u0441\u0430\u043c\u044b\u043c\u0438 \u043b\u0443\u0447\u0448\u0438\u043c\u0438. <\/p>\n<p>\u041d\u0430\u0447\u043d\u0451\u043c \u043c\u044b \u0441 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430 \u2013 \u0444\u0438\u043b\u044c\u0442\u0440\u0430 \u0425\u044d\u043c\u043f\u043b\u0435\u044f. \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0440\u0435\u0447\u044c \u043f\u043e\u0439\u0434\u0451\u0442 \u0438\u043c\u0435\u043d\u043d\u043e \u043e \u043d\u0451\u043c. \u042f \u043f\u043e\u0441\u0442\u0430\u0440\u0430\u044e\u0441\u044c \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0449\u0435 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043e \u0435\u0433\u043e \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044f\u0445 \u0438 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0432\u0441\u0451 \u043d\u0430 \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u044b\u0445 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u0445. \u041f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u043c.<\/p>\n<h3>\u041a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0444\u0438\u043b\u044c\u0442\u0440 \u0425\u044d\u043c\u043f\u043b\u0435\u044f<\/h3>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u0442\u043e\u0438\u0442 \u043f\u043e\u043d\u044f\u0442\u044c, \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u0444\u0438\u043b\u044c\u0442\u0440 \u0425\u044d\u043c\u043f\u043b\u0435\u044f. \u0412 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0435 \u043e \u043d\u0451\u043c \u0432\u044b \u043c\u0430\u043b\u043e \u0447\u0442\u043e \u043d\u0430\u0439\u0434\u0451\u0442\u0435. \u041f\u043e \u043a\u0440\u0430\u0439\u043d\u0435\u0439 \u043c\u0435\u0440\u0435, \u044f \u0432\u0441\u0442\u0440\u0435\u0442\u0438\u043b \u043b\u0438\u0448\u044c \u0441\u043a\u0443\u0434\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e. \u0425\u043e\u0442\u044f \u043f\u043e\u0442\u0440\u0430\u0442\u0438\u043b \u043c\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043d\u0430 \u043f\u043e\u0438\u0441\u043a\u0438 \u043d\u0443\u0436\u043d\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e \u0444\u0438\u043b\u044c\u0442\u0440\u0435. <\/p>\n<p>\u0413\u043b\u0430\u0432\u043d\u0430\u044f \u0446\u0435\u043b\u044c \u0425\u044d\u043c\u043f\u043b\u0435\u044f \u2013 \u043d\u0430\u0439\u0442\u0438 \u0438 \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u0432\u044b\u0431\u0440\u043e\u0441\u044b \u0432 \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u043c \u0440\u044f\u0434\u0443. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0432 \u0441\u0432\u043e\u0435\u0439 \u043e\u0441\u043d\u043e\u0432\u0435 \u043e\u043d \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0441\u043a\u043e\u043b\u044c\u0437\u044f\u0449\u0435\u0435 \u0441\u0440\u0435\u0434\u043d\u0435\u0435 \u0441 \u0437\u0430\u0434\u0430\u043d\u043d\u044b\u043c \u043e\u043a\u043d\u043e\u043c. \u0414\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0438 \u0438\u043b\u0438 \u043e\u043a\u043d\u0430 \u0444\u0438\u043b\u044c\u0442\u0440 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442 \u043c\u0435\u0434\u0438\u0430\u043d\u0443 \u0438 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0435 \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u0435. \u041e\u043d\u043e \u0432\u044b\u0440\u0430\u0436\u0430\u0435\u0442\u0441\u044f \u0432 \u0441\u0440\u0435\u0434\u043d\u0435\u043c \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0438 \u0438 \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442\u0441\u044f \u043a\u0430\u043a MAD.<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/31d\/f3e\/0fa\/31df3e0fad7031696c3e3f02988ebe2c.png\" alt=\"\u041c\u0430\u0442\u0435\u0440\u0438\u0430\u043b \u0438\u0437 \u0432\u0438\u043a\u0438: https:\/\/en.wikipedia.org\/wiki\/Median_absolute_deviation\" title=\"\u041c\u0430\u0442\u0435\u0440\u0438\u0430\u043b \u0438\u0437 \u0432\u0438\u043a\u0438: https:\/\/en.wikipedia.org\/wiki\/Median_absolute_deviation\" width=\"195\" height=\"20\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/31d\/f3e\/0fa\/31df3e0fad7031696c3e3f02988ebe2c.png\"\/><figcaption>\u041c\u0430\u0442\u0435\u0440\u0438\u0430\u043b \u0438\u0437 \u0432\u0438\u043a\u0438: https:\/\/en.wikipedia.org\/wiki\/Median_absolute_deviation<\/figcaption><\/figure>\n<p>\u0427\u0442\u043e\u0431\u044b MAD \u0441\u0442\u0430\u043b \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u043e\u0446\u0435\u043d\u043a\u043e\u0439 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0433\u043e \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u044f \u043d\u0430\u0434\u043e \u0443\u043c\u043d\u043e\u0436\u0438\u0442\u044c \u0435\u0433\u043e \u043d\u0430 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u044b\u0439 \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u00a0k. \u041a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f. \u041c\u044b \u0441\u0447\u0438\u0442\u0430\u0435\u043c, \u0447\u0442\u043e \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u0434\u0447\u0438\u043d\u044f\u044e\u0442\u0441\u044f \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044e \u0413\u0430\u0443\u0441\u0441\u0430, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0431\u0435\u0440\u0451\u043c \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442 \u0440\u0430\u0432\u043d\u044b\u043c 1,4826.<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/3cc\/a3b\/ab5\/3cca3bab576ed0eb067cf7bb15241c4b.PNG\" width=\"383\" height=\"41\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0415\u0441\u043b\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043c\u0435\u0434\u0438\u0430\u043d\u044b \u043e\u043a\u043d\u0430 \u0441\u043a\u043e\u043b\u044c\u0437\u044f\u0449\u0435\u0433\u043e \u0441\u0440\u0435\u0434\u043d\u0435\u0433\u043e \u0431\u043e\u043b\u044c\u0448\u0435 \u0447\u0435\u043c <em>\u0445<\/em>\u00a0\u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0445 \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u0439, \u0442\u043e \u044d\u0442\u043e \u2013 \u0432\u044b\u0431\u0440\u043e\u0441.<\/p>\n<p>\u0424\u0438\u043b\u044c\u0442\u0440 \u0425\u044d\u043c\u043f\u043b\u0435\u044f \u0438\u043c\u0435\u0435\u0442 2 \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c\u044b\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430:<\/p>\n<p>\u00b7\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u0440\u0430\u0437\u043c\u0435\u0440 \u0440\u0430\u0437\u0434\u0432\u0438\u0436\u043d\u043e\u0433\u043e \u043e\u043a\u043d\u0430<\/p>\n<p>\u00b7\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0445 \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u0446\u0438\u0440\u0443\u044e\u0442 \u0432\u044b\u0431\u0440\u043e\u0441<\/p>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0430\u0434\u043e \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0443\u0436\u043d\u044b\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438:<\/p>\n<pre><code class=\"python\">import matplotlib.pyplot as plt import warnings import pandas as pd import numpy as np<\/code><\/pre>\n<p>\u0417\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 csv \u0444\u0430\u0439\u043b\u0430:<\/p>\n<pre><code class=\"python\">df = pd.read_csv('data.csv')<\/code><\/pre>\n<p>\u0420\u0430\u0441\u043f\u0435\u0447\u0430\u0442\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435<\/p>\n<pre><code class=\"python\">df.head()<\/code><\/pre>\n<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/4b5\/c17\/e13\/4b5c17e131b2f7f8f7c7e6dd2acf9962.png\" width=\"251\" height=\"242\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/4b5\/c17\/e13\/4b5c17e131b2f7f8f7c7e6dd2acf9962.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0432\u044b\u0431\u0440\u043e\u0441\u044b \u0432 df \u0443\u0436\u0435 \u043f\u043e\u043c\u0435\u0447\u0435\u043d\u044b. \u042d\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043c\u044b \u043c\u043e\u0433\u043b\u0438 \u0441\u0440\u0430\u0432\u043d\u0438\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0443 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 \u0441 \u0444\u0430\u043a\u0442\u043e\u043c. <\/p>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u043d\u0430\u0448 df<\/p>\n<pre><code class=\"python\">plt.plot(df.x, df.y) plt.scatter(df[df.outlier == 1].x, df[df.outlier == 1].y, c='r', label='outlier')<\/code><\/pre>\n<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/0d4\/e9c\/3b9\/0d4e9c3b922cfda4436436168461448d.png\" width=\"428\" height=\"291\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/0d4\/e9c\/3b9\/0d4e9c3b922cfda4436436168461448d.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u0444\u0438\u043b\u044c\u0442\u0440 \u0425\u044d\u043c\u043f\u0435\u043b\u044f. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c 3 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0445 \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u044f. \u041f\u043e\u0447\u0435\u043c\u0443 \u0438\u043c\u0435\u043d\u043d\u043e 3? \u041f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u044d\u0442\u043e\u0433\u043e \u0441 \u043b\u0438\u0445\u0432\u043e\u0439 \u0445\u0432\u0430\u0442\u0438\u0442 \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0433\u043e \u0440\u044f\u0434\u0430. <\/p>\n<pre><code class=\"python\">def hampel(y, window_size, simg=3):         n = len(y)     new_y = y.copy()     k = 1.4826     idx = []      for i in range((window_size),(n - window_size)):         r_median = np.median(y[(i - window_size):(i + window_size)]) #\u0441\u043a\u043e\u043b\u044c\u0437\u044f\u0449\u0430\u044f \u043c\u0435\u0434\u0438\u0430\u043d\u0430          r_mad  = np.median(np.abs(y[(i - window_size):(i + window_size)] - r_median)) #\u0441\u043a\u043e\u043b\u044c\u0437\u044f\u0449\u0438\u0439 MAD          if (np.abs(y[i] - r_median) > simg * r_mad):             new_y[i] = r_median #\u0437\u0430\u043c\u0435\u043d\u0430 \u0432\u044b\u0431\u0440\u043e\u0441\u0430             idx.append(i)          return new_y, idx<\/code><\/pre>\n<p>\u0412\u044b\u0437\u044b\u0432\u0430\u0435\u043c \u0444\u0438\u043b\u044c\u0442\u0440 \u0425\u044d\u043c\u043f\u043b\u0435\u044f \u0441 \u043e\u043a\u043d\u043e\u043c \u0441\u043a\u043e\u043b\u044c\u0437\u044f\u0449\u0435\u0433\u043e \u0441\u0440\u0435\u0434\u043d\u0435\u0433\u043e \u0440\u0430\u0432\u043d\u043e\u0433\u043e 3, \u0447\u0442\u043e\u0431\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0432\u044b\u0431\u0440\u043e\u0441. \u042d\u0442\u043e\u0433\u043e \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0439 \u0437\u0430\u0434\u0430\u0447\u0438.<\/p>\n<pre><code class=\"python\">new_y, outliers = hampel(df.y, 3)<\/code><\/pre>\n<p>\u0412 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 new_y \u043b\u0435\u0436\u0438\u0442 \u043d\u043e\u0432\u044b\u0439 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0439 \u0440\u044f\u0434 \u0431\u0435\u0437 \u0432\u044b\u0431\u0440\u043e\u0441\u043e\u0432. \u0412 outliers &#8212; \u0438\u043d\u0434\u0435\u043a\u0441\u044b \u0432\u044b\u0431\u0440\u043e\u0441\u043e\u0432 \u0432\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u043c \u0440\u044f\u0434\u0443.<\/p>\n<p>\u0417\u0430\u043b\u0438\u0432\u0430\u0435\u043c \u043d\u043e\u0432\u044b\u0439 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0439 \u0440\u044f\u0434 \u0432 df \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0430\u043c\u0438 \u0432\u044b\u0431\u0440\u043e\u0441\u043e\u0432.<\/p>\n<pre><code class=\"python\">df['new_y'] = new_y df.loc[outliers, 'outlier_hampel'] = 1<\/code><\/pre>\n<p>\u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435.<\/p>\n<pre><code class=\"python\">from matplotlib.pyplot import figure figure(figsize=(15, 6), dpi=80) plt.plot(df.x, df.y) plt.plot(df.x, df.new_y) plt.scatter(df[df.outlier == 1].x, df[df.outlier == 1].y, c='r', label='outlier') plt.scatter(df[df.outlier_hampel == 1].x, df[df.outlier_hampel == 1].y, c='b', label='outlier')<\/code><\/pre>\n<p>\u0412\u044b\u0431\u0440\u043e\u0441\u044b, \u0440\u0430\u0437\u043c\u0435\u0447\u0435\u043d\u043d\u044b\u0435 \u0432\u0440\u0443\u0447\u043d\u0443\u044e, \u0432\u044b\u0434\u0435\u043b\u044f\u044e\u0442\u0441\u044f \u043a\u0440\u0430\u0441\u043d\u044b\u043c \u0446\u0432\u0435\u0442\u043e\u043c. \u0421\u0438\u043d\u0438\u0435 \u0432\u044b\u0431\u0440\u043e\u0441\u044b \u2013 \u044d\u0442\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0438. <\/p>\n<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/d42\/cd9\/e7d\/d42cd9e7db8e15f8180c19911482585b.png\" width=\"991\" height=\"396\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/d42\/cd9\/e7d\/d42cd9e7db8e15f8180c19911482585b.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u041d\u0430 \u0433\u0440\u0430\u0444\u0438\u043a\u0435 \u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u043a\u0440\u0430\u0441\u043d\u043e\u0433\u043e \u0446\u0432\u0435\u0442\u0430 \u043d\u0435\u0442. \u0412\u044b\u0432\u043e\u0434 \u2013 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0430 \u043e\u0442\u043b\u0438\u0447\u043d\u043e. <\/p>\n<p>\u0414\u043b\u044f \u043b\u0443\u0447\u0448\u0435\u0433\u043e \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u0432\u043e\u0437\u044c\u043c\u0451\u043c \u0434\u0440\u0443\u0433\u043e\u0439 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0440\u044f\u0434, \u0447\u0442\u043e\u0431\u044b \u0441\u043d\u043e\u0432\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c. <\/p>\n<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/0d5\/3c0\/ca4\/0d53c0ca4f87fa4bd2b379dded702e5c.png\" width=\"991\" height=\"396\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/0d5\/3c0\/ca4\/0d53c0ca4f87fa4bd2b379dded702e5c.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0417\u0434\u0435\u0441\u044c \u0437\u0430\u043c\u0435\u0442\u0438\u043c, \u0447\u0442\u043e \u0432\u044b\u0431\u0440\u043e\u0441\u043e\u0432 \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u0431\u043e\u043b\u044c\u0448\u0435. <\/p>\n<pre><code class=\"python\">new_y, outliers = hampel(df_new.y, 3) df_new['new_y'] = res df_new.loc[detected_outliers, 'outlier_hampel'] = 1  from matplotlib.pyplot import figure figure(figsize=(15, 6), dpi=80) plt.plot(df_new.x, df_new.y) plt.plot(df_new.x, df_new.new_y) plt.scatter(df_new[df_new.outlier == 1].x, df_new[df_new.outlier == 1].y, c='r', label='outlier') plt.scatter(df_new[df_new.outlier_hampel == 1].x, df_new[df_new.outlier_hampel == 1].y, c='b', label='outlier')<\/code><\/pre>\n<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/b8d\/390\/d3f\/b8d390d3fbf5305fc446903da8e8937f.png\" width=\"991\" height=\"396\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/b8d\/390\/d3f\/b8d390d3fbf5305fc446903da8e8937f.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0423\u0432\u0435\u043b\u0438\u0447\u0438\u043c \u043e\u043a\u043d\u043e \u0441\u043a\u043e\u043b\u044c\u0437\u044f\u0449\u0435\u0433\u043e \u0441\u0440\u0435\u0434\u043d\u0435\u0433\u043e.<\/p>\n<pre><code class=\"python\">new_y, outliers = hampel(df_new.y, 5) df_new['new_y'] = res df_new.loc[detected_outliers, 'outlier_hampel'] = 1  from matplotlib.pyplot import figure figure(figsize=(15, 6), dpi=80) plt.plot(df_new.x, df_new.y) plt.plot(df_new.x, df_new.new_y) plt.scatter(df_new[df_new.outlier == 1].x, df_new[df_new.outlier == 1].y, c='r', label='outlier') plt.scatter(df_new[df_new.outlier_hampel == 1].x, df_new[df_new.outlier_hampel == 1].y, c='b', label='outlier')<\/code><\/pre>\n<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/1e7\/70e\/c36\/1e770ec36a5468579df315b33a6aaf05.png\" width=\"991\" height=\"396\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/1e7\/70e\/c36\/1e770ec36a5468579df315b33a6aaf05.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0412\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u0441\u0442\u0430\u043b\u043e \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u043b\u0443\u0447\u0448\u0435. <\/p>\n<p>\u0427\u0442\u043e \u043a\u0430\u0441\u0430\u0435\u0442\u0441\u044f \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438, \u0442\u043e \u043e\u043d\u0430 \u0440\u0430\u0432\u043d\u0430 93.33333333333333 %. \u042f \u0441\u0447\u0438\u0442\u0430\u044e, \u0447\u0442\u043e \u044d\u0442\u043e \u043e\u0442\u043b\u0438\u0447\u043d\u044b\u0439 \u043f\u0440\u043e\u0446\u0435\u043d\u0442. <\/p>\n<pre><code class=\"python\"> (df_new[df_new.outlier_hampel == 1].shape[0]\/df_new[df_new.outlier == 1].shape[0])*100<\/code><\/pre>\n<h3>\u0427\u0442\u043e \u0432 \u0438\u0442\u043e\u0433\u0435?<\/h3>\n<p>\u0424\u0438\u043b\u044c\u0442\u0440 \u0425\u044d\u043c\u043f\u0435\u043b\u044f \u043f\u0440\u0435\u043a\u0440\u0430\u0441\u043d\u043e \u0441\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u043e \u0441\u0432\u043e\u0435\u0439 \u0437\u0430\u0434\u0430\u0447\u0435\u0439. \u0415\u0433\u043e \u0433\u043b\u0430\u0432\u043d\u044b\u043c \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u043c \u0441\u0442\u0430\u043b\u0430 \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438. \u041e\u043d \u043c\u043e\u0436\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0431\u044b\u0441\u0442\u0440\u043e \u043a\u0430\u043a \u043d\u0430 \u043c\u0430\u043b\u044b\u0445, \u0442\u0430\u043a \u0438 \u043d\u0430 \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u043e\u0431\u044a\u0435\u043c\u0430\u0445 \u0434\u0430\u043d\u043d\u044b\u0445. \u0421\u0430\u043c\u043e \u0441\u043e\u0431\u043e\u0439, \u0435\u0441\u0442\u044c \u0447\u0442\u043e \u0443\u043b\u0443\u0447\u0448\u0438\u0442\u044c, \u043d\u043e \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u0438 \u0440\u0430\u0431\u043e\u0447\u0435\u0433\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430 \u0444\u0438\u043b\u044c\u0442\u0440 \u0425\u044d\u043c\u043f\u0435\u043b\u044f \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u0441\u0435\u0431\u044f \u0432\u0435\u0441\u044c\u043c\u0430 \u043d\u0435\u043f\u043b\u043e\u0445\u043e.<\/p>\n<p>\u041d\u043e \u0442\u0430\u043a \u043b\u0438 \u043e\u043d \u0445\u043e\u0440\u043e\u0448, \u0435\u0441\u043b\u0438 \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u0441 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430\u043c\u0438? \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0441 \u0442\u0435\u0441\u0442\u043e\u043c \u0413\u0440\u0435\u0431\u0431\u0441\u0430, \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u0435\u043c \u0432\u044b\u0431\u043e\u0440\u0430 \u0420\u043e\u0437\u043d\u0435\u0440\u0430 \u0438 \u0440\u0430\u043d\u0434\u043e\u043c\u043d\u044b\u043c \u043b\u0435\u0441\u043e\u043c. \u041e\u0431 \u044d\u0442\u043e\u043c \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0441\u0442\u0430\u0442\u044c\u044f\u0445, \u0430 \u0432 \u043a\u043e\u043d\u0446\u0435 \u0441\u0440\u0430\u0432\u043d\u0438\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0440\u0430\u0431\u043e\u0442\u044b \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 \u0438 \u0432\u044b\u043d\u0435\u0441\u0435\u043c \u043e\u043a\u043e\u043d\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0432\u0435\u0440\u0434\u0438\u043a\u0442, \u0447\u0442\u043e \u0436\u0435 \u043b\u0443\u0447\u0448\u0435.<\/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\/post\/703246\/\"> https:\/\/habr.com\/ru\/post\/703246\/<\/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\"><figcaption><\/figcaption><\/figure>\n<p>\u0422\u0435, \u043a\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c\u0438 \u0440\u044f\u0434\u0430\u043c\u0438, \u0447\u0430\u0441\u0442\u043e \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0441 \u0434\u0432\u0443\u043c\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430\u043c\u0438. \u041f\u0435\u0440\u0432\u0430\u044f \u2013 \u043d\u0435\u0442 \u043f\u043e\u043b\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445. \u0412\u0442\u043e\u0440\u0430\u044f \u2013 \u0431\u0438\u0442\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435, \u043a\u043e\u0433\u0434\u0430 \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u0435\u0442\u0441\u044f \u043c\u043d\u043e\u0433\u043e \u0432\u044b\u0431\u0440\u043e\u0441\u043e\u0432, \u0448\u0443\u043c\u0430 \u0438 \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u043e\u0432. \u0420\u0435\u0434\u043a\u043e \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u044e\u0442\u0441\u044f \u0441\u043b\u0443\u0447\u0430\u0438, \u043a\u043e\u0433\u0434\u0430 \u0432\u0441\u0451 \u0431\u044b\u043b\u043e \u0431\u044b \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u043e. \u0418 \u0434\u0430\u043d\u043d\u044b\u0445 \u043c\u043d\u043e\u0433\u043e, \u0438 \u043c\u043e\u0436\u043d\u043e \u043b\u0435\u0433\u043a\u043e \u043d\u0430\u0439\u0442\u0438 \u043d\u0443\u0436\u043d\u044b\u0435. \u0422\u0430\u043a\u043e\u0435 \u0432\u0441\u0442\u0440\u0435\u0442\u0438\u0448\u044c \u043a\u0440\u0430\u0439\u043d\u0435 \u0440\u0435\u0434\u043a\u043e \u0438\u043b\u0438 \u043f\u043e\u0447\u0442\u0438 \u043d\u0438\u043a\u043e\u0433\u0434\u0430. <\/p>\n<p>\u0412\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u0432\u043e\u043f\u0440\u043e\u0441 &#8212; \u043a\u0430\u043a \u0440\u0435\u0448\u0438\u0442\u044c \u044d\u0442\u0443 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443? \u042f \u043d\u0430\u0448\u0451\u043b \u0440\u0435\u0448\u0435\u043d\u0438\u0435. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u0432\u0430\u043c, \u043a\u0430\u043a \u044f \u0440\u0435\u0448\u0430\u044e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u0431\u0438\u0442\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445, \u0432\u044b\u0431\u0440\u043e\u0441\u043e\u0432, \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u043e\u0432. \u041a\u0430\u043a\u0438\u0435 \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u043c\u0435\u0442\u043e\u0434\u044b, \u0432 \u0447\u0435\u043c \u0438\u0445 \u043e\u0442\u043b\u0438\u0447\u0438\u044f, \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0430 \u0438 \u043a\u0430\u043a\u0438\u0435 \u044f \u0441\u0447\u0438\u0442\u0430\u044e \u0441\u0430\u043c\u044b\u043c\u0438 \u043b\u0443\u0447\u0448\u0438\u043c\u0438. <\/p>\n<p>\u041d\u0430\u0447\u043d\u0451\u043c \u043c\u044b \u0441 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430 \u2013 \u0444\u0438\u043b\u044c\u0442\u0440\u0430 \u0425\u044d\u043c\u043f\u043b\u0435\u044f. \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0440\u0435\u0447\u044c \u043f\u043e\u0439\u0434\u0451\u0442 \u0438\u043c\u0435\u043d\u043d\u043e \u043e \u043d\u0451\u043c. \u042f \u043f\u043e\u0441\u0442\u0430\u0440\u0430\u044e\u0441\u044c \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0449\u0435 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043e \u0435\u0433\u043e \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044f\u0445 \u0438 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0432\u0441\u0451 \u043d\u0430 \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u044b\u0445 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u0445. \u041f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u043c.<\/p>\n<h3>\u041a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0444\u0438\u043b\u044c\u0442\u0440 \u0425\u044d\u043c\u043f\u043b\u0435\u044f<\/h3>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u0442\u043e\u0438\u0442 \u043f\u043e\u043d\u044f\u0442\u044c, \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u0444\u0438\u043b\u044c\u0442\u0440 \u0425\u044d\u043c\u043f\u043b\u0435\u044f. \u0412 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0435 \u043e \u043d\u0451\u043c \u0432\u044b \u043c\u0430\u043b\u043e \u0447\u0442\u043e \u043d\u0430\u0439\u0434\u0451\u0442\u0435. \u041f\u043e \u043a\u0440\u0430\u0439\u043d\u0435\u0439 \u043c\u0435\u0440\u0435, \u044f \u0432\u0441\u0442\u0440\u0435\u0442\u0438\u043b \u043b\u0438\u0448\u044c \u0441\u043a\u0443\u0434\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e. \u0425\u043e\u0442\u044f \u043f\u043e\u0442\u0440\u0430\u0442\u0438\u043b \u043c\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043d\u0430 \u043f\u043e\u0438\u0441\u043a\u0438 \u043d\u0443\u0436\u043d\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e \u0444\u0438\u043b\u044c\u0442\u0440\u0435. <\/p>\n<p>\u0413\u043b\u0430\u0432\u043d\u0430\u044f \u0446\u0435\u043b\u044c \u0425\u044d\u043c\u043f\u043b\u0435\u044f \u2013 \u043d\u0430\u0439\u0442\u0438 \u0438 \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u0432\u044b\u0431\u0440\u043e\u0441\u044b \u0432 \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u043c \u0440\u044f\u0434\u0443. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0432 \u0441\u0432\u043e\u0435\u0439 \u043e\u0441\u043d\u043e\u0432\u0435 \u043e\u043d \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0441\u043a\u043e\u043b\u044c\u0437\u044f\u0449\u0435\u0435 \u0441\u0440\u0435\u0434\u043d\u0435\u0435 \u0441 \u0437\u0430\u0434\u0430\u043d\u043d\u044b\u043c \u043e\u043a\u043d\u043e\u043c. \u0414\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0438 \u0438\u043b\u0438 \u043e\u043a\u043d\u0430 \u0444\u0438\u043b\u044c\u0442\u0440 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442 \u043c\u0435\u0434\u0438\u0430\u043d\u0443 \u0438 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0435 \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u0435. \u041e\u043d\u043e \u0432\u044b\u0440\u0430\u0436\u0430\u0435\u0442\u0441\u044f \u0432 \u0441\u0440\u0435\u0434\u043d\u0435\u043c \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0438 \u0438 \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442\u0441\u044f \u043a\u0430\u043a MAD.<\/p>\n<figure class=\"\"><figcaption>\u041c\u0430\u0442\u0435\u0440\u0438\u0430\u043b \u0438\u0437 \u0432\u0438\u043a\u0438: https:\/\/en.wikipedia.org\/wiki\/Median_absolute_deviation<\/figcaption><\/figure>\n<p>\u0427\u0442\u043e\u0431\u044b MAD \u0441\u0442\u0430\u043b \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u043e\u0446\u0435\u043d\u043a\u043e\u0439 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0433\u043e \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u044f \u043d\u0430\u0434\u043e \u0443\u043c\u043d\u043e\u0436\u0438\u0442\u044c \u0435\u0433\u043e \u043d\u0430 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u044b\u0439 \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u00a0k. \u041a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f. \u041c\u044b \u0441\u0447\u0438\u0442\u0430\u0435\u043c, \u0447\u0442\u043e \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u0434\u0447\u0438\u043d\u044f\u044e\u0442\u0441\u044f \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044e \u0413\u0430\u0443\u0441\u0441\u0430, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0431\u0435\u0440\u0451\u043c \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442 \u0440\u0430\u0432\u043d\u044b\u043c 1,4826.<\/p>\n<figure class=\"\"><figcaption><\/figcaption><\/figure>\n<p>\u0415\u0441\u043b\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043c\u0435\u0434\u0438\u0430\u043d\u044b \u043e\u043a\u043d\u0430 \u0441\u043a\u043e\u043b\u044c\u0437\u044f\u0449\u0435\u0433\u043e \u0441\u0440\u0435\u0434\u043d\u0435\u0433\u043e \u0431\u043e\u043b\u044c\u0448\u0435 \u0447\u0435\u043c <em>\u0445<\/em>\u00a0\u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0445 \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u0439, \u0442\u043e \u044d\u0442\u043e \u2013 \u0432\u044b\u0431\u0440\u043e\u0441.<\/p>\n<p>\u0424\u0438\u043b\u044c\u0442\u0440 \u0425\u044d\u043c\u043f\u043b\u0435\u044f \u0438\u043c\u0435\u0435\u0442 2 \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c\u044b\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430:<\/p>\n<p>\u00b7\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u0440\u0430\u0437\u043c\u0435\u0440 \u0440\u0430\u0437\u0434\u0432\u0438\u0436\u043d\u043e\u0433\u043e \u043e\u043a\u043d\u0430<\/p>\n<p>\u00b7\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0445 \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u0446\u0438\u0440\u0443\u044e\u0442 \u0432\u044b\u0431\u0440\u043e\u0441<\/p>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0430\u0434\u043e \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0443\u0436\u043d\u044b\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438:<\/p>\n<pre><code class=\"python\">import matplotlib.pyplot as plt import warnings import pandas as pd import numpy as np<\/code><\/pre>\n<p>\u0417\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 csv \u0444\u0430\u0439\u043b\u0430:<\/p>\n<pre><code class=\"python\">df = pd.read_csv('data.csv')<\/code><\/pre>\n<p>\u0420\u0430\u0441\u043f\u0435\u0447\u0430\u0442\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435<\/p>\n<pre><code class=\"python\">df.head()<\/code><\/pre>\n<\/p>\n<figure class=\"\"><figcaption><\/figcaption><\/figure>\n<p>\u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0432\u044b\u0431\u0440\u043e\u0441\u044b \u0432 df \u0443\u0436\u0435 \u043f\u043e\u043c\u0435\u0447\u0435\u043d\u044b. \u042d\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043c\u044b \u043c\u043e\u0433\u043b\u0438 \u0441\u0440\u0430\u0432\u043d\u0438\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0443 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 \u0441 \u0444\u0430\u043a\u0442\u043e\u043c. <\/p>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u043d\u0430\u0448 df<\/p>\n<pre><code class=\"python\">plt.plot(df.x, df.y) plt.scatter(df[df.outlier == 1].x, df[df.outlier == 1].y, c='r', label='outlier')<\/code><\/pre>\n<\/p>\n<figure class=\"\"><figcaption><\/figcaption><\/figure>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u0444\u0438\u043b\u044c\u0442\u0440 \u0425\u044d\u043c\u043f\u0435\u043b\u044f. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c 3 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0445 \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u044f. \u041f\u043e\u0447\u0435\u043c\u0443 \u0438\u043c\u0435\u043d\u043d\u043e 3? \u041f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u044d\u0442\u043e\u0433\u043e \u0441 \u043b\u0438\u0445\u0432\u043e\u0439 \u0445\u0432\u0430\u0442\u0438\u0442 \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0433\u043e \u0440\u044f\u0434\u0430. <\/p>\n<pre><code class=\"python\">def hampel(y, window_size, simg=3):         n = len(y)     new_y = y.copy()     k = 1.4826     idx = []      for i in range((window_size),(n - window_size)):         r_median = np.median(y[(i - window_size):(i + window_size)]) #\u0441\u043a\u043e\u043b\u044c\u0437\u044f\u0449\u0430\u044f \u043c\u0435\u0434\u0438\u0430\u043d\u0430          r_mad  = np.median(np.abs(y[(i - window_size):(i + window_size)] - r_median)) #\u0441\u043a\u043e\u043b\u044c\u0437\u044f\u0449\u0438\u0439 MAD          if (np.abs(y[i] - r_median) > simg * r_mad):             new_y[i] = r_median #\u0437\u0430\u043c\u0435\u043d\u0430 \u0432\u044b\u0431\u0440\u043e\u0441\u0430             idx.append(i)          return new_y, idx<\/code><\/pre>\n<p>\u0412\u044b\u0437\u044b\u0432\u0430\u0435\u043c \u0444\u0438\u043b\u044c\u0442\u0440 \u0425\u044d\u043c\u043f\u043b\u0435\u044f \u0441 \u043e\u043a\u043d\u043e\u043c \u0441\u043a\u043e\u043b\u044c\u0437\u044f\u0449\u0435\u0433\u043e \u0441\u0440\u0435\u0434\u043d\u0435\u0433\u043e \u0440\u0430\u0432\u043d\u043e\u0433\u043e 3, \u0447\u0442\u043e\u0431\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0432\u044b\u0431\u0440\u043e\u0441. \u042d\u0442\u043e\u0433\u043e \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0439 \u0437\u0430\u0434\u0430\u0447\u0438.<\/p>\n<pre><code class=\"python\">new_y, outliers = hampel(df.y, 3)<\/code><\/pre>\n<p>\u0412 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 new_y \u043b\u0435\u0436\u0438\u0442 \u043d\u043e\u0432\u044b\u0439 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0439 \u0440\u044f\u0434 \u0431\u0435\u0437 \u0432\u044b\u0431\u0440\u043e\u0441\u043e\u0432. \u0412 outliers &#8212; \u0438\u043d\u0434\u0435\u043a\u0441\u044b \u0432\u044b\u0431\u0440\u043e\u0441\u043e\u0432 \u0432\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u043c \u0440\u044f\u0434\u0443.<\/p>\n<p>\u0417\u0430\u043b\u0438\u0432\u0430\u0435\u043c \u043d\u043e\u0432\u044b\u0439 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0439 \u0440\u044f\u0434 \u0432 df \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0430\u043c\u0438 \u0432\u044b\u0431\u0440\u043e\u0441\u043e\u0432.<\/p>\n<pre><code class=\"python\">df['new_y'] = new_y df.loc[outliers, 'outlier_hampel'] = 1<\/code><\/pre>\n<p>\u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435.<\/p>\n<pre><code class=\"python\">from matplotlib.pyplot import figure figure(figsize=(15, 6), dpi=80) plt.plot(df.x, df.y) plt.plot(df.x, df.new_y) plt.scatter(df[df.outlier == 1].x, df[df.outlier == 1].y, c='r', label='outlier') plt.scatter(df[df.outlier_hampel == 1].x, df[df.outlier_hampel == 1].y, c='b', label='outlier')<\/code><\/pre>\n<p>\u0412\u044b\u0431\u0440\u043e\u0441\u044b, \u0440\u0430\u0437\u043c\u0435\u0447\u0435\u043d\u043d\u044b\u0435 \u0432\u0440\u0443\u0447\u043d\u0443\u044e, \u0432\u044b\u0434\u0435\u043b\u044f\u044e\u0442\u0441\u044f \u043a\u0440\u0430\u0441\u043d\u044b\u043c \u0446\u0432\u0435\u0442\u043e\u043c. \u0421\u0438\u043d\u0438\u0435 \u0432\u044b\u0431\u0440\u043e\u0441\u044b \u2013 \u044d\u0442\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0438. <\/p>\n<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u041d\u0430 \u0433\u0440\u0430\u0444\u0438\u043a\u0435 \u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u043a\u0440\u0430\u0441\u043d\u043e\u0433\u043e \u0446\u0432\u0435\u0442\u0430 \u043d\u0435\u0442. \u0412\u044b\u0432\u043e\u0434 \u2013 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0430 \u043e\u0442\u043b\u0438\u0447\u043d\u043e. <\/p>\n<p>\u0414\u043b\u044f \u043b\u0443\u0447\u0448\u0435\u0433\u043e \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u0432\u043e\u0437\u044c\u043c\u0451\u043c \u0434\u0440\u0443\u0433\u043e\u0439 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0440\u044f\u0434, \u0447\u0442\u043e\u0431\u044b \u0441\u043d\u043e\u0432\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c. <\/p>\n<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0417\u0434\u0435\u0441\u044c \u0437\u0430\u043c\u0435\u0442\u0438\u043c, \u0447\u0442\u043e \u0432\u044b\u0431\u0440\u043e\u0441\u043e\u0432 \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u0431\u043e\u043b\u044c\u0448\u0435. <\/p>\n<pre><code class=\"python\">new_y, outliers = hampel(df_new.y, 3) df_new['new_y'] = res df_new.loc[detected_outliers, 'outlier_hampel'] = 1  from matplotlib.pyplot import figure figure(figsize=(15, 6), dpi=80) plt.plot(df_new.x, df_new.y) plt.plot(df_new.x, df_new.new_y) plt.scatter(df_new[df_new.outlier == 1].x, df_new[df_new.outlier == 1].y, c='r', label='outlier') plt.scatter(df_new[df_new.outlier_hampel == 1].x, df_new[df_new.outlier_hampel == 1].y, c='b', label='outlier')<\/code><\/pre>\n<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0423\u0432\u0435\u043b\u0438\u0447\u0438\u043c \u043e\u043a\u043d\u043e \u0441\u043a\u043e\u043b\u044c\u0437\u044f\u0449\u0435\u0433\u043e \u0441\u0440\u0435\u0434\u043d\u0435\u0433\u043e.<\/p>\n<pre><code class=\"python\">new_y, outliers = hampel(df_new.y, 5) df_new['new_y'] = res df_new.loc[detected_outliers, 'outlier_hampel'] = 1  from matplotlib.pyplot import figure figure(figsize=(15, 6), dpi=80) plt.plot(df_new.x, df_new.y) plt.plot(df_new.x, df_new.new_y) plt.scatter(df_new[df_new.outlier == 1].x, df_new[df_new.outlier == 1].y, c='r', label='outlier') plt.scatter(df_new[df_new.outlier_hampel == 1].x, df_new[df_new.outlier_hampel == 1].y, c='b', label='outlier')<\/code><\/pre>\n<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0412\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u0441\u0442\u0430\u043b\u043e \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u043b\u0443\u0447\u0448\u0435. <\/p>\n<p>\u0427\u0442\u043e \u043a\u0430\u0441\u0430\u0435\u0442\u0441\u044f \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438, \u0442\u043e \u043e\u043d\u0430 \u0440\u0430\u0432\u043d\u0430 93.33333333333333 %. \u042f \u0441\u0447\u0438\u0442\u0430\u044e, \u0447\u0442\u043e \u044d\u0442\u043e \u043e\u0442\u043b\u0438\u0447\u043d\u044b\u0439 \u043f\u0440\u043e\u0446\u0435\u043d\u0442. <\/p>\n<pre><code class=\"python\"> (df_new[df_new.outlier_hampel == 1].shape[0]\/df_new[df_new.outlier == 1].shape[0])*100<\/code><\/pre>\n<h3>\u0427\u0442\u043e \u0432 \u0438\u0442\u043e\u0433\u0435?<\/h3>\n<p>\u0424\u0438\u043b\u044c\u0442\u0440 \u0425\u044d\u043c\u043f\u0435\u043b\u044f \u043f\u0440\u0435\u043a\u0440\u0430\u0441\u043d\u043e \u0441\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u043e \u0441\u0432\u043e\u0435\u0439 \u0437\u0430\u0434\u0430\u0447\u0435\u0439. \u0415\u0433\u043e \u0433\u043b\u0430\u0432\u043d\u044b\u043c \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u043c \u0441\u0442\u0430\u043b\u0430 \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438. \u041e\u043d \u043c\u043e\u0436\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0431\u044b\u0441\u0442\u0440\u043e \u043a\u0430\u043a \u043d\u0430 \u043c\u0430\u043b\u044b\u0445, \u0442\u0430\u043a \u0438 \u043d\u0430 \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u043e\u0431\u044a\u0435\u043c\u0430\u0445 \u0434\u0430\u043d\u043d\u044b\u0445. \u0421\u0430\u043c\u043e \u0441\u043e\u0431\u043e\u0439, \u0435\u0441\u0442\u044c \u0447\u0442\u043e \u0443\u043b\u0443\u0447\u0448\u0438\u0442\u044c, \u043d\u043e \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u0438 \u0440\u0430\u0431\u043e\u0447\u0435\u0433\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430 \u0444\u0438\u043b\u044c\u0442\u0440 \u0425\u044d\u043c\u043f\u0435\u043b\u044f \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u0441\u0435\u0431\u044f \u0432\u0435\u0441\u044c\u043c\u0430 \u043d\u0435\u043f\u043b\u043e\u0445\u043e.<\/p>\n<p>\u041d\u043e \u0442\u0430\u043a \u043b\u0438 \u043e\u043d \u0445\u043e\u0440\u043e\u0448, \u0435\u0441\u043b\u0438 \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u0441 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430\u043c\u0438? \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0441 \u0442\u0435\u0441\u0442\u043e\u043c \u0413\u0440\u0435\u0431\u0431\u0441\u0430, \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u0435\u043c \u0432\u044b\u0431\u043e\u0440\u0430 \u0420\u043e\u0437\u043d\u0435\u0440\u0430 \u0438 \u0440\u0430\u043d\u0434\u043e\u043c\u043d\u044b\u043c \u043b\u0435\u0441\u043e\u043c. \u041e\u0431 \u044d\u0442\u043e\u043c \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0441\u0442\u0430\u0442\u044c\u044f\u0445, \u0430 \u0432 \u043a\u043e\u043d\u0446\u0435 \u0441\u0440\u0430\u0432\u043d\u0438\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0440\u0430\u0431\u043e\u0442\u044b \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 \u0438 \u0432\u044b\u043d\u0435\u0441\u0435\u043c \u043e\u043a\u043e\u043d\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0432\u0435\u0440\u0434\u0438\u043a\u0442, \u0447\u0442\u043e \u0436\u0435 \u043b\u0443\u0447\u0448\u0435.<\/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\/post\/703246\/\"> https:\/\/habr.com\/ru\/post\/703246\/<\/a><br \/><\/br><\/br><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-342123","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/342123","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=342123"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/342123\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=342123"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=342123"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=342123"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}