{"id":341780,"date":"2022-11-26T21:00:11","date_gmt":"2022-11-26T21:00:11","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=341780"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=341780","title":{"rendered":"<span>\u041b\u043e\u0433\u0438\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u044f \u043d\u0430 Python<\/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-1\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p><a href=\"https:\/\/habr.com\/ru\/company\/skillfactory\/blog\/701530\/\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/98\/ym\/-5\/98ym-5k0yh6ahxydtzfr1_f1rvw.png\" data-src=\"https:\/\/habrastorage.org\/webt\/98\/ym\/-5\/98ym-5k0yh6ahxydtzfr1_f1rvw.png\"\/><\/a><\/p>\n<p>  <\/p>\n<p>\u041b\u043e\u0433\u0438\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u044f \u2014 \u044d\u0442\u043e \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0432 \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u043c \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0438 \u0434\u043b\u044f \u043f\u0440\u043e\u0433\u043d\u043e\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0438 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0430\u043b\u044c\u043d\u043e \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439. \u0412 \u043b\u043e\u0433\u0438\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u2014 \u044d\u0442\u043e \u0434\u0432\u043e\u0438\u0447\u043d\u044b\u0435 (\u0431\u0438\u043d\u0430\u0440\u043d\u044b\u0435) \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0435 1 (\u0434\u0430, \u0443\u0441\u043f\u0435\u0445, \u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435) \u0438\u043b\u0438 0 \u2014 \u043d\u0435\u0442, \u043d\u0435\u0443\u0434\u0430\u0447\u0430, \u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435. \u0414\u0440\u0443\u0433\u0438\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438, \u043b\u043e\u0433\u0438\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u044f \u043f\u0440\u043e\u0433\u043d\u043e\u0437\u0438\u0440\u0443\u0435\u0442 P(Y=1) \u043a\u0430\u043a \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043e\u0442 X. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u044b\u0439 \u0438 \u044f\u0441\u043d\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u2014 \u043a <u><a href=\"https:\/\/skillfactory.ru\/data-scientist-pro?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=data-science_dspr_261122&amp;utm_term=lead\">\u0441\u0442\u0430\u0440\u0442\u0443 \u043d\u0430\u0448\u0435\u0433\u043e \u0444\u043b\u0430\u0433\u043c\u0430\u043d\u0441\u043a\u043e\u0433\u043e \u043a\u0443\u0440\u0441\u0430 \u043f\u043e Data Science<\/a><\/u>.<\/p>\n<p><a name=\"habracut\"><\/a>  <\/p>\n<p>\u0414\u043e\u043f\u0443\u0449\u0435\u043d\u0438\u044f \u043b\u043e\u0433\u0438\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u0438:<\/p>\n<p>  <\/p>\n<ul>\n<li>\u0414\u0432\u043e\u0438\u0447\u043d\u0430\u044f \u043b\u043e\u0433\u0438\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u044f \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0434\u0432\u043e\u0438\u0447\u043d\u043e\u0439 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439.<\/li>\n<li>\u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u0434\u0432\u043e\u0438\u0447\u043d\u043e\u0439 \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u0438 \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u0444\u0430\u043a\u0442\u043e\u0440\u0430 1 \u0434\u043e\u043b\u0436\u0435\u043d \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u0438\u0437 \u0441\u0435\u0431\u044f \u0436\u0435\u043b\u0430\u0435\u043c\u044b\u0439 \u0438\u0441\u0445\u043e\u0434.<\/li>\n<li>\u0412\u043a\u043b\u044e\u0447\u0435\u043d\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0437\u043d\u0430\u0447\u0438\u043c\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435.<\/li>\n<li>\u041d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b \u0434\u0440\u0443\u0433 \u043e\u0442 \u0434\u0440\u0443\u0433\u0430, \u0442\u043e \u0435\u0441\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u044c \u0434\u043e\u043b\u0436\u043d\u0430 \u043e\u0431\u043b\u0430\u0434\u0430\u0442\u044c \u043c\u0430\u043b\u043e\u0439 \u043c\u0443\u043b\u044c\u0442\u0438\u043a\u043e\u043b\u043b\u0438\u043d\u0435\u0430\u0440\u043d\u043e\u0441\u0442\u044c\u044e \u0438\u043b\u0438 \u043d\u0435 \u043e\u0431\u043b\u0430\u0434\u0430\u0442\u044c \u0435\u044e.<\/li>\n<li>\u0417\u0430\u0432\u0438\u0441\u0438\u043c\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043b\u0438\u043d\u0435\u0439\u043d\u043e \u0441\u0432\u044f\u0437\u0430\u043d\u044b \u0441 \u043b\u043e\u0433\u0430\u0440\u0438\u0444\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u043c\u0438 \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u0430\u043c\u0438.<\/li>\n<li>\u041b\u043e\u0433\u0438\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u044f \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u0432\u044b\u0431\u043e\u0440\u043e\u043a.<\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u00a0\u0418\u043c\u0435\u044f \u0432 \u0432\u0438\u0434\u0443 \u044d\u0442\u0438 \u0434\u043e\u043f\u0443\u0449\u0435\u043d\u0438\u044f, \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u043d\u0430\u0431\u043e\u0440 \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<p>  <\/p>\n<h1 id=\"dannye\">\u0414\u0430\u043d\u043d\u044b\u0435<\/h1>\n<p>  <\/p>\n<p>\u041d\u0430\u0431\u043e\u0440 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437 <a href=\"http:\/\/archive.ics.uci.edu\/ml\/index.php\">\u0440\u0435\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f UCI Machine Learning<\/a> \u0441\u0432\u044f\u0437\u0430\u043d \u0441 \u0446\u0435\u043b\u0435\u0432\u044b\u043c\u0438 \u043c\u0430\u0440\u043a\u0435\u0442\u0438\u043d\u0433\u043e\u0432\u044b\u043c\u0438 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u044f\u043c\u0438 (\u0442\u0435\u043b\u0435\u0444\u043e\u043d\u043d\u044b\u043c\u0438 \u0437\u0432\u043e\u043d\u043a\u0430\u043c\u0438) \u041f\u043e\u0440\u0442\u0443\u0433\u0430\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u0431\u0430\u043d\u043a\u0430. \u0417\u0430\u0434\u0430\u0447\u0430 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u2014 \u0441\u043f\u0440\u043e\u0433\u043d\u043e\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c (0\/1), \u0442\u043e \u0435\u0441\u0442\u044c \u043e\u0442\u043a\u0440\u043e\u0435\u0442 \u043b\u0438 \u043a\u043b\u0438\u0435\u043d\u0442 \u0441\u0440\u043e\u0447\u043d\u044b\u0439 \u0432\u043a\u043b\u0430\u0434 (\u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f y). \u0417\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u043d\u0430\u0431\u043e\u0440 \u043c\u043e\u0436\u043d\u043e <a href=\"https:\/\/www.google.com\/url?q=https:\/\/raw.githubusercontent.com\/madmashup\/targeted-marketing-predictive-engine\/master\/banking.csv&amp;sa=D&amp;source=editors&amp;ust=1669378141321103&amp;usg=AOvVaw3oVrNEFRrV-iLdsf_5mhHE\">\u043e\u0442\u0441\u044e\u0434\u0430<\/a>.<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">import pandas as pd import numpy as np from sklearn import preprocessing import matplotlib.pyplot as plt  plt.rc(\"font\", size=14) from sklearn.linear_model import LogisticRegression from sklearn.model_selection import train_test_split import seaborn as sns sns.set(style=\"white\") sns.set(style=\"whitegrid\", color_codes=True)<\/code><\/pre>\n<p>  <\/p>\n<p>\u041d\u0430\u0431\u043e\u0440 \u043f\u043e\u0441\u0432\u044f\u0449\u0451\u043d \u043a\u043b\u0438\u0435\u043d\u0442\u0430\u043c \u0431\u0430\u043d\u043a\u0430 \u0438 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 41188 \u0437\u0430\u043f\u0438\u0441\u0435\u0439 \u0441 21 \u043f\u043e\u043b\u0435\u043c:<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/zt\/4a\/pg\/zt4apgiubtcrmybjtdigudwh0kk.png\" data-src=\"https:\/\/habrastorage.org\/webt\/zt\/4a\/pg\/zt4apgiubtcrmybjtdigudwh0kk.png\"\/><\/p>\n<p>  <\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u0412\u0445\u043e\u0434\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<ol>\n<li>age: \u0432\u043e\u0437\u0440\u0430\u0441\u0442 (\u0447\u0438\u0441\u043b\u043e\u0432\u0430\u044f);<\/li>\n<li>job: \u0440\u0430\u0431\u043e\u0442\u0430 (\u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0430\u043b\u044c\u043d\u0430\u044f: &#171;admin&#187;, &#171;blue-collar&#187;, &#171;entrepreneur&#187;, &#171;housemaid&#187;, &#171;management&#187;, &#171;retired&#187;, &#171;self-employed&#187;, &#171;services&#187;, &#171;student&#187;, &#171;technician&#187;, &#171;unemployed&#187;, &#171;unknown&#187;);<\/li>\n<li>marital: \u0441\u0435\u043c\u0435\u0439\u043d\u043e\u0435 \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 (\u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0430\u043b\u044c\u043d\u0430\u044f: &#171;divorced&#187;, &#171;married&#187;, &#171;single&#187;, &#171;unknown&#187;);<\/li>\n<li>education: \u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0435 (\u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0430\u043b\u044c\u043d\u0430\u044f: &#171;basic.4y&#187;, &#171;basic.6y&#187;, &#171;basic.9y&#187;, &#171;high.school&#187;, &#171;illiterate&#187;, &#171;professional.course&#187;, &#171;university.degree&#187;, &#171;unknown&#187;);<\/li>\n<li>default: \u0435\u0441\u0442\u044c \u043d\u0435\u0432\u044b\u043f\u043b\u0430\u0447\u0435\u043d\u043d\u044b\u0439 \u043a\u0440\u0435\u0434\u0438\u0442? (\u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0430\u043b\u044c\u043d\u0430\u044f: &#171;no&#187;, &#171;yes&#187;, &#171;unknown&#187;);<\/li>\n<li>housing: \u0435\u0441\u0442\u044c \u0436\u0438\u043b\u0438\u0449\u043d\u044b\u0439 \u043a\u0440\u0435\u0434\u0438\u0442? (\u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0430\u043b\u044c\u043d\u0430\u044f: &#171;no&#187;, &#171;yes&#187;, &#171;unknown&#187;);<\/li>\n<li>loan: \u0435\u0441\u0442\u044c \u043a\u0440\u0435\u0434\u0438\u0442 \u043d\u0430 \u043b\u0438\u0447\u043d\u044b\u0435 \u043d\u0443\u0436\u0434\u044b? (\u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0430\u043b\u044c\u043d\u0430\u044f: &#171;no&#187;, &#171;yes&#187;, &#171;unknown&#187;);<\/li>\n<li>contact: \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u0439 \u0438\u043b\u0438 \u0441\u0442\u0430\u0446\u0438\u043e\u043d\u0430\u0440\u043d\u044b\u0439 \u0442\u0435\u043b\u0435\u0444\u043e\u043d? (\u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0430\u043b\u044c\u043d\u0430\u044f: &#171;cellular&#187;, &#171;telephone&#187;);<\/li>\n<li>month: \u043c\u0435\u0441\u044f\u0446 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0433\u043e \u0437\u0432\u043e\u043d\u043a\u0430 (\u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0430\u043b\u044c\u043d\u0430\u044f: &#171;jan&#187;, &#171;feb&#187;, &#171;mar&#187;, \u2026, &#171;nov&#187;, &#171;dec&#187;);<\/li>\n<li>day_of_week: \u0434\u0435\u043d\u044c \u043d\u0435\u0434\u0435\u043b\u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0433\u043e \u0437\u0432\u043e\u043d\u043a\u0430 (\u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0430\u043b\u044c\u043d\u0430\u044f: &#171;mon&#187;, &#171;tue&#187;, &#171;wed&#187;, &#171;thu&#187;, &#171;fri&#187;);<\/li>\n<li>duration: \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0440\u0430\u0437\u0433\u043e\u0432\u043e\u0440\u0430 \u0432 \u0441\u0435\u043a\u0443\u043d\u0434\u0430\u0445 (\u0447\u0438\u0441\u043b\u043e\u0432\u0430\u044f). \u0412\u0430\u0436\u043d\u043e\u0435 \u043f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435: \u044d\u0442\u043e\u0442 \u0430\u0442\u0440\u0438\u0431\u0443\u0442 \u0441\u0438\u043b\u044c\u043d\u043e \u0432\u043b\u0438\u044f\u0435\u0442 \u043d\u0430 \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0435\u0441\u043b\u0438 duration=0, \u0442\u043e y=\u2019no\u2019); \u041f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043d\u0435 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u0430 \u0434\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0432\u044b\u0437\u043e\u0432\u0430, \u043a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u043f\u043e\u0441\u043b\u0435 \u043e\u043a\u043e\u043d\u0447\u0430\u043d\u0438\u044f \u0432\u044b\u0437\u043e\u0432\u0430 y, \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u043e, \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u0430. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u044d\u0442\u0438 \u0432\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0434\u043e\u043b\u0436\u043d\u044b \u0432\u043a\u043b\u044e\u0447\u0430\u0442\u044c\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f \u0438 \u043e\u0442\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0442\u044c\u0441\u044f, \u043a\u043e\u0433\u0434\u0430 \u043d\u0443\u0436\u043d\u0430 \u0440\u0435\u0430\u043b\u0438\u0441\u0442\u0438\u0447\u043d\u0430\u044f \u043f\u0440\u043e\u0433\u043d\u043e\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u043c\u043e\u0434\u0435\u043b\u044c;<\/li>\n<li>campaign: \u0447\u0438\u0441\u043b\u043e \u043a\u043e\u043d\u0442\u0430\u043a\u0442\u043e\u0432 \u0432 \u0445\u043e\u0434\u0435 \u044d\u0442\u043e\u0439 \u043a\u0430\u043c\u043f\u0430\u043d\u0438\u0438 \u0438 \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043a\u043b\u0438\u0435\u043d\u0442\u0430 (\u0447\u0438\u0441\u043b\u043e\u0432\u0430\u044f), \u0432\u043a\u043b\u044e\u0447\u0430\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u043a\u043e\u043d\u0442\u0430\u043a\u0442);<\/li>\n<li>pdays: \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0434\u043d\u0435\u0439, \u043f\u0440\u043e\u0448\u0435\u0434\u0448\u0438\u0445 \u0441 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0433\u043e \u043a\u043e\u043d\u0442\u0430\u043a\u0442\u0430 \u0441 \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u043c, \u0441 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u043a\u0430\u043c\u043f\u0430\u043d\u0438\u0438 (\u0447\u0438\u0441\u043b\u043e\u0432\u0430\u044f); 999 \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u0440\u0430\u043d\u0435\u0435 \u043a\u043e\u043d\u0442\u0430\u043a\u0442\u0430 \u043d\u0435 \u0431\u044b\u043b\u043e);<\/li>\n<li>previous: \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043a\u043e\u043d\u0442\u0430\u043a\u0442\u043e\u0432 \u0434\u043e \u044d\u0442\u043e\u0439 \u043a\u0430\u043c\u043f\u0430\u043d\u0438\u0438 \u0434\u043b\u044f \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043a\u043b\u0438\u0435\u043d\u0442\u0430 (\u0447\u0438\u0441\u043b\u043e\u0432\u0430\u044f)<\/li>\n<li>poutcome: \u0438\u0441\u0445\u043e\u0434 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u043a\u0430\u043c\u043f\u0430\u043d\u0438\u0438 (\u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0430\u043b\u044c\u043d\u0430\u044f: &#171;failure&#187;, &#171;nonexistent&#187;, &#171;success&#187;)<\/li>\n<li>emp.var.rate: \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442 \u0432\u0430\u0440\u0438\u0430\u0446\u0438\u0438 \u0437\u0430\u043d\u044f\u0442\u043e\u0441\u0442\u0438 \u2014 (\u0447\u0438\u0441\u043b\u043e\u0432\u0430\u044f);<\/li>\n<li>cons.price.idx: \u0438\u043d\u0434\u0435\u043a\u0441 \u043f\u043e\u0442\u0440\u0435\u0431\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0445 \u0446\u0435\u043d \u2014 (\u0447\u0438\u0441\u043b\u043e\u0432\u0430\u044f);<\/li>\n<li>cons.conf.idx: \u0438\u043d\u0434\u0435\u043a\u0441 \u0434\u043e\u0432\u0435\u0440\u0438\u044f \u043f\u043e\u0442\u0440\u0435\u0431\u0438\u0442\u0435\u043b\u0435\u0439 \u2014 (\u0447\u0438\u0441\u043b\u043e\u0432\u0430\u044f);<\/li>\n<li>euribor3m: \u0441\u0442\u0430\u0432\u043a\u0430 EURIBOR \u0437\u0430 3 \u043c\u0435\u0441\u044f\u0446\u0430 \u2014 (\u0447\u0438\u0441\u043b\u043e\u0432\u0430\u044f);<\/li>\n<li>nr.employed: \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0440\u0430\u0431\u043e\u0442\u043d\u0438\u043a\u043e\u0432 \u2014 (\u0447\u0438\u0441\u043b\u043e\u0432\u0430\u044f).<\/li>\n<\/ol>\n<\/div><\/div>\n<p>  <\/p>\n<p>\u041d\u0430\u0448\u0430 \u0446\u0435\u043b\u044c \u2014 \u043f\u0440\u043e\u0433\u043d\u043e\u0437 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 Y, \u0442\u043e \u0435\u0441\u0442\u044c \u0442\u043e\u0433\u043e, \u0435\u0441\u0442\u044c \u043b\u0438 \u0443 \u043a\u043b\u0438\u0435\u043d\u0442\u0430 \u0441\u0440\u043e\u0447\u043d\u044b\u0439 \u0432\u043a\u043b\u0430\u0434? (0 \u2014 \u043d\u0435\u0442, 1 \u2014 \u0434\u0430). <\/p>\n<p>  <\/p>\n<p>\u0423 \u043f\u043e\u043b\u044f \u043e\u0431 \u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0438 (education) \u043c\u043d\u043e\u0433\u043e \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0439. \u0427\u0442\u043e\u0431\u044b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u044c \u043b\u0443\u0447\u0448\u0435, \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u044d\u0442\u0438\u0445 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0439 \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u043a\u0440\u0430\u0442\u0438\u0442\u044c:<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/ee\/fz\/tv\/eefztvl-btwm4itomoukzj3pjqs.png\" data-src=\"https:\/\/habrastorage.org\/webt\/ee\/fz\/tv\/eefztvl-btwm4itomoukzj3pjqs.png\"\/><\/p>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0441\u0433\u0440\u0443\u043f\u043f\u0438\u0440\u0443\u0435\u043c &#171;basic.4y&#187;, &#171;basic.9y&#187; \u0438 &#171;basic.6y&#187;, \u043d\u0430\u0437\u043e\u0432\u0451\u043c \u0438\u0445 &#171;Basic&#187;:<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">data['education']=np.where(data['education'] =='basic.9y', 'Basic', data['education']) data['education']=np.where(data['education'] =='basic.6y', 'Basic', data['education']) data['education']=np.where(data['education'] =='basic.4y', 'Basic', data['education'])<\/code><\/pre>\n<p>  <\/p>\n<p>\u0412\u043e\u0442 \u043f\u043e\u043b\u044f \u043f\u043e\u0441\u043b\u0435 \u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u043a\u0438:<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/4v\/ky\/y2\/4vkyy2wuam6uc7twb06m6chyw_u.png\" data-src=\"https:\/\/habrastorage.org\/webt\/4v\/ky\/y2\/4vkyy2wuam6uc7twb06m6chyw_u.png\"\/><\/p>\n<p>  <\/p>\n<h1 id=\"issledovanie-dannyh\">\u0418\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445<\/h1>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/zp\/7c\/pc\/zp7cpc5qjkcf2ivzxcgx8-lb8ds.png\" data-src=\"https:\/\/habrastorage.org\/webt\/zp\/7c\/pc\/zp7cpc5qjkcf2ivzxcgx8-lb8ds.png\"\/><\/p>\n<p>  <\/p>\n<pre><code class=\"python\">count_no_sub = len(data[data['y']==0]) count_sub = len(data[data['y']==1]) pct_of_no_sub = count_no_sub\/(count_no_sub+count_sub) print(\"percentage of no subscription is\", pct_of_no_sub*100) pct_of_sub = count_sub\/(count_no_sub+count_sub) print(\"percentage of subscription\", pct_of_sub*100)<\/code><\/pre>\n<p>  <\/p>\n<ul>\n<li>\u0431\u0435\u0437 \u0432\u043a\u043b\u0430\u0434\u0430 \u2014 88,73458288821988;<\/li>\n<li>\u0441 \u0432\u043a\u043b\u0430\u0434\u043e\u043c \u2014 11.265417111780131.<\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u041a\u043b\u0430\u0441\u0441\u044b \u043d\u0430\u0448\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0435 \u0441\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u044b, \u0430 \u0441\u043e\u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u0435 \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432 \u0431\u0435\u0437 \u0432\u043a\u043b\u0430\u0434\u0430 \u0438 \u0441 \u0432\u043a\u043b\u0430\u0434\u043e\u043c \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 89 \u043a 11. \u0414\u043e \u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0438 \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u043f\u0440\u043e\u0432\u0435\u0434\u0451\u043c \u0435\u0449\u0451 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0439:<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/rh\/vs\/dr\/rhvsdrhfkcabbuehp_kyhcqugzw.png\" data-src=\"https:\/\/habrastorage.org\/webt\/rh\/vs\/dr\/rhvsdrhfkcabbuehp_kyhcqugzw.png\"\/><\/p>\n<p>  <\/p>\n<p>\u0412\u043e\u0442 \u043d\u043e\u0432\u044b\u0435 \u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u044f:<\/p>\n<p>  <\/p>\n<ul>\n<li>\u0421\u0440\u0435\u0434\u043d\u0438\u0439 \u0432\u043e\u0437\u0440\u0430\u0441\u0442 \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432, \u043e\u0442\u043a\u0440\u044b\u0432\u0448\u0438\u0445 \u0432\u043a\u043b\u0430\u0434, \u0432\u044b\u0448\u0435 \u0441\u0440\u0435\u0434\u043d\u0435\u0433\u043e \u0432\u043e\u0437\u0440\u0430\u0441\u0442\u0430 \u0442\u0435\u0445, \u043a\u0442\u043e \u044d\u0442\u043e\u0433\u043e \u043d\u0435 \u0441\u0434\u0435\u043b\u0430\u043b.<\/li>\n<li>\u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0434\u043d\u0435\u0439 \u0441 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0433\u043e \u043a\u043e\u043d\u0442\u0430\u043a\u0442\u0430 \u0441 \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u043c \u043f\u043e \u043f\u043e\u043d\u044f\u0442\u043d\u044b\u043c \u043f\u0440\u0438\u0447\u0438\u043d\u0430\u043c \u043c\u0435\u043d\u044c\u0448\u0435 \u0443 \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432, \u043e\u0442\u043a\u0440\u044b\u0432\u0448\u0438\u0445 \u0434\u0435\u043f\u043e\u0437\u0438\u0442. \u0410 \u0447\u0435\u043c \u043e\u043d\u0430 \u043c\u0435\u043d\u044c\u0448\u0435, \u0442\u0435\u043c \u043b\u0443\u0447\u0448\u0435 \u0437\u0430\u043f\u043e\u043c\u043d\u0438\u043b\u0441\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u0437\u0432\u043e\u043d\u043e\u043a, \u0430 \u0437\u043d\u0430\u0447\u0438\u0442, \u0432\u044b\u0448\u0435 \u0448\u0430\u043d\u0441 \u043e\u0442\u043a\u0440\u044b\u0442\u0438\u044f \u0441\u0447\u0451\u0442\u0430.<\/li>\n<li>\u0423\u0434\u0438\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e, \u043d\u043e \u043a\u0430\u043c\u043f\u0430\u043d\u0438\u044f, \u0442\u043e \u0435\u0441\u0442\u044c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0437\u0432\u043e\u043d\u043a\u043e\u0432 \u0437\u0430 \u043e\u0434\u043d\u0443 \u043a\u0430\u043c\u043f\u0430\u043d\u0438\u044e, \u043c\u0435\u043d\u044c\u0448\u0435 \u0443 \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0442\u043a\u0440\u044b\u043b\u0438 \u0434\u0435\u043f\u043e\u0437\u0438\u0442.<\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u0447\u0451\u0442\u0447\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435, \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u0430\u0435\u043c \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0430\u043b\u044c\u043d\u043e\u0435 \u0441\u0440\u0435\u0434\u043d\u0435\u0435 \u0434\u0440\u0443\u0433\u0438\u0445 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445, \u0442\u0430\u043a\u0438\u0445 \u043a\u0430\u043a \u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0438\u00a0\u0441\u0435\u043c\u0435\u0439\u043d\u043e\u0435 \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435.<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/ez\/pd\/o-\/ezpdo-0ubyygozw0i-egowjwv-y.png\" data-src=\"https:\/\/habrastorage.org\/webt\/ez\/pd\/o-\/ezpdo-0ubyygozw0i-egowjwv-y.png\"\/><\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/33\/j8\/8y\/33j88ym3dj7f2jwpslnmxrkvp3g.png\" data-src=\"https:\/\/habrastorage.org\/webt\/33\/j8\/8y\/33j88ym3dj7f2jwpslnmxrkvp3g.png\"\/><\/p>\n<p>  <\/p>\n<h1 id=\"vizualizaciya\">\u0412\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f<\/h1>\n<p>  <\/p>\n<pre><code class=\"python\">%matplotlib inline pd.crosstab(data.job,data.y).plot(kind='bar') plt.title('Purchase Frequency for Job Title') plt.xlabel('Job') plt.ylabel('Frequency of Purchase') plt.savefig('purchase_fre_job')<\/code><\/pre>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/-5\/rr\/vr\/-5rrvrqtoxqxkwobcmpunmjet1w.png\" data-src=\"https:\/\/habrastorage.org\/webt\/-5\/rr\/vr\/-5rrvrqtoxqxkwobcmpunmjet1w.png\"\/><\/p>\n<p>  <\/p>\n<p>\u0427\u0430\u0441\u0442\u043e\u0442\u0430 \u043e\u0442\u043a\u0440\u044b\u0442\u0438\u044f \u0434\u0435\u043f\u043e\u0437\u0438\u0442\u0430 \u0432\u043e \u043c\u043d\u043e\u0433\u043e\u043c \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0434\u043e\u043b\u0436\u043d\u043e\u0441\u0442\u0438 \u043a\u043b\u0438\u0435\u043d\u0442\u0430, \u0430 \u0437\u043d\u0430\u0447\u0438\u0442, \u044d\u0442\u0430 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0430\u043b\u044c\u043d\u0430\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u043c\u043e\u0436\u0435\u0442 \u0441\u043b\u0443\u0436\u0438\u0442\u044c \u0445\u043e\u0440\u043e\u0448\u0438\u043c \u0444\u0430\u043a\u0442\u043e\u0440\u043e\u043c \u043f\u0440\u043e\u0433\u043d\u043e\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f.<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">table=pd.crosstab(data.marital,data.y) table.div(table.sum(1).astype(float), axis=0).plot(kind='bar', stacked=True) plt.title('Stacked Bar Chart of Marital Status vs Purchase') plt.xlabel('Marital Status') plt.ylabel('Proportion of Customers') plt.savefig('mariral_vs_pur_stack')<\/code><\/pre>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/zf\/fi\/7w\/zffi7wrucwotr7bhaic1f9iom2y.png\" data-src=\"https:\/\/habrastorage.org\/webt\/zf\/fi\/7w\/zffi7wrucwotr7bhaic1f9iom2y.png\"\/><\/p>\n<p>  <\/p>\n<p>\u0421\u0435\u043c\u0435\u0439\u043d\u043e\u0435 \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0441\u0438\u043b\u044c\u043d\u044b\u043c \u0444\u0430\u043a\u0442\u043e\u0440\u043e\u043c \u043f\u0440\u043e\u0433\u043d\u043e\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043d\u0435 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442:<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">table=pd.crosstab(data.education,data.y) table.div(table.sum(1).astype(float), axis=0).plot(kind='bar', stacked=True) plt.title('Stacked Bar Chart of Education vs Purchase') plt.xlabel('Education') plt.ylabel('Proportion of Customers') plt.savefig('edu_vs_pur_stack')<\/code><\/pre>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/jv\/c0\/ic\/jvc0ic3c1z-2hi2ihbdoqdi30x8.png\" data-src=\"https:\/\/habrastorage.org\/webt\/jv\/c0\/ic\/jvc0ic3c1z-2hi2ihbdoqdi30x8.png\"\/><\/p>\n<p>  <\/p>\n<p>\u0422\u0430\u043a\u0436\u0435 \u0445\u043e\u0440\u043e\u0448\u0438\u043c \u0444\u0430\u043a\u0442\u043e\u0440\u043e\u043c \u043f\u0440\u043e\u0433\u043d\u043e\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u044f \u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f:<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">pd.crosstab(data.day_of_week,data.y).plot(kind='bar') plt.title('Purchase Frequency for Day of Week') plt.xlabel('Day of Week') plt.ylabel('Frequency of Purchase') plt.savefig('pur_dayofweek_bar')<\/code><\/pre>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/qd\/qm\/b_\/qdqmb_6emxvhulv14rc8y0gdoik.png\" data-src=\"https:\/\/habrastorage.org\/webt\/qd\/qm\/b_\/qdqmb_6emxvhulv14rc8y0gdoik.png\"\/><\/p>\n<p>  <\/p>\n<p>\u0410 \u0434\u0435\u043d\u044c \u043d\u0435\u0434\u0435\u043b\u0438 \u2014 \u043d\u0435\u0442:<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">pd.crosstab(data.day_of_week,data.y).plot(kind='bar') plt.title('Purchase Frequency for Day of Week') plt.xlabel('Day of Week') plt.ylabel('Frequency of Purchase') plt.savefig('pur_dayofweek_bar')<\/code><\/pre>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/t4\/9i\/gz\/t49igzie3ppockxzebqj8z9hnrw.png\" data-src=\"https:\/\/habrastorage.org\/webt\/t4\/9i\/gz\/t49igzie3ppockxzebqj8z9hnrw.png\"\/><\/p>\n<p>  <\/p>\n<p>\u0425\u043e\u0440\u043e\u0448\u0438\u043c \u0444\u0430\u043a\u0442\u043e\u0440\u043e\u043c \u043f\u0440\u043e\u0433\u043d\u043e\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043c\u0435\u0441\u044f\u0446:<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">data.age.hist() plt.title('Histogram of Age') plt.xlabel('Age') plt.ylabel('Frequency') plt.savefig('hist_age')<\/code><\/pre>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/ny\/ny\/x7\/nynyx7a64mn-1z1ssmoe35j40ws.png\" data-src=\"https:\/\/habrastorage.org\/webt\/ny\/ny\/x7\/nynyx7a64mn-1z1ssmoe35j40ws.png\"\/><\/p>\n<p>  <\/p>\n<p>\u0411\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0443 \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432 \u0431\u0430\u043d\u043a\u0430 \u0432 \u044d\u0442\u043e\u043c \u043d\u0430\u0431\u043e\u0440\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u043e\u0442 30 \u0434\u043e 40 \u043b\u0435\u0442.<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">pd.crosstab(data.poutcome,data.y).plot(kind='bar') plt.title('Purchase Frequency for Poutcome') plt.xlabel('Poutcome') plt.ylabel('Frequency of Purchase') plt.savefig('pur_fre_pout_bar')<\/code><\/pre>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/dx\/u1\/i0\/dxu1i0qy0_cfmb4gj3ftchkkz4c.png\" data-src=\"https:\/\/habrastorage.org\/webt\/dx\/u1\/i0\/dxu1i0qy0_cfmb4gj3ftchkkz4c.png\"\/><\/p>\n<p>  <\/p>\n<p>\u041d\u0430\u043a\u043e\u043d\u0435\u0446, \u0445\u043e\u0440\u043e\u0448\u0438\u043c \u0444\u0430\u043a\u0442\u043e\u0440\u043e\u043c \u043f\u0440\u043e\u0433\u043d\u043e\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 Poutcome.<\/p>\n<p>  <\/p>\n<h1 id=\"peremennye-zaglushki\">\u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435-\u0437\u0430\u0433\u043b\u0443\u0448\u043a\u0438<\/h1>\n<p>  <\/p>\n<p>\u042d\u0442\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f 0 \u0438 1.<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">cat_vars=['job','marital','education','default','housing','loan','contact','month','day_of_week','poutcome'] for var in cat_vars:     cat_list='var'+'_'+var     cat_list = pd.get_dummies(data[var], prefix=var)     data1=data.join(cat_list)     data=data1 cat_vars=['job','marital','education','default','housing','loan','contact','month','day_of_week','poutcome'] data_vars=data.columns.values.tolist() to_keep=[i for i in data_vars if i not in cat_vars]<\/code><\/pre>\n<p>  <\/p>\n<p>\u0418 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0435 \u043f\u043e\u043b\u044f:<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">data_final=data[to_keep] data_final.columns.values<\/code><\/pre>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/ib\/qv\/l3\/ibqvl33g1q92tx9ml9rxetia7ny.png\" data-src=\"https:\/\/habrastorage.org\/webt\/ib\/qv\/l3\/ibqvl33g1q92tx9ml9rxetia7ny.png\"\/><\/p>\n<p>  <\/p>\n<h1 id=\"obogaschenie-sinteticheskimi-dannymi-cherez-smote\">\u041e\u0431\u043e\u0433\u0430\u0449\u0435\u043d\u0438\u0435 \u0441\u0438\u043d\u0442\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0447\u0435\u0440\u0435\u0437 SMOTE<\/h1>\n<p>  <\/p>\n<p>\u042f \u0443\u0432\u0435\u043b\u0438\u0447\u0443 \u0432\u044b\u0431\u043e\u0440\u043a\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 \u043e \u043a\u043b\u0438\u0435\u043d\u0442\u0430\u0445 \u0431\u0435\u0437 \u0432\u043a\u043b\u0430\u0434\u0430 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 <a href=\"https:\/\/www.google.com\/url?q=https:\/\/arxiv.org\/pdf\/1106.1813.pdf&amp;sa=D&amp;source=editors&amp;ust=1669378141327481&amp;usg=AOvVaw3I6vd-Sr9bVd5ieME19QCJ\">SMOTE<\/a>\u00a0(Synthetic Minority Oversampling Technique). \u041d\u0430 \u0432\u044b\u0441\u043e\u043a\u043e\u043c \u0443\u0440\u043e\u0432\u043d\u0435 \u043e\u043d \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0442\u0430\u043a:<\/p>\n<p>  <\/p>\n<ol>\n<li>\u0413\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 \u0441\u0438\u043d\u0442\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0432\u044b\u0431\u043e\u0440\u043a\u0438 \u0438\u0437 \u043c\u0438\u043d\u043e\u0440\u043d\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430, \u0430 \u043d\u0435 \u0441\u043e\u0437\u0434\u0430\u0451\u0442 \u043a\u043e\u043f\u0438\u0438.<\/li>\n<li>\u0421\u043b\u0443\u0447\u0430\u0439\u043d\u043e \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u0442 \u043e\u0434\u043d\u043e\u0433\u043e \u0438\u0437 k \u0431\u043b\u0438\u0436\u0430\u0439\u0448\u0438\u0445 \u0441\u043e\u0441\u0435\u0434\u0435\u0439 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0435\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u0435, \u043d\u043e \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e \u043f\u043e\u0434\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u043e\u0435 \u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u0435.<\/li>\n<\/ol>\n<p>  <\/p>\n<p>\u0420\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c <a href=\"https:\/\/www.google.com\/url?q=http:\/\/imbalanced-learn.org\/en\/stable\/over_sampling.html%23smote-variants&amp;sa=D&amp;source=editors&amp;ust=1669378141328453&amp;usg=AOvVaw2giYjXQHjJzRumRLGRPcU2\">\u044d\u0442\u043e\u0442 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u043d\u0430 Python<\/a>:<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">X = data_final.loc[:, data_final.columns != 'y'] y = data_final.loc[:, data_final.columns == 'y'] from imblearn.over_sampling import SMOTE os = SMOTE(random_state=0) X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.3, random_state=0) columns = X_train.columns os_data_X,os_data_y=os.fit_sample(X_train, y_train) os_data_X = pd.DataFrame(data=os_data_X,columns=columns ) os_data_y= pd.DataFrame(data=os_data_y,columns=['y']) # we can Check the numbers of our data print(\"length of oversampled data is \",len(os_data_X)) print(\"Number of no subscription in oversampled data\",len(os_data_y[os_data_y['y']==0])) print(\"Number of subscription\",len(os_data_y[os_data_y['y']==1])) print(\"Proportion of no subscription data in oversampled data is \",len(os_data_y[os_data_y['y']==0])\/len(os_data_X)) print(\"Proportion of subscription data in oversampled data is \",len(os_data_y[os_data_y['y']==1])\/len(os_data_X))<\/code><\/pre>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/ui\/fs\/0o\/uifs0odrlqqg5bqik9ofxni3fwy.png\" data-src=\"https:\/\/habrastorage.org\/webt\/ui\/fs\/0o\/uifs0odrlqqg5bqik9ofxni3fwy.png\"\/><\/p>\n<p>  <\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0441\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u044b \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u043e! \u0412\u044b \u043c\u043e\u0433\u043b\u0438 \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u044f \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u043b\u0430 \u0432\u044b\u0431\u043e\u0440\u043a\u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u0440\u0435\u043d\u0438\u0440\u043e\u0432\u043e\u0447\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445; \u043d\u0438\u043a\u0430\u043a\u0430\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u0438\u0437 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0441\u0438\u043d\u0442\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u0439, \u0442\u043e \u0435\u0441\u0442\u044c \u043d\u0438\u043a\u0430\u043a\u0430\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0433\u043e \u043d\u0430\u0431\u043e\u0440\u0430 \u043d\u0435 \u0443\u0442\u0435\u0447\u0451\u0442 \u0432 \u043e\u0431\u0443\u0447\u0430\u044e\u0449\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0435.<\/p>\n<p>  <\/p>\n<h1 id=\"rekursivnoe-ustranenie-priznakov\">\u0420\u0435\u043a\u0443\u0440\u0441\u0438\u0432\u043d\u043e\u0435 \u0443\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432<\/h1>\n<p>  <\/p>\n<p>\u0420\u0435\u043a\u0443\u0440\u0441\u0438\u0432\u043d\u044b\u0435 \u0443\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u043e \u043d\u0430 \u0438\u0434\u0435\u0435 \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u044e\u0449\u0435\u0433\u043e\u0441\u044f \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043c\u043e\u0434\u0435\u043b\u0438 \u0438 \u0432\u044b\u0431\u043e\u0440\u0430 \u043b\u0443\u0447\u0448\u0438\u0445 \u0438 \u0445\u0443\u0434\u0448\u0438\u0445 \u0432 \u0441\u043c\u044b\u0441\u043b\u0435 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432, \u0430 \u0437\u0430\u0442\u0435\u043c \u00a0\u043e\u0442\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0430 \u0438 \u043f\u043e\u0432\u0442\u043e\u0440\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u0434\u043e \u0438\u0441\u0447\u0435\u0440\u043f\u0430\u043d\u0438\u044f \u0432\u0441\u0435\u0445 \u0434\u0430\u043d\u043d\u044b\u0445. \u0426\u0435\u043b\u044c \u2014 \u0432\u044b\u0431\u0438\u0440\u0430\u0442\u044c \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0438, \u0440\u0435\u043a\u0443\u0440\u0441\u0438\u0432\u043d\u043e \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u044f \u0432\u0441\u0451 \u043c\u0435\u043d\u044c\u0448\u0438\u0435 \u0438 \u043c\u0435\u043d\u044c\u0448\u0438\u0435 \u0438\u0445 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0430.<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">data_final_vars=data_final.columns.values.tolist() y=['y'] X=[i for i in data_final_vars if i not in y] from sklearn.feature_selection import RFE from sklearn.linear_model import LogisticRegression logreg = LogisticRegression() rfe = RFE(logreg, 20) rfe = rfe.fit(os_data_X, os_data_y.values.ravel()) print(rfe.support_) print(rfe.ranking_)<\/code><\/pre>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/gi\/er\/pa\/gierpahkqr_ty_syhh9lxtmbe9o.png\" data-src=\"https:\/\/habrastorage.org\/webt\/gi\/er\/pa\/gierpahkqr_ty_syhh9lxtmbe9o.png\"\/><\/p>\n<p>  <\/p>\n<p>\u00a0\u041c\u0435\u0442\u043e\u0434 \u043f\u043e\u043c\u043e\u0433 \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0438: &#171;euribor3m&#187;, &#171;job_blue-collar&#187;, &#171;job_housemaid&#187;, &#171;marital_unknown&#187;, &#171;education_illiterate&#187;, &#171;default_no&#187;, &#171;default_unknown&#187;, &#171;contact_cellular&#187;, &#171;contact_telephone&#187;, &#171;month_apr&#187;, &#171;month_aug&#187;, &#171;month_dec&#187;, &#171;month_jul&#187;, &#171;month_jun&#187;, &#171;month_mar&#187;, &#171;month_may&#187;, &#171;month_nov&#187;, &#171;month_oct&#187;, &#171;poutcome_failure&#187;, &#171;poutcome_success&#187;.<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">cols=['euribor3m', 'job_blue-collar', 'job_housemaid', 'marital_unknown', 'education_illiterate', 'default_no', 'default_unknown',        'contact_cellular', 'contact_telephone', 'month_apr', 'month_aug', 'month_dec', 'month_jul', 'month_jun', 'month_mar',        'month_may', 'month_nov', 'month_oct', \"poutcome_failure\", \"poutcome_success\"]  X=os_data_X[cols] y=os_data_y['y']<\/code><\/pre>\n<p>  <\/p>\n<h1 id=\"realizaciya-modeli\">\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043c\u043e\u0434\u0435\u043b\u0438<\/h1>\n<p>  <\/p>\n<pre><code class=\"python\">import statsmodels.api as sm logit_model=sm.Logit(y,X) result=logit_model.fit() print(result.summary2())<\/code><\/pre>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/m5\/8y\/9r\/m58y9rypepx29lpvpdm0zyakxwi.png\" data-src=\"https:\/\/habrastorage.org\/webt\/m5\/8y\/9r\/m58y9rypepx29lpvpdm0zyakxwi.png\"\/><\/p>\n<p>  <\/p>\n<p>p-\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043c\u0435\u043d\u044c\u0448\u0435 0,05, \u043a\u0440\u043e\u043c\u0435 \u0447\u0435\u0442\u044b\u0440\u0451\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u044b \u0443\u0434\u0430\u043b\u0438\u043c:<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">cols=['euribor3m', 'job_blue-collar', 'job_housemaid', 'marital_unknown', 'education_illiterate',        'month_apr', 'month_aug', 'month_dec', 'month_jul', 'month_jun', 'month_mar',        'month_may', 'month_nov', 'month_oct', \"poutcome_failure\", \"poutcome_success\"]  X=os_data_X[cols] y=os_data_y['y'] logit_model=sm.Logit(y,X) result=logit_model.fit() print(result.summary2())<\/code><\/pre>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/al\/hh\/rj\/alhhrjbutf3hlovmeoguzd49oq0.png\" data-src=\"https:\/\/habrastorage.org\/webt\/al\/hh\/rj\/alhhrjbutf3hlovmeoguzd49oq0.png\"\/><\/p>\n<p>  <\/p>\n<h1 id=\"obuchenie-modeli-logisticheskoy-regressii\">\u041e\u0431\u0443\u0447\u0435\u043d\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 \u043b\u043e\u0433\u0438\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u0438<\/h1>\n<p>  <\/p>\n<pre><code class=\"python\">from sklearn.linear_model import LogisticRegression from sklearn import metrics X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.3, random_state=0) logreg = LogisticRegression() logreg.fit(X_train, y_train)<\/code><\/pre>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/wp\/2d\/ql\/wp2dqldmkb_ng0ybnb4gs-es8tm.png\" data-src=\"https:\/\/habrastorage.org\/webt\/wp\/2d\/ql\/wp2dqldmkb_ng0ybnb4gs-es8tm.png\"\/><\/p>\n<p>  <\/p>\n<p>\u041f\u0440\u043e\u0433\u043d\u043e\u0437 \u043d\u0430 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u043c \u043d\u0430\u0431\u043e\u0440\u0435 \u0438 \u0440\u0430\u0441\u0447\u0451\u0442 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438:<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">y_pred = logreg.predict(X_test) print('Accuracy of logistic regression classifier on test set: {:.2f}'.format(logreg.score(X_test, y_test)))<\/code><\/pre>\n<p>  <\/p>\n<p>\u0422\u043e\u0447\u043d\u043e\u0441\u0442\u044c \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u0430 \u043b\u043e\u0433\u0438\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u0438 \u043d\u0430 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u043c \u043d\u0430\u0431\u043e\u0440\u0435: 0,74<\/p>\n<p>  <\/p>\n<h1 id=\"matrica-putanicy\">\u041c\u0430\u0442\u0440\u0438\u0446\u0430 \u043f\u0443\u0442\u0430\u043d\u0438\u0446\u044b<\/h1>\n<p>  <\/p>\n<pre><code class=\"python\">from sklearn.metrics import confusion_matrix confusion_matrix = confusion_matrix(y_test, y_pred) print(confusion_matrix)<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"plaintext\">[[6124 1542] [2505 5170]]<\/code><\/pre>\n<p>  <\/p>\n<p>\u0423 \u043d\u0430\u0441 6124+5170 \u0432\u0435\u0440\u043d\u044b\u0445 \u0438 2505+1542 \u043d\u0435\u0432\u0435\u0440\u043d\u044b\u0445 \u043f\u0440\u043e\u0433\u043d\u043e\u0437\u043e\u0432.<\/p>\n<p>  <\/p>\n<h1 id=\"raschyot-tochnosti-polnoty-f-mery-i-nositelya\">\u0420\u0430\u0441\u0447\u0451\u0442 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438, \u043f\u043e\u043b\u043d\u043e\u0442\u044b, F-\u043c\u0435\u0440\u044b \u0438 \u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044f<\/h1>\n<p>  <\/p>\n<p>\u0426\u0438\u0442\u0430\u0442\u0430 \u043e\u0442 <a href=\"https:\/\/www.google.com\/url?q=http:\/\/scikit-learn.org\/stable\/index.html&amp;sa=D&amp;source=editors&amp;ust=1669378141331471&amp;usg=AOvVaw3FsZEhOpeI0utHcoaWKE0I\">Scikit Learn<\/a>:<\/p>\n<p>  <\/p>\n<p>\u0422\u043e\u0447\u043d\u043e\u0441\u0442\u044c \u2014 \u044d\u0442\u043e \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u0435 tp\/(tp + fp), \u0433\u0434\u0435 tp \u2014 \u0447\u0438\u0441\u043b\u043e \u0438\u0441\u0442\u0438\u043d\u043d\u044b\u0445 \u0438 \u043b\u043e\u0436\u043d\u044b\u0445 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0439, \u0430 \u0438\u043d\u0442\u0443\u0438\u0442\u0438\u0432\u043d\u043e \u2014 \u044d\u0442\u043e \u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u0438 \u043d\u0435 \u043e\u0442\u043c\u0435\u0447\u0430\u0442\u044c \u0438\u0441\u0442\u0438\u043d\u043d\u044b\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u043a\u0430\u043a \u043b\u043e\u0436\u043d\u044b\u0435.<\/p>\n<p>  <\/p>\n<p>\u041f\u043e\u043b\u043d\u043e\u0442\u0430 \u2014 \u044d\u0442\u043e \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u0435 tp\/(tp + fn), \u0442\u043e \u0435\u0441\u0442\u044c \u0447\u0438\u0441\u043b\u0430 \u0438\u0441\u0442\u0438\u043d\u043d\u044b\u0445 \u0438 \u043b\u043e\u0436\u043d\u044b\u0445 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0439, \u0430 \u0438\u043d\u0442\u0443\u0438\u0442\u0438\u0432\u043d\u043e \u2014 \u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u0438 \u043d\u0430\u0439\u0442\u0438 \u0432\u0441\u0435 \u0438\u0441\u0442\u0438\u043d\u043d\u044b\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b.<\/p>\n<p>  <\/p>\n<p>\u041e\u0446\u0435\u043d\u043a\u0443 F-beta \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043d\u0438\u043c\u0430\u0442\u044c \u043a\u0430\u043a \u0432\u0437\u0432\u0435\u0448\u0435\u043d\u043d\u043e\u0435 \u0433\u0430\u0440\u043c\u043e\u043d\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0441\u0440\u0435\u0434\u043d\u0435\u0435 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438 \u0438 \u043f\u043e\u043b\u043d\u043e\u0442\u044b. \u041b\u0443\u0447\u0448\u0435\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043e\u0446\u0435\u043d\u043a\u0438 \u2014 1, \u0445\u0443\u0434\u0448\u0435\u0435 \u2014 0. \u042d\u0442\u0430 \u043e\u0446\u0435\u043d\u043a\u0430 \u0432\u0437\u0432\u0435\u0448\u0438\u0432\u0430\u0435\u0442 \u043f\u043e\u043b\u043d\u043e\u0442\u0443 \u0442\u0449\u0430\u0442\u0435\u043b\u044c\u043d\u0435\u0435 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438, \u0443\u043c\u043d\u043e\u0436\u0430\u044f \u0435\u0451 \u043d\u0430 \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442 \u0431\u0435\u0442\u0430. \u0411\u0435\u0442\u0430, \u0440\u0430\u0432\u043d\u0430\u044f 1.0, \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u0443\u044e \u0432\u0430\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u043b\u043d\u043e\u0442\u044b \u0438 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438.<\/p>\n<p>  <\/p>\n<p>\u041d\u043e\u0441\u0438\u0442\u0435\u043b\u044c \u2014 \u044d\u0442\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0432\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u0439 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 \u0432 y_test.<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">from sklearn.metrics import classification_report print(classification_report(y_test, y_pred))<\/code><\/pre>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/za\/gj\/bu\/zagjbujy0gpmmoavmcjfj4fbwwc.png\" data-src=\"https:\/\/habrastorage.org\/webt\/za\/gj\/bu\/zagjbujy0gpmmoavmcjfj4fbwwc.png\"\/><\/p>\n<p>  <\/p>\n<p>\u0418\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0446\u0438\u044f:<\/p>\n<p>  <\/p>\n<ul>\n<li>74% \u0440\u0435\u043a\u043b\u0430\u043c\u0438\u0440\u0443\u0435\u043c\u044b\u0445 \u0441\u0440\u043e\u0447\u043d\u044b\u0445 \u0434\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0432 \u0438\u0437 \u043d\u0430\u0431\u043e\u0440\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u043e\u043d\u0440\u0430\u0432\u0438\u043b\u0438\u0441\u044c \u043a\u043b\u0438\u0435\u043d\u0442\u0430\u043c. <\/li>\n<li>74% \u0441\u0440\u043e\u0447\u043d\u044b\u0445 \u0434\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u043b\u0438 \u043a\u043b\u0438\u0435\u043d\u0442\u044b, \u0431\u044b\u043b\u0438 \u043f\u0440\u043e\u0440\u0435\u043a\u043b\u0430\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u044b.<\/li>\n<\/ul>\n<p>  <\/p>\n<h1 id=\"roc-krivaya\">ROC-\u043a\u0440\u0438\u0432\u0430\u044f<\/h1>\n<p>  <\/p>\n<pre><code class=\"python\">from sklearn.metrics import roc_auc_score from sklearn.metrics import roc_curve logit_roc_auc = roc_auc_score(y_test, logreg.predict(X_test)) fpr, tpr, thresholds = roc_curve(y_test, logreg.predict_proba(X_test)[:,1]) plt.figure() plt.plot(fpr, tpr, label='Logistic Regression (area = %0.2f)' % logit_roc_auc) plt.plot([0, 1], [0, 1],'r--') plt.xlim([0.0, 1.0]) plt.ylim([0.0, 1.05]) plt.xlabel('False Positive Rate') plt.ylabel('True Positive Rate') plt.title('Receiver operating characteristic') plt.legend(loc=\"lower right\") plt.savefig('Log_ROC') plt.show()<\/code><\/pre>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/9g\/do\/xq\/9gdoxqw_wg7q9jh7woayfmu-zg0.png\" data-src=\"https:\/\/habrastorage.org\/webt\/9g\/do\/xq\/9gdoxqw_wg7q9jh7woayfmu-zg0.png\"\/><\/p>\n<p>  <\/p>\n<p>\u0420\u0430\u0431\u043e\u0447\u0430\u044f \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u0438\u0441\u0442\u0438\u043a\u0430 \u043f\u0440\u0438\u0451\u043c\u043d\u0438\u043a\u0430 \u2014 \u0434\u0440\u0443\u0433\u043e\u0439 \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0451\u043d\u043d\u044b\u0439 \u0432 \u0431\u0438\u043d\u0430\u0440\u043d\u043e\u0439 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442. \u041f\u0443\u043d\u043a\u0442\u0438\u0440\u043d\u0430\u044f \u043b\u0438\u043d\u0438\u044f \u0437\u0434\u0435\u0441\u044c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043a\u0440\u0438\u0432\u0443\u044e \u0440\u0430\u0431\u043e\u0447\u0435\u0439 \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u0438\u0441\u0442\u0438\u043a\u0438 \u043f\u0440\u0438\u0451\u043c\u043d\u0438\u043a\u0430 \u0434\u043b\u044f \u0447\u0438\u0441\u0442\u043e \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u0430, \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0433\u0440\u0430\u0444\u0438\u043a \u0445\u043e\u0440\u043e\u0448\u0435\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u0430 \u0434\u0435\u0440\u0436\u0438\u0442\u0441\u044f \u043e\u0442 \u043f\u0443\u043d\u043a\u0442\u0438\u0440\u0430 \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0434\u0430\u043b\u044c\u0448\u0435, \u043a \u043b\u0435\u0432\u043e\u043c\u0443 \u0432\u0435\u0440\u0445\u043d\u0435\u043c\u0443 \u0443\u0433\u043b\u0443.<\/p>\n<p>  <\/p>\n<p>\u0418\u043d\u0442\u0435\u0440\u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0439 \u0431\u043b\u043e\u043a\u043d\u043e\u0442 \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043f\u043e\u0441\u0442\u0430 \u043b\u0435\u0436\u0438\u0442 <a href=\"https:\/\/github.com\/susanli2016\/Machine-Learning-with-Python\/blob\/master\/Logistic%20Regression%20balanced.ipynb\">\u0437\u0434\u0435\u0441\u044c<\/a>. \u041c\u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0438\u044f\u0442\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043e\u0442\u0437\u044b\u0432 \u0438\u043b\u0438 \u0432\u043e\u043f\u0440\u043e\u0441 \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445.<\/p>\n<p>  <\/p>\n<p>\u0421\u0441\u044b\u043b\u043a\u0430: <a href=\"https:\/\/www.google.com\/url?q=https:\/\/books.google.com\/books\/about\/Learning_Predictive_Analytics_with_Pytho.html?id%3DIa5KDAAAQBAJ%26printsec%3Dfrontcover%26source%3Dkp_read_button%23v%3Donepage%26q%26f%3Dfalse&amp;sa=D&amp;source=editors&amp;ust=1669378141334313&amp;usg=AOvVaw1BqOsplYGttrBQGjr9CwhZ\">Learning Predictive Analytics with Python<\/a><\/p>\n<p>  <\/p>\n<p>\u041d\u0430\u0443\u0447\u0438\u043c \u0432\u0430\u0441 \u0430\u043a\u043a\u0443\u0440\u0430\u0442\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438, \u0447\u0442\u043e\u0431\u044b \u0432\u044b\u00a0\u043f\u0440\u043e\u043a\u0430\u0447\u0430\u043b\u0438 \u043a\u0430\u0440\u044c\u0435\u0440\u0443 \u0438 \u0441\u0442\u0430\u043b\u0438 \u0432\u043e\u0441\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u043d\u044b\u043c IT-\u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0441\u0442\u043e\u043c. \u0415\u0441\u043b\u0438 \u0432\u044b \u043d\u0435 \u043d\u0430\u0439\u0434\u0451\u0442\u0435 \u0440\u0430\u0431\u043e\u0442\u0443, \u043c\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u0435\u0440\u043d\u0451\u043c \u0434\u0435\u043d\u044c\u0433\u0438 (\u0432\u043e\u0437\u0432\u0440\u0430\u0442 \u2014 \u0430\u043a\u0446\u0438\u044f \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u00ab\u0427\u0451\u0440\u043d\u043e\u0439 \u043f\u044f\u0442\u043d\u0438\u0446\u044b\u00bb).<\/p>\n<p>  <\/p>\n<p><a href=\"https:\/\/skillfactory.ru\/catalogue?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=sf_allcourses_261122&amp;utm_term=banner\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/webt\/1b\/dh\/iu\/1bdhiubvma3zkcbjnagowkrdta8.jpeg\" data-src=\"https:\/\/habrastorage.org\/webt\/1b\/dh\/iu\/1bdhiubvma3zkcbjnagowkrdta8.jpeg\" data-blurred=\"true\"\/><\/a><\/p>\n<p>  <\/p>\n<ul>\n<li><u><a href=\"https:\/\/skillfactory.ru\/data-scientist-pro?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=data-science_dspr_261122&amp;utm_term=conc\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f Data Scientist (24 \u043c\u0435\u0441\u044f\u0446\u0430)<\/a><\/u><\/li>\n<li><u><a href=\"https:\/\/skillfactory.ru\/python-fullstack-web-developer?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_fpw_261122&amp;utm_term=conc\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f Fullstack-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043d\u0430\u00a0Python (16 \u043c\u0435\u0441\u044f\u0446\u0435\u0432)<\/a><\/u><\/li>\n<\/ul>\n<p>  <\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u041a\u0440\u0430\u0442\u043a\u0438\u0439 \u043a\u0430\u0442\u0430\u043b\u043e\u0433 \u043a\u0443\u0440\u0441\u043e\u0432<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<p><strong>Data Science \u0438\u00a0Machine Learning<\/strong><\/p>\n<p>  <\/p>\n<ul>\n<li><a href=\"https:\/\/skillfactory.ru\/data-scientist-pro?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=data-science_dspr_261122&amp;utm_term=cat\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f Data Scientist<\/a><\/li>\n<li><a href=\"https:\/\/skillfactory.ru\/data-analyst-pro?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=analytics_dapr_261122&amp;utm_term=cat\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f Data Analyst<\/a><\/li>\n<li><a href=\"https:\/\/skillfactory.ru\/matematika-dlya-data-science#syllabus?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=data-science_mat_261122&amp;utm_term=cat\">\u041a\u0443\u0440\u0441 \u00ab\u041c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u043a\u0430 \u0434\u043b\u044f Data Science\u00bb<\/a><\/li>\n<li><a href=\"https:\/\/skillfactory.ru\/matematika-i-machine-learning-dlya-data-science?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=data-science_matml_261122&amp;utm_term=cat\">\u041a\u0443\u0440\u0441 \u00ab\u041c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u043a\u0430 \u0438\u00a0Machine Learning \u0434\u043b\u044f Data Science\u00bb<\/a><\/li>\n<li><a href=\"https:\/\/skillfactory.ru\/data-engineer?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=data-science_dea_261122&amp;utm_term=cat\">\u041a\u0443\u0440\u0441 \u043f\u043e\u00a0Data Engineering<\/a><\/li>\n<li><a href=\"https:\/\/skillfactory.ru\/machine-learning-i-deep-learning?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=data-science_mldl_261122&amp;utm_term=cat\">\u041a\u0443\u0440\u0441 \u00abMachine Learning \u0438\u00a0Deep Learning\u00bb<\/a><\/li>\n<li><a href=\"https:\/\/skillfactory.ru\/machine-learning?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=data-science_ml_261122&amp;utm_term=cat\">\u041a\u0443\u0440\u0441 \u043f\u043e\u00a0Machine Learning<\/a><\/li>\n<\/ul>\n<p>  <\/p>\n<p><strong>Python, \u0432\u0435\u0431-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430<\/strong><\/p>\n<p>  <\/p>\n<ul>\n<li><a href=\"https:\/\/skillfactory.ru\/python-fullstack-web-developer?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_fpw_261122&amp;utm_term=cat\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f Fullstack-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043d\u0430\u00a0Python<\/a><\/li>\n<li><a href=\"https:\/\/skillfactory.ru\/python-for-web-developers?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_pws_261122&amp;utm_term=cat\">\u041a\u0443\u0440\u0441 \u00abPython \u0434\u043b\u044f \u0432\u0435\u0431-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438\u00bb<\/a><\/li>\n<li><a href=\"https:\/\/skillfactory.ru\/frontend-razrabotchik?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_fr_261122&amp;utm_term=cat\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f Frontend-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a<\/a><\/li>\n<li><a href=\"https:\/\/skillfactory.ru\/webdev?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_webdev_261122&amp;utm_term=cat\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f \u0412\u0435\u0431-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a<\/a><\/li>\n<\/ul>\n<p>  <\/p>\n<p><strong>\u041c\u043e\u0431\u0438\u043b\u044c\u043d\u0430\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430<\/strong><\/p>\n<p>  <\/p>\n<ul>\n<li><a href=\"https:\/\/skillfactory.ru\/ios-razrabotchik-s-nulya?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_ios_261122&amp;utm_term=cat\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f iOS-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a<\/a><\/li>\n<li><a href=\"https:\/\/skillfactory.ru\/android-razrabotchik?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_andr_261122&amp;utm_term=cat\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f Android-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a<\/a><\/li>\n<\/ul>\n<p>  <\/p>\n<p><strong>Java \u0438\u00a0C#<\/strong><\/p>\n<p>  <\/p>\n<ul>\n<li><a href=\"https:\/\/skillfactory.ru\/java-razrabotchik?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_java_261122&amp;utm_term=cat\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f Java-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a<\/a><\/li>\n<li><a href=\"https:\/\/skillfactory.ru\/java-qa-engineer-testirovshik-po?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_qaja_261122&amp;utm_term=cat\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f QA-\u0438\u043d\u0436\u0435\u043d\u0435\u0440 \u043d\u0430\u00a0JAVA<\/a><\/li>\n<li><a href=\"https:\/\/skillfactory.ru\/c-sharp-razrabotchik?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_cdev_261122&amp;utm_term=cat\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f C#-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a<\/a><\/li>\n<li><a href=\"https:\/\/skillfactory.ru\/game-razrabotchik-na-unity-i-c-sharp?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_gamedev_261122&amp;utm_term=cat\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f \u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0438\u0433\u0440 \u043d\u0430\u00a0Unity<\/a><\/li>\n<\/ul>\n<p>  <\/p>\n<p><strong>\u041e\u0442\u00a0\u043e\u0441\u043d\u043e\u0432\u00a0\u2014 \u0432\u00a0\u0433\u043b\u0443\u0431\u0438\u043d\u0443<\/strong><\/p>\n<p>  <\/p>\n<ul>\n<li><a href=\"https:\/\/skillfactory.ru\/algoritmy-i-struktury-dannyh?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_algo_261122&amp;utm_term=cat\">\u041a\u0443\u0440\u0441 \u00ab\u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b \u0438\u00a0\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0434\u0430\u043d\u043d\u044b\u0445\u00bb<\/a><\/li>\n<li><a href=\"https:\/\/skillfactory.ru\/c-plus-plus-razrabotchik?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_cplus_261122&amp;utm_term=cat\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f C++ \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a<\/a><\/li>\n<li><a href=\"https:\/\/skillfactory.ru\/cyber-security-etichnij-haker?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_hacker_261122&amp;utm_term=cat\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f \u00ab\u0411\u0435\u043b\u044b\u0439 \u0445\u0430\u043a\u0435\u0440\u00bb<\/a><\/li>\n<\/ul>\n<p>  <\/p>\n<p><strong>\u0410\u00a0\u0442\u0430\u043a\u0436\u0435<\/strong><\/p>\n<p>  <\/p>\n<ul>\n<li><a href=\"https:\/\/skillfactory.ru\/devops-ingineer?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_devops_261122&amp;utm_term=cat\">\u041a\u0443\u0440\u0441 \u043f\u043e\u00a0DevOps<\/a><\/li>\n<li><a href=\"https:\/\/skillfactory.ru\/catalogue?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=sf_allcourses_261122&amp;utm_term=cat\">\u0412\u0441\u0435 \u043a\u0443\u0440\u0441\u044b<\/a><\/li>\n<\/ul>\n<\/div><\/div>\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\/company\/skillfactory\/blog\/701530\/\"> https:\/\/habr.com\/ru\/company\/skillfactory\/blog\/701530\/<\/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-1\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p><a href=\"https:\/\/habr.com\/ru\/company\/skillfactory\/blog\/701530\/\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/98\/ym\/-5\/98ym-5k0yh6ahxydtzfr1_f1rvw.png\" data-src=\"https:\/\/habrastorage.org\/webt\/98\/ym\/-5\/98ym-5k0yh6ahxydtzfr1_f1rvw.png\"\/><\/a><\/p>\n<p>  <\/p>\n<p>\u041b\u043e\u0433\u0438\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u044f \u2014 \u044d\u0442\u043e \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0432 \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u043c \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0438 \u0434\u043b\u044f \u043f\u0440\u043e\u0433\u043d\u043e\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0438 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0430\u043b\u044c\u043d\u043e \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439. \u0412 \u043b\u043e\u0433\u0438\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u2014 \u044d\u0442\u043e \u0434\u0432\u043e\u0438\u0447\u043d\u044b\u0435 (\u0431\u0438\u043d\u0430\u0440\u043d\u044b\u0435) \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0435 1 (\u0434\u0430, \u0443\u0441\u043f\u0435\u0445, \u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435) \u0438\u043b\u0438 0 \u2014 \u043d\u0435\u0442, \u043d\u0435\u0443\u0434\u0430\u0447\u0430, \u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435. \u0414\u0440\u0443\u0433\u0438\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438, \u043b\u043e\u0433\u0438\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u044f \u043f\u0440\u043e\u0433\u043d\u043e\u0437\u0438\u0440\u0443\u0435\u0442 P(Y=1) \u043a\u0430\u043a \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043e\u0442 X. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u044b\u0439 \u0438 \u044f\u0441\u043d\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u2014 \u043a <u><a href=\"https:\/\/skillfactory.ru\/data-scientist-pro?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=data-science_dspr_261122&amp;utm_term=lead\">\u0441\u0442\u0430\u0440\u0442\u0443 \u043d\u0430\u0448\u0435\u0433\u043e \u0444\u043b\u0430\u0433\u043c\u0430\u043d\u0441\u043a\u043e\u0433\u043e \u043a\u0443\u0440\u0441\u0430 \u043f\u043e Data Science<\/a><\/u>.<\/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-341780","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/341780","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=341780"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/341780\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=341780"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=341780"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=341780"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}