{"id":374716,"date":"2024-05-21T06:07:15","date_gmt":"2024-05-21T06:07:15","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=374716"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=374716","title":{"rendered":"<span>\u041a\u0430\u043a \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u0442\u044c \u0438 \u0443\u0441\u0442\u0440\u0430\u043d\u0438\u0442\u044c \u043c\u0443\u043b\u044c\u0442\u0438\u043a\u043e\u043b\u043b\u0438\u043d\u0435\u0430\u0440\u043d\u043e\u0441\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Statsmodels \u0432 \u041f\u0438\u0442\u043e\u043d\u0435<\/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\/73d\/902\/5bb\/73d9025bb9d6ec9e974655702960e296.jpg\" width=\"1280\" height=\"720\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/73d\/902\/5bb\/73d9025bb9d6ec9e974655702960e296.jpg\" data-blurred=\"true\"\/><\/figure>\n<p><strong><em>\u041f\u0440\u0438\u0432\u0435\u0442, \u0425\u0430\u0431\u0440!<\/em><\/strong><\/p>\n<p><strong>\u041c\u0443\u043b\u044c\u0442\u0438\u043a\u043e\u043b\u043b\u0438\u043d\u0435\u0430\u0440\u043d\u043e\u0441\u0442\u044c<\/strong> \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442, \u043a\u043e\u0433\u0434\u0430 \u0432 \u043c\u043e\u0434\u0435\u043b\u0438 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0439 \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u0438 \u043e\u0434\u043d\u0430 \u0438\u0437 \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043b\u0438\u043d\u0435\u0439\u043d\u043e \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u043d\u0430 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0434\u0440\u0443\u0433\u0438\u0445 \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0441 \u0432\u044b\u0441\u043e\u043a\u043e\u0439 \u0441\u0442\u0435\u043f\u0435\u043d\u044c\u044e \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438. \u042d\u0442\u043e \u044f\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a \u0442\u043e\u043c\u0443, \u0447\u0442\u043e <strong>\u0440\u0430\u0441\u0447\u0435\u0442\u043d\u044b\u0435 \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u044b \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u0438 \u0441\u0442\u0430\u043d\u043e\u0432\u044f\u0442\u0441\u044f \u043d\u0435\u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u044b\u043c\u0438 \u0438 \u0438\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043c\u043e\u0433\u0443\u0442 \u0441\u0438\u043b\u044c\u043d\u043e \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c\u0441\u044f \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0438\u043b\u0438 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0434\u0440\u0443\u0433\u0438\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445<\/strong> \u0432 \u043c\u043e\u0434\u0435\u043b\u044c.<\/p>\n<p>\u0412\u044b\u0441\u043e\u043a\u0430\u044f \u043c\u0443\u043b\u044c\u0442\u0438\u043a\u043e\u043b\u043b\u0438\u043d\u0435\u0430\u0440\u043d\u043e\u0441\u0442\u044c \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043a \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u043c\u0443 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044e \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u043e\u0432 \u043f\u0440\u0438 \u043d\u0435\u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f\u0445 \u0432 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u043b\u0438 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u043c\u043e\u0434\u0435\u043b\u0438. \u042d\u0442\u043e \u0443\u0441\u043b\u043e\u0436\u043d\u044f\u0435\u0442 \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0446\u0438\u044e \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u043e\u0432, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043e\u043d\u0438 \u043c\u043e\u0433\u0443\u0442 \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c\u0441\u044f \u043e\u0442 \u043e\u0434\u043d\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u043a \u0434\u0440\u0443\u0433\u043e\u043c\u0443.<\/p>\n<p>\u041a\u043e\u0433\u0434\u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0441\u0438\u043b\u044c\u043d\u043e \u043a\u043e\u0440\u0440\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u044b, \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435 \u043e\u0448\u0438\u0431\u043a\u0438 \u043e\u0446\u0435\u043d\u043e\u043a \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u043e\u0432 \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u044e\u0442\u0441\u044f. \u042d\u0442\u043e \u0432\u0435\u0434\u0435\u0442 \u043a \u0443\u0432\u0435\u043b\u0438\u0447\u0435\u043d\u0438\u044e <em>p<\/em>-\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439, \u0447\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u043e\u0448\u0438\u0431\u043e\u0447\u043d\u043e \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043a \u0437\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044e \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043d\u0435 \u0438\u043c\u0435\u044e\u0442 \u0437\u043d\u0430\u0447\u0438\u043c\u043e\u0433\u043e \u0432\u043b\u0438\u044f\u043d\u0438\u044f \u043d\u0430 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u0443\u044e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e, \u0445\u043e\u0442\u044f \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u044d\u0442\u043e \u043d\u0435 \u0442\u0430\u043a.<\/p>\n<p>\u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043a\u0430\u043a \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u0442\u044c \u0438 \u0443\u0441\u0442\u0440\u0430\u043d\u0438\u0442\u044c \u043c\u0443\u043b\u044c\u0442\u0438\u043a\u043e\u043b\u043b\u0438\u043d\u0435\u0430\u0440\u043d\u043e\u0441\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Statsmodels \u0432 \u041f\u0438\u0442\u043e\u043d\u0435.<\/p>\n<h2>\u041a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442 \u0438\u043d\u0444\u043b\u044f\u0446\u0438\u0438 \u0434\u0438\u0441\u043f\u0435\u0440\u0441\u0438\u0438  <\/h2>\n<p>\u041a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442 \u0438\u043d\u0444\u043b\u044f\u0446\u0438\u0438 \u0434\u0438\u0441\u043f\u0435\u0440\u0441\u0438\u0438 \u0438\u043b\u0438 VIF \u2014 \u044d\u0442\u043e \u043c\u0435\u0440\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u0442\u044c \u0441\u0442\u0435\u043f\u0435\u043d\u044c \u043c\u0443\u043b\u044c\u0442\u0438\u043a\u043e\u043b\u043b\u0438\u043d\u0435\u0430\u0440\u043d\u043e\u0441\u0442\u0438 \u0432 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0439 \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u043e\u043d\u043d\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438. \u041e\u043d \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442, \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0434\u0438\u0441\u043f\u0435\u0440\u0441\u0438\u044f \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u0430 \u043e\u0446\u0435\u043d\u043a\u0438 \u0438\u0437-\u0437\u0430 \u043b\u0438\u043d\u0435\u0439\u043d\u043e\u0439 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u0441 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u043f\u0440\u0435\u0434\u0438\u043a\u0442\u043e\u0440\u0430\u043c\u0438. <\/p>\n<p>\u041a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442 VIF \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 <em>Xj<\/em> \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043a\u0430\u043a:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"formula\" source=\"VIF_j = \\frac{1}{1 - R^2_j}\" alt=\"VIF_j = \\frac{1}{1 - R^2_j}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/d2c\/683\/bb1\/d2c683bb12a3ef5728445fd80c572ed1.svg\" width=\"134\" height=\"52\"\/><\/p>\n<p>\u0433\u0434\u0435 <em>Rj<\/em>2\u200b  \u2014 \u044d\u0442\u043e \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442 \u0434\u0435\u0442\u0435\u0440\u043c\u0438\u043d\u0430\u0446\u0438\u0438 \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 <em>Xj<\/em>\u200b \u043d\u0430 \u0432\u0441\u0435 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0440\u0435\u0434\u0438\u043a\u0442\u043e\u0440\u044b \u0432 \u043c\u043e\u0434\u0435\u043b\u0438. VIF \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u043e\u0442 1 \u0438 \u043c\u043e\u0436\u0435\u0442 \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u043e \u0431\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0441\u0442\u0438. \u0417\u043d\u0430\u0447\u0435\u043d\u0438\u0435 VIF, \u0440\u0430\u0432\u043d\u043e\u0435 1, \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043d\u0430 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u043a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u0438 \u043c\u0435\u0436\u0434\u0443 \u0434\u0430\u043d\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0438 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u043f\u0440\u0435\u0434\u0438\u043a\u0442\u043e\u0440\u0430\u043c\u0438, \u0430 \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0441\u0432\u0438\u0434\u0435\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u0443\u044e\u0442 \u043e \u0441\u0435\u0440\u044c\u0435\u0437\u043d\u043e\u0439 \u043c\u0443\u043b\u044c\u0442\u0438\u043a\u043e\u043b\u043b\u0438\u043d\u0435\u0430\u0440\u043d\u043e\u0441\u0442\u0438.<\/p>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u0442\u044c \u0434\u0430\u0442\u0430\u0444\u0440\u0435\u0439\u043c \u0441 \u043f\u0440\u0435\u0434\u0438\u043a\u0442\u043e\u0440\u043d\u044b\u043c\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c\u0438. \u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c \u0435\u0441\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u043e \u043f\u0440\u043e\u0434\u0430\u0436\u0430\u0445 \u0441 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c\u0438 \u043f\u0440\u0435\u0434\u0438\u043a\u0442\u043e\u0440\u0430\u043c\u0438:<\/p>\n<pre><code class=\"python\">import pandas as pd import numpy as np  data = pd.DataFrame({     'advertising': np.random.rand(100) * 100,     'price_level': np.random.rand(100) * 10,     'store_design': np.random.rand(100) * 5,     'sales': np.random.rand(100) * 500 })<\/code><\/pre>\n<p>\u0414\u043b\u044f \u0440\u0430\u0441\u0447\u0435\u0442\u0430 VIF \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043f\u0440\u0435\u0434\u0438\u043a\u0442\u043e\u0440\u0430 \u0432 \u043c\u043e\u0434\u0435\u043b\u0438 \u044e\u0437\u0430\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e <code>variance_inflation_factor<\/code> \u0438\u0437 \u043c\u043e\u0434\u0443\u043b\u044f <code>statsmodels.stats.outliers_influence<\/code>.<\/p>\n<pre><code class=\"python\">from statsmodels.stats.outliers_influence import variance_inflation_factor from statsmodels.tools.tools import add_constant  # \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u0430 X = add_constant(data.drop('sales', axis=1))  # \u0440\u0430\u0441\u0447\u0435\u0442 VIF \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043f\u0440\u0435\u0434\u0438\u043a\u0442\u043e\u0440\u0430 VIFs = pd.DataFrame() VIFs['Variable'] = X.columns VIFs['VIF'] = [variance_inflation_factor(X.values, i) for i in range(X.shape[1])] print(VIFs)<\/code><\/pre>\n<p>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c \u0431\u0443\u0434\u0435\u0442 DataFrame \u0441 VIF \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439. <\/p>\n<pre><code class=\"yaml\">       Variable       VIF 0         const  7.894204 1   advertising  1.035176 2   price_level  1.024471 3  store_design  1.035239<\/code><\/pre>\n<p>\u0412\u044b\u0441\u043e\u043a\u0438\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f VIF \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442 \u043d\u0430 \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0441 \u043c\u0443\u043b\u044c\u0442\u0438\u043a\u043e\u043b\u043b\u0438\u043d\u0435\u0430\u0440\u043d\u043e\u0441\u0442\u044c\u044e. \u041a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u043e, \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 VIF \u0432\u044b\u0448\u0435 5 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u044f, \u0430 \u0432\u044b\u0448\u0435 10 \u2014 \u0441\u0435\u0440\u044c\u0435\u0437\u043d\u043e\u0433\u043e \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u0438\u044f \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u0432 \u043c\u043e\u0434\u0435\u043b\u0438.<\/p>\n<h2>\u041c\u0435\u0442\u043e\u0434\u044b \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043c\u0443\u043b\u044c\u0442\u0438\u043a\u043e\u043b\u043b\u0438\u043d\u0435\u0430\u0440\u043d\u043e\u0441\u0442\u0438  <\/h2>\n<p>\u041e\u0434\u0438\u043d \u0438\u0437 \u0441\u0430\u043c\u044b\u0445 \u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432 \u0431\u043e\u0440\u044c\u0431\u044b \u0441 \u043c\u0443\u043b\u044c\u0442\u0438\u043a\u043e\u043b\u043b\u0438\u043d\u0435\u0430\u0440\u043d\u043e\u0441\u0442\u044c\u044e \u2014 <strong>\u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445,<\/strong> \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u0438\u043b\u044c\u043d\u043e \u043a\u043e\u0440\u0440\u0435\u043b\u0438\u0440\u0443\u044e\u0442 \u0441 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u043f\u0440\u0435\u0434\u0438\u043a\u0442\u043e\u0440\u0430\u043c\u0438. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0432\u0435\u0441\u0442\u0438 \u0430\u043d\u0430\u043b\u0438\u0437 \u043a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u043c\u0430\u0442\u0440\u0438\u0446\u044b \u0438\u043b\u0438 \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u043e\u0432 VIF.<\/p>\n<pre><code class=\"python\">import pandas as pd from statsmodels.stats.outliers_influence import variance_inflation_factor  def calculate_vif(data):     vif_data = pd.DataFrame()     vif_data[\"feature\"] = data.columns     vif_data[\"VIF\"] = [variance_inflation_factor(data.values, i) for i in range(data.shape[1])]     return vif_data  # \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u043c, data \u2014 \u044d\u0442\u043e DataFrame \u0441 \u043f\u0440\u0435\u0434\u0438\u043a\u0442\u043e\u0440\u0430\u043c\u0438 vif_info = calculate_vif(data) high_vif = vif_info[vif_info['VIF'] > 10]  # \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0435 \u043f\u043e\u0440\u043e\u0433, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 10 data = data.drop(columns=high_vif['feature'])<\/code><\/pre>\n<p><strong>PLS<\/strong> \u2014 \u044d\u0442\u043e \u043c\u0435\u0442\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043e\u043a\u0440\u0430\u0449\u0430\u0435\u0442 \u0440\u0430\u0437\u043c\u0435\u0440\u043d\u043e\u0441\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0445, \u043f\u0440\u043e\u0435\u0446\u0438\u0440\u0443\u044f \u043f\u0440\u0435\u0434\u0438\u043a\u0442\u043e\u0440\u044b \u043d\u0430 \u043c\u0435\u043d\u044c\u0448\u0435\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u0439, \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0441\u0442\u0430\u0440\u0430\u044f\u0441\u044c \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0442\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0441\u0438\u043b\u044c\u043d\u043e \u043a\u043e\u0440\u0440\u0435\u043b\u0438\u0440\u0443\u044e\u0442 \u0441 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439. \u042d\u0442\u043e\u0442 \u043c\u0435\u0442\u043e\u0434 \u0445\u043e\u0440\u043e\u0448, \u043a\u043e\u0433\u0434\u0430 \u043f\u0440\u0435\u0434\u0438\u043a\u0442\u043e\u0440\u044b \u0432\u044b\u0441\u043e\u043a\u043e\u043a\u043e\u0440\u0440\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u044b. \u041f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<pre><code class=\"python\">from sklearn.cross_decomposition import PLSRegression from sklearn.datasets import make_regression  X, y = make_regression(n_samples=1000, n_features=10, noise=0.1) pls = PLSRegression(n_components=3) pls.fit(X, y)<\/code><\/pre>\n<p><strong>LASSO<\/strong> \u0438 <strong>Ridge<\/strong> \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043c\u0435\u0442\u043e\u0434\u0430\u043c\u0438 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u0438\u0437\u0430\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u0432\u043e\u0434\u044f\u0442 \u0448\u0442\u0440\u0430\u0444 \u0437\u0430 \u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u044b \u0432 \u043c\u043e\u0434\u0435\u043b\u0438. LASSO \u043c\u043e\u0436\u0435\u0442 \u043e\u0431\u043d\u0443\u043b\u044f\u0442\u044c \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u044b, \u0432 \u0442\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u0430\u043a Ridge \u0443\u043c\u0435\u043d\u044c\u0448\u0430\u0435\u0442 \u0438\u0445 \u0430\u043c\u043f\u043b\u0438\u0442\u0443\u0434\u0443, \u043d\u043e \u0440\u0435\u0434\u043a\u043e \u0434\u0435\u043b\u0430\u0435\u0442 \u0440\u0430\u0432\u043d\u044b\u043c\u0438 \u043d\u0443\u043b\u044e:<\/p>\n<pre><code class=\"python\">from sklearn.linear_model import Lasso, Ridge  # LASSO \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u044f lasso = Lasso(alpha=0.1) lasso.fit(X, y) print(\"LASSO Coefficients:\", lasso.coef_)  # Ridge \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u044f ridge = Ridge(alpha=1.0) ridge.fit(X, y) print(\"Ridge Coefficients:\", ridge.coef_)<\/code><\/pre>\n<p><code>alpha<\/code> \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0438\u0440\u0443\u0435\u0442 \u0441\u0438\u043b\u0443 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u0438\u0437\u0430\u0446\u0438\u0438. \u041f\u043e\u0434\u0431\u043e\u0440 \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f <code>alpha<\/code> \u0447\u0430\u0441\u0442\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u0440\u043e\u0441\u0441-\u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438.<\/p>\n<p>\u0418\u043d\u043e\u0433\u0434\u0430 \u0443\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u043c\u0443\u043b\u044c\u0442\u0438\u043a\u043e\u043b\u043b\u0438\u043d\u0435\u0430\u0440\u043d\u043e\u0441\u0442\u0438 \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0441\u0442\u0438\u0433\u043d\u0443\u0442\u044c \u043f\u0443\u0442\u0435\u043c \u0432\u044b\u0431\u043e\u0440\u0430 \u043f\u043e\u0434\u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445, \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u043d\u0430 \u0438\u0445 \u0437\u043d\u0430\u0447\u0438\u043c\u043e\u0441\u0442\u0438 \u0438\u043b\u0438 \u0432\u043a\u043b\u0430\u0434\u0435 \u0432 \u043e\u0431\u044a\u044f\u0441\u043d\u0435\u043d\u0438\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439. \u042d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u043e\u0442\u0431\u043e\u0440\u0430 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432, \u0442\u0430\u043a\u0438\u0445 \u043a\u0430\u043a stepwise regression, \u0433\u0434\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0438\u043b\u0438 \u0443\u0434\u0430\u043b\u044f\u044e\u0442\u0441\u044f \u0438\u0437 \u043c\u043e\u0434\u0435\u043b\u0438 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0438\u0445 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0437\u043d\u0430\u0447\u0438\u043c\u043e\u0441\u0442\u0438:<\/p>\n<pre><code class=\"python\">import statsmodels.api as sm  def forward_selection(data, response):     remaining = set(data.columns)     remaining.remove(response)     selected = []     current_score, best_new_score = 0.0, 0.0     while remaining and current_score == best_new_score:         scores_with_candidates = []         for candidate in remaining:             formula = \"{} ~ {}\".format(response, ' + '.join(selected + [candidate]))             score = sm.OLS.from_formula(formula, data).fit().aic             scores_with_candidates.append((score, candidate))         scores_with_candidates.sort()         best_new_score, best_candidate = scores_with_candidates.pop(0)         if current_score > best_new_score:             remaining.remove(best_candidate)             selected.append(best_candidate)             current_score = best_new_score     formula = \"{} ~ {}\".format(response, ' + '.join(selected))     model = sm.OLS.from_formula(formula, data).fit()     return model  model = forward_selection(data, 'dependent_variable')<\/code><\/pre>\n<hr\/>\n<p><em>\u0412\u0430\u0436\u043d\u043e \u0432\u0441\u0435\u0433\u0434\u0430 \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c \u043c\u0443\u043b\u044c\u0442\u0438\u043a\u043e\u043b\u043b\u0438\u043d\u0435\u0430\u0440\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u0438 \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0446\u0438\u0438 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u043e\u043d\u043d\u044b\u0445 \u0430\u043d\u0430\u043b\u0438\u0437\u043e\u0432.<\/em><\/p>\n<p>\u0410 \u043f\u0440\u043e \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u043e\u043d\u043d\u044b\u0439 \u0430\u043d\u0430\u043b\u0438\u0437 \u0438 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0443\u0437\u043d\u0430\u0442\u044c \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043e\u043d\u043b\u0430\u0439\u043d-\u043a\u0443\u0440\u0441\u043e\u0432 \u043f\u043e \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u043c\u0443 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044e \u0438 Data Science. \u0423 \u043a\u043e\u043b\u043b\u0435\u0433 \u0438\u0437 OTUS \u0435\u0441\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0430\u044f \u043b\u0438\u043d\u0435\u0439\u043a\u0430 \u043a\u0443\u0440\u0441\u043e\u0432 \u043f\u043e \u0434\u0430\u043d\u043d\u044b\u043c \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f\u043c. <a href=\"https:\/\/otus.pw\/qe9S\/\">\u041f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u0442\u0435 \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433 \u0438 \u0443\u0431\u0435\u0434\u0438\u0442\u0435\u0441\u044c \u0441\u0430\u043c\u0438<\/a>.<\/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\/810453\/\"> https:\/\/habr.com\/ru\/articles\/810453\/<\/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\"><\/figure>\n<p><strong><em>\u041f\u0440\u0438\u0432\u0435\u0442, \u0425\u0430\u0431\u0440!<\/em><\/strong><\/p>\n<p><strong>\u041c\u0443\u043b\u044c\u0442\u0438\u043a\u043e\u043b\u043b\u0438\u043d\u0435\u0430\u0440\u043d\u043e\u0441\u0442\u044c<\/strong> \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442, \u043a\u043e\u0433\u0434\u0430 \u0432 \u043c\u043e\u0434\u0435\u043b\u0438 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0439 \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u0438 \u043e\u0434\u043d\u0430 \u0438\u0437 \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043b\u0438\u043d\u0435\u0439\u043d\u043e \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u043d\u0430 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0434\u0440\u0443\u0433\u0438\u0445 \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0441 \u0432\u044b\u0441\u043e\u043a\u043e\u0439 \u0441\u0442\u0435\u043f\u0435\u043d\u044c\u044e \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438. \u042d\u0442\u043e \u044f\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a \u0442\u043e\u043c\u0443, \u0447\u0442\u043e <strong>\u0440\u0430\u0441\u0447\u0435\u0442\u043d\u044b\u0435 \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u044b \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u0438 \u0441\u0442\u0430\u043d\u043e\u0432\u044f\u0442\u0441\u044f \u043d\u0435\u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u044b\u043c\u0438 \u0438 \u0438\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043c\u043e\u0433\u0443\u0442 \u0441\u0438\u043b\u044c\u043d\u043e \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c\u0441\u044f \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0438\u043b\u0438 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0434\u0440\u0443\u0433\u0438\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445<\/strong> \u0432 \u043c\u043e\u0434\u0435\u043b\u044c.<\/p>\n<p>\u0412\u044b\u0441\u043e\u043a\u0430\u044f \u043c\u0443\u043b\u044c\u0442\u0438\u043a\u043e\u043b\u043b\u0438\u043d\u0435\u0430\u0440\u043d\u043e\u0441\u0442\u044c \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043a \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u043c\u0443 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044e \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u043e\u0432 \u043f\u0440\u0438 \u043d\u0435\u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f\u0445 \u0432 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u043b\u0438 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u043c\u043e\u0434\u0435\u043b\u0438. \u042d\u0442\u043e \u0443\u0441\u043b\u043e\u0436\u043d\u044f\u0435\u0442 \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0446\u0438\u044e \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u043e\u0432, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043e\u043d\u0438 \u043c\u043e\u0433\u0443\u0442 \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c\u0441\u044f \u043e\u0442 \u043e\u0434\u043d\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u043a \u0434\u0440\u0443\u0433\u043e\u043c\u0443.<\/p>\n<p>\u041a\u043e\u0433\u0434\u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0441\u0438\u043b\u044c\u043d\u043e \u043a\u043e\u0440\u0440\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u044b, \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435 \u043e\u0448\u0438\u0431\u043a\u0438 \u043e\u0446\u0435\u043d\u043e\u043a \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u043e\u0432 \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u044e\u0442\u0441\u044f. \u042d\u0442\u043e \u0432\u0435\u0434\u0435\u0442 \u043a \u0443\u0432\u0435\u043b\u0438\u0447\u0435\u043d\u0438\u044e <em>p<\/em>-\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439, \u0447\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u043e\u0448\u0438\u0431\u043e\u0447\u043d\u043e \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043a \u0437\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044e \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043d\u0435 \u0438\u043c\u0435\u044e\u0442 \u0437\u043d\u0430\u0447\u0438\u043c\u043e\u0433\u043e \u0432\u043b\u0438\u044f\u043d\u0438\u044f \u043d\u0430 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u0443\u044e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e, \u0445\u043e\u0442\u044f \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u044d\u0442\u043e \u043d\u0435 \u0442\u0430\u043a.<\/p>\n<p>\u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043a\u0430\u043a \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u0442\u044c \u0438 \u0443\u0441\u0442\u0440\u0430\u043d\u0438\u0442\u044c \u043c\u0443\u043b\u044c\u0442\u0438\u043a\u043e\u043b\u043b\u0438\u043d\u0435\u0430\u0440\u043d\u043e\u0441\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Statsmodels \u0432 \u041f\u0438\u0442\u043e\u043d\u0435.<\/p>\n<h2>\u041a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442 \u0438\u043d\u0444\u043b\u044f\u0446\u0438\u0438 \u0434\u0438\u0441\u043f\u0435\u0440\u0441\u0438\u0438  <\/h2>\n<p>\u041a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442 \u0438\u043d\u0444\u043b\u044f\u0446\u0438\u0438 \u0434\u0438\u0441\u043f\u0435\u0440\u0441\u0438\u0438 \u0438\u043b\u0438 VIF \u2014 \u044d\u0442\u043e \u043c\u0435\u0440\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u0442\u044c \u0441\u0442\u0435\u043f\u0435\u043d\u044c \u043c\u0443\u043b\u044c\u0442\u0438\u043a\u043e\u043b\u043b\u0438\u043d\u0435\u0430\u0440\u043d\u043e\u0441\u0442\u0438 \u0432 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0439 \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u043e\u043d\u043d\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438. \u041e\u043d \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442, \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0434\u0438\u0441\u043f\u0435\u0440\u0441\u0438\u044f \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u0430 \u043e\u0446\u0435\u043d\u043a\u0438 \u0438\u0437-\u0437\u0430 \u043b\u0438\u043d\u0435\u0439\u043d\u043e\u0439 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u0441 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u043f\u0440\u0435\u0434\u0438\u043a\u0442\u043e\u0440\u0430\u043c\u0438. <\/p>\n<p>\u041a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442 VIF \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 <em>Xj<\/em> \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043a\u0430\u043a:<\/p>\n<p>\u0433\u0434\u0435 <em>Rj<\/em>2\u200b  \u2014 \u044d\u0442\u043e \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442 \u0434\u0435\u0442\u0435\u0440\u043c\u0438\u043d\u0430\u0446\u0438\u0438 \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 <em>Xj<\/em>\u200b \u043d\u0430 \u0432\u0441\u0435 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0440\u0435\u0434\u0438\u043a\u0442\u043e\u0440\u044b \u0432 \u043c\u043e\u0434\u0435\u043b\u0438. VIF \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u043e\u0442 1 \u0438 \u043c\u043e\u0436\u0435\u0442 \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u043e \u0431\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0441\u0442\u0438. \u0417\u043d\u0430\u0447\u0435\u043d\u0438\u0435 VIF, \u0440\u0430\u0432\u043d\u043e\u0435 1, \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043d\u0430 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u043a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u0438 \u043c\u0435\u0436\u0434\u0443 \u0434\u0430\u043d\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0438 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u043f\u0440\u0435\u0434\u0438\u043a\u0442\u043e\u0440\u0430\u043c\u0438, \u0430 \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0441\u0432\u0438\u0434\u0435\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u0443\u044e\u0442 \u043e \u0441\u0435\u0440\u044c\u0435\u0437\u043d\u043e\u0439 \u043c\u0443\u043b\u044c\u0442\u0438\u043a\u043e\u043b\u043b\u0438\u043d\u0435\u0430\u0440\u043d\u043e\u0441\u0442\u0438.<\/p>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u0442\u044c \u0434\u0430\u0442\u0430\u0444\u0440\u0435\u0439\u043c \u0441 \u043f\u0440\u0435\u0434\u0438\u043a\u0442\u043e\u0440\u043d\u044b\u043c\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c\u0438. \u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c \u0435\u0441\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u043e \u043f\u0440\u043e\u0434\u0430\u0436\u0430\u0445 \u0441 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c\u0438 \u043f\u0440\u0435\u0434\u0438\u043a\u0442\u043e\u0440\u0430\u043c\u0438:<\/p>\n<pre><code class=\"python\">import pandas as pd import numpy as np  data = pd.DataFrame({     'advertising': np.random.rand(100) * 100,     'price_level': np.random.rand(100) * 10,     'store_design': np.random.rand(100) * 5,     'sales': np.random.rand(100) * 500 })<\/code><\/pre>\n<p>\u0414\u043b\u044f \u0440\u0430\u0441\u0447\u0435\u0442\u0430 VIF \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043f\u0440\u0435\u0434\u0438\u043a\u0442\u043e\u0440\u0430 \u0432 \u043c\u043e\u0434\u0435\u043b\u0438 \u044e\u0437\u0430\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e <code>variance_inflation_factor<\/code> \u0438\u0437 \u043c\u043e\u0434\u0443\u043b\u044f <code>statsmodels.stats.outliers_influence<\/code>.<\/p>\n<pre><code class=\"python\">from statsmodels.stats.outliers_influence import variance_inflation_factor from statsmodels.tools.tools import add_constant  # \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u0430 X = add_constant(data.drop('sales', axis=1))  # \u0440\u0430\u0441\u0447\u0435\u0442 VIF \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043f\u0440\u0435\u0434\u0438\u043a\u0442\u043e\u0440\u0430 VIFs = pd.DataFrame() VIFs['Variable'] = X.columns VIFs['VIF'] = [variance_inflation_factor(X.values, i) for i in range(X.shape[1])] print(VIFs)<\/code><\/pre>\n<p>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c \u0431\u0443\u0434\u0435\u0442 DataFrame \u0441 VIF \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439. <\/p>\n<pre><code class=\"yaml\">       Variable       VIF 0         const  7.894204 1   advertising  1.035176 2   price_level  1.024471 3  store_design  1.035239<\/code><\/pre>\n<p>\u0412\u044b\u0441\u043e\u043a\u0438\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f VIF \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442 \u043d\u0430 \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0441 \u043c\u0443\u043b\u044c\u0442\u0438\u043a\u043e\u043b\u043b\u0438\u043d\u0435\u0430\u0440\u043d\u043e\u0441\u0442\u044c\u044e. \u041a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u043e, \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 VIF \u0432\u044b\u0448\u0435 5 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u044f, \u0430 \u0432\u044b\u0448\u0435 10 \u2014 \u0441\u0435\u0440\u044c\u0435\u0437\u043d\u043e\u0433\u043e \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u0438\u044f \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u0432 \u043c\u043e\u0434\u0435\u043b\u0438.<\/p>\n<h2>\u041c\u0435\u0442\u043e\u0434\u044b \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043c\u0443\u043b\u044c\u0442\u0438\u043a\u043e\u043b\u043b\u0438\u043d\u0435\u0430\u0440\u043d\u043e\u0441\u0442\u0438  <\/h2>\n<p>\u041e\u0434\u0438\u043d \u0438\u0437 \u0441\u0430\u043c\u044b\u0445 \u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432 \u0431\u043e\u0440\u044c\u0431\u044b \u0441 \u043c\u0443\u043b\u044c\u0442\u0438\u043a\u043e\u043b\u043b\u0438\u043d\u0435\u0430\u0440\u043d\u043e\u0441\u0442\u044c\u044e \u2014 <strong>\u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445,<\/strong> \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u0438\u043b\u044c\u043d\u043e \u043a\u043e\u0440\u0440\u0435\u043b\u0438\u0440\u0443\u044e\u0442 \u0441 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u043f\u0440\u0435\u0434\u0438\u043a\u0442\u043e\u0440\u0430\u043c\u0438. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0432\u0435\u0441\u0442\u0438 \u0430\u043d\u0430\u043b\u0438\u0437 \u043a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u043c\u0430\u0442\u0440\u0438\u0446\u044b \u0438\u043b\u0438 \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u043e\u0432 VIF.<\/p>\n<pre><code class=\"python\">import pandas as pd from statsmodels.stats.outliers_influence import variance_inflation_factor  def calculate_vif(data):     vif_data = pd.DataFrame()     vif_data[\"feature\"] = data.columns     vif_data[\"VIF\"] = [variance_inflation_factor(data.values, i) for i in range(data.shape[1])]     return vif_data  # \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u043c, data \u2014 \u044d\u0442\u043e DataFrame \u0441 \u043f\u0440\u0435\u0434\u0438\u043a\u0442\u043e\u0440\u0430\u043c\u0438 vif_info = calculate_vif(data) high_vif = vif_info[vif_info['VIF'] > 10]  # \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0435 \u043f\u043e\u0440\u043e\u0433, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 10 data = data.drop(columns=high_vif['feature'])<\/code><\/pre>\n<p><strong>PLS<\/strong> \u2014 \u044d\u0442\u043e \u043c\u0435\u0442\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043e\u043a\u0440\u0430\u0449\u0430\u0435\u0442 \u0440\u0430\u0437\u043c\u0435\u0440\u043d\u043e\u0441\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0445, \u043f\u0440\u043e\u0435\u0446\u0438\u0440\u0443\u044f \u043f\u0440\u0435\u0434\u0438\u043a\u0442\u043e\u0440\u044b \u043d\u0430 \u043c\u0435\u043d\u044c\u0448\u0435\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u0439, \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0441\u0442\u0430\u0440\u0430\u044f\u0441\u044c \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0442\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0441\u0438\u043b\u044c\u043d\u043e \u043a\u043e\u0440\u0440\u0435\u043b\u0438\u0440\u0443\u044e\u0442 \u0441 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439. \u042d\u0442\u043e\u0442 \u043c\u0435\u0442\u043e\u0434 \u0445\u043e\u0440\u043e\u0448, \u043a\u043e\u0433\u0434\u0430 \u043f\u0440\u0435\u0434\u0438\u043a\u0442\u043e\u0440\u044b \u0432\u044b\u0441\u043e\u043a\u043e\u043a\u043e\u0440\u0440\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u044b. \u041f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<pre><code class=\"python\">from sklearn.cross_decomposition import PLSRegression from sklearn.datasets import make_regression  X, y = make_regression(n_samples=1000, n_features=10, noise=0.1) pls = PLSRegression(n_components=3) pls.fit(X, y)<\/code><\/pre>\n<p><strong>LASSO<\/strong> \u0438 <strong>Ridge<\/strong> \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043c\u0435\u0442\u043e\u0434\u0430\u043c\u0438 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u0438\u0437\u0430\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u0432\u043e\u0434\u044f\u0442 \u0448\u0442\u0440\u0430\u0444 \u0437\u0430 \u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u044b \u0432 \u043c\u043e\u0434\u0435\u043b\u0438. LASSO \u043c\u043e\u0436\u0435\u0442 \u043e\u0431\u043d\u0443\u043b\u044f\u0442\u044c \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u044b, \u0432 \u0442\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u0430\u043a Ridge \u0443\u043c\u0435\u043d\u044c\u0448\u0430\u0435\u0442 \u0438\u0445 \u0430\u043c\u043f\u043b\u0438\u0442\u0443\u0434\u0443, \u043d\u043e \u0440\u0435\u0434\u043a\u043e \u0434\u0435\u043b\u0430\u0435\u0442 \u0440\u0430\u0432\u043d\u044b\u043c\u0438 \u043d\u0443\u043b\u044e:<\/p>\n<pre><code class=\"python\">from sklearn.linear_model import Lasso, Ridge  # LASSO \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u044f lasso = Lasso(alpha=0.1) lasso.fit(X, y) print(\"LASSO Coefficients:\", lasso.coef_)  # Ridge \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u044f ridge = Ridge(alpha=1.0) ridge.fit(X, y) print(\"Ridge Coefficients:\", ridge.coef_)<\/code><\/pre>\n<p><code>alpha<\/code> \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0438\u0440\u0443\u0435\u0442 \u0441\u0438\u043b\u0443 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u0438\u0437\u0430\u0446\u0438\u0438. \u041f\u043e\u0434\u0431\u043e\u0440 \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f <code>alpha<\/code> \u0447\u0430\u0441\u0442\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u0440\u043e\u0441\u0441-\u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438.<\/p>\n<p>\u0418\u043d\u043e\u0433\u0434\u0430 \u0443\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u043c\u0443\u043b\u044c\u0442\u0438\u043a\u043e\u043b\u043b\u0438\u043d\u0435\u0430\u0440\u043d\u043e\u0441\u0442\u0438 \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0441\u0442\u0438\u0433\u043d\u0443\u0442\u044c \u043f\u0443\u0442\u0435\u043c \u0432\u044b\u0431\u043e\u0440\u0430 \u043f\u043e\u0434\u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445, \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u043d\u0430 \u0438\u0445 \u0437\u043d\u0430\u0447\u0438\u043c\u043e\u0441\u0442\u0438 \u0438\u043b\u0438 \u0432\u043a\u043b\u0430\u0434\u0435 \u0432 \u043e\u0431\u044a\u044f\u0441\u043d\u0435\u043d\u0438\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439. \u042d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u043e\u0442\u0431\u043e\u0440\u0430 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432, \u0442\u0430\u043a\u0438\u0445 \u043a\u0430\u043a stepwise regression, \u0433\u0434\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0438\u043b\u0438 \u0443\u0434\u0430\u043b\u044f\u044e\u0442\u0441\u044f \u0438\u0437 \u043c\u043e\u0434\u0435\u043b\u0438 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0438\u0445 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0437\u043d\u0430\u0447\u0438\u043c\u043e\u0441\u0442\u0438:<\/p>\n<pre><code class=\"python\">import statsmodels.api as sm  def forward_selection(data, response):     remaining = set(data.columns)     remaining.remove(response)     selected = []     current_score, best_new_score = 0.0, 0.0     while remaining and current_score == best_new_score:         scores_with_candidates = []         for candidate in remaining:             formula = \"{} ~ {}\".format(response, ' + '.join(selected + [candidate]))             score = sm.OLS.from_formula(formula, data).fit().aic             scores_with_candidates.append((score, candidate))         scores_with_candidates.sort()         best_new_score, best_candidate = scores_with_candidates.pop(0)         if current_score > best_new_score:             remaining.remove(best_candidate)             selected.append(best_candidate)             current_score = best_new_score     formula = \"{} ~ {}\".format(response, ' + '.join(selected))     model = sm.OLS.from_formula(formula, data).fit()     return model  model = forward_selection(data, 'dependent_variable')<\/code><\/pre>\n<hr\/>\n<p><em>\u0412\u0430\u0436\u043d\u043e \u0432\u0441\u0435\u0433\u0434\u0430 \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c \u043c\u0443\u043b\u044c\u0442\u0438\u043a\u043e\u043b\u043b\u0438\u043d\u0435\u0430\u0440\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u0438 \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0446\u0438\u0438 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u043e\u043d\u043d\u044b\u0445 \u0430\u043d\u0430\u043b\u0438\u0437\u043e\u0432.<\/em><\/p>\n<p>\u0410 \u043f\u0440\u043e \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u043e\u043d\u043d\u044b\u0439 \u0430\u043d\u0430\u043b\u0438\u0437 \u0438 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0443\u0437\u043d\u0430\u0442\u044c \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043e\u043d\u043b\u0430\u0439\u043d-\u043a\u0443\u0440\u0441\u043e\u0432 \u043f\u043e \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u043c\u0443 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044e \u0438 Data Science. \u0423 \u043a\u043e\u043b\u043b\u0435\u0433 \u0438\u0437 OTUS \u0435\u0441\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0430\u044f \u043b\u0438\u043d\u0435\u0439\u043a\u0430 \u043a\u0443\u0440\u0441\u043e\u0432 \u043f\u043e \u0434\u0430\u043d\u043d\u044b\u043c \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f\u043c. <a href=\"https:\/\/otus.pw\/qe9S\/\">\u041f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u0442\u0435 \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433 \u0438 \u0443\u0431\u0435\u0434\u0438\u0442\u0435\u0441\u044c \u0441\u0430\u043c\u0438<\/a>.<\/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\/810453\/\"> https:\/\/habr.com\/ru\/articles\/810453\/<\/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-374716","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/374716","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=374716"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/374716\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=374716"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=374716"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=374716"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}