{"id":204500,"date":"2013-12-02T14:08:03","date_gmt":"2013-12-02T10:08:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=204500"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=204500","title":{"rendered":"<span class=\"post_title\">\u041f\u0440\u0438\u043c\u0435\u0440 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0437\u0430\u0434\u0430\u0447\u0438 \u043a\u0440\u0435\u0434\u0438\u0442\u043d\u043e\u0433\u043e \u0441\u043a\u043e\u0440\u0438\u043d\u0433\u0430 c \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u0432\u044f\u0437\u043a\u0438 python+pandas+scikit-learn<\/span>"},"content":{"rendered":"<div class=\"content html_format\">\n<h4>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h4>\n<p>  \u0414\u043e\u0431\u0440\u044b\u0439 \u0434\u0435\u043d\u044c, \u0443\u0432\u0430\u0436\u0430\u0435\u043c\u044b\u0435 \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u0438.<br \/>  \u041d\u0435\u0434\u0430\u0432\u043d\u043e, \u0431\u0440\u043e\u0434\u044f \u043f\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u0440\u0430\u043c \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u0430\u0443\u0442\u0438\u043d\u044b, \u044f \u043d\u0430\u0442\u043a\u043d\u0443\u043b\u0441\u044f \u043d\u0430 <a href=\"https:\/\/www.tcsbank.ru\/tournament\/\">\u0442\u0443\u0440\u043d\u0438\u0440<\/a>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u043e\u0432\u043e\u0434\u0438\u043b\u0441\u044f \u0431\u0430\u043d\u043a\u043e\u043c \u0422\u041a\u0421 \u0432 \u043d\u0430\u0447\u0430\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u0433\u043e\u0434\u0430. \u041e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0432\u0448\u0438\u0441\u044c \u0441 \u0437\u0430\u0434\u0430\u043d\u0438\u044f\u043c\u0438, \u044f \u0440\u0435\u0448\u0438\u043b \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0441\u0432\u043e\u0438 \u043d\u0430\u0432\u044b\u043a\u0438 \u0432 \u0430\u043d\u0430\u043b\u0438\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0430 \u043d\u0438\u0445.<br \/>  \u041d\u0430\u0447\u0430\u0442\u044c \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u044f \u0440\u0435\u0448\u0438\u043b \u0441 \u0437\u0430\u0434\u0430\u0447\u0438 \u043e \u0441\u043a\u043e\u0440\u0438\u043d\u0433\u0435 (\u0417\u0430\u0434\u0430\u043d\u0438\u0435 \u21163). \u0414\u043b\u044f \u0435\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u044f, \u043a\u0430\u043a \u0432\u0441\u0435\u0433\u0434\u0430, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b Python \u0441 \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c\u0438 \u043c\u043e\u0434\u0443\u043b\u044f\u043c\u0438 <a href=\"http:\/\/pandas.pydata.org\/pandas-docs\/stable\/\">pandas<\/a> \u0438 <a href=\"http:\/\/scikit-learn.org\/stable\/index.html\">scikit-learn<\/a>.<br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<h4>\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u043f\u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0437\u0430\u0434\u0430\u0447\u0438<\/h4>\n<p>  \u0411\u0430\u043d\u043a \u0437\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u0442 \u043a\u0440\u0435\u0434\u0438\u0442\u043d\u0443\u044e \u0438\u0441\u0442\u043e\u0440\u0438\u044e \u0437\u0430\u044f\u0432\u0438\u0442\u0435\u043b\u044f \u0432 \u0442\u0440\u0435\u0445 \u043a\u0440\u0443\u043f\u043d\u0435\u0439\u0448\u0438\u0445 \u0440\u043e\u0441\u0441\u0438\u0439\u0441\u043a\u0438\u0445 \u043a\u0440\u0435\u0434\u0438\u0442\u043d\u044b\u0445 \u0431\u044e\u0440\u043e. \u041f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432\u044b\u0431\u043e\u0440\u043a\u0430 \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432 \u0411\u0430\u043d\u043a\u0430 \u0432 \u0444\u0430\u0439\u043b\u0435 <a href=\"https:\/\/static.tcsbank.ru\/documents\/olymp\/SAMPLE_CUSTOMERS.csv\">SAMPLE_CUSTOMERS.CSV<\/a>. \u0412\u044b\u0431\u043e\u0440\u043a\u0430 \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0430 \u043d\u0430 \u0447\u0430\u0441\u0442\u0438 \u00abtrain\u00bb \u0438 \u00abtest\u00bb. \u041f\u043e \u0432\u044b\u0431\u043e\u0440\u043a\u0435 \u00abtrain\u00bb \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0446\u0435\u043b\u0435\u0432\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 bad \u2014 \u043d\u0430\u043b\u0438\u0447\u0438\u0435 &quot;\u0434\u0435\u0444\u043e\u043b\u0442\u0430&quot; (\u0434\u043e\u043f\u0443\u0449\u0435\u043d\u0438\u0435 \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u043c \u043f\u0440\u043e\u0441\u0440\u043e\u0447\u043a\u0438 90 \u0438 \u0431\u043e\u043b\u0435\u0435 \u0434\u043d\u0435\u0439 \u0432 \u0442\u0435\u0447\u0435\u043d\u0438\u0435 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0433\u043e\u0434\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043a\u0440\u0435\u0434\u0438\u0442\u043e\u043c). \u0412 \u0444\u0430\u0439\u043b\u0435 <a href=\"https:\/\/static.tcsbank.ru\/documents\/olymp\/SAMPLE_ACCOUNTS.csv\">SAMPLE_ACCOUNTS.CSV<\/a> \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u044b \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u043e\u0442\u0432\u0435\u0442\u043e\u0432 \u043a\u0440\u0435\u0434\u0438\u0442\u043d\u044b\u0445 \u0431\u044e\u0440\u043e \u043d\u0430 \u0432\u0441\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043f\u043e \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u043c \u043a\u043b\u0438\u0435\u043d\u0442\u0430\u043c.<br \/>  \u0424\u043e\u0440\u043c\u0430\u0442 \u0434\u0430\u043d\u043d\u044b\u0445 <b>SAMPLE_CUSTOMERS<\/b> \u2013 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0434\u0435\u0444\u043e\u043b\u0442\u0430 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u0430.<br \/>  \u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0444\u043e\u0440\u043c\u0430\u0442\u0430 \u043d\u0430\u0431\u043e\u0440\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 <b>SAMPLE_ACCOUNTS<\/b>:  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043d\u0430\u0431\u043e\u0440\u0430<\/b><\/p>\n<div class=\"spoiler_text\">\n<table>\n<tr>\n<th>Name<\/th>\n<th>Description<\/th>\n<\/tr>\n<tr>\n<td><i>TCS_CUSTOMER_ID<\/i><\/td>\n<td>\u0418\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u043a\u043b\u0438\u0435\u043d\u0442\u0430<\/td>\n<\/tr>\n<tr>\n<td><i>BUREAU_CD<\/i><\/td>\n<td>\u041a\u043e\u0434 \u0431\u044e\u0440\u043e, \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043f\u043e\u043b\u0443\u0447\u0435\u043d \u0441\u0447\u0435\u0442<\/td>\n<\/tr>\n<tr>\n<td><i>BKI_REQUEST_DATE<\/i><\/td>\n<td>\u0414\u0430\u0442\u0430, \u0432 \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0431\u044b\u043b \u0441\u0434\u0435\u043b\u0430\u043d \u0437\u0430\u043f\u0440\u043e\u0441 \u0432 \u0431\u044e\u0440\u043e<\/td>\n<\/tr>\n<tr>\n<td><i>CURRENCY<\/i><\/td>\n<td>\u0412\u0430\u043b\u044e\u0442\u0430 \u0434\u043e\u0433\u043e\u0432\u043e\u0440\u0430 (ISO \u0431\u0443\u043a\u0432\u0435\u043d\u043d\u044b\u0439 \u043a\u043e\u0434 \u0432\u0430\u043b\u044e\u0442\u044b)<\/td>\n<\/tr>\n<tr>\n<td><i>RELATIONSHIP<\/i><\/td>\n<td>\u0422\u0438\u043f \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u044f \u043a \u0434\u043e\u0433\u043e\u0432\u043e\u0440\u0443<\/td>\n<\/tr>\n<tr>\n<td rowspan=\"5\"><\/td>\n<td>1 \u2014 \u0424\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u043b\u0438\u0446\u043e<\/td>\n<\/tr>\n<tr>\n<td>2 \u2014 \u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u043a\u0430\u0440\u0442\u0430\/\u0410\u0432\u0442\u043e\u0440\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c<\/td>\n<\/tr>\n<tr>\n<td>4 \u2014 \u0421\u043e\u0432\u043c\u0435\u0441\u0442\u043d\u044b\u0439<\/td>\n<\/tr>\n<tr>\n<td>5 \u2014 \u041f\u043e\u0440\u0443\u0447\u0438\u0442\u0435\u043b\u044c<\/td>\n<\/tr>\n<tr>\n<td>9 \u2014 \u042e\u0440\u0438\u0434\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u043b\u0438\u0446\u043e<\/td>\n<\/tr>\n<tr>\n<td><i>OPEN_DATE<\/i><\/td>\n<td>\u0414\u0430\u0442\u0430 \u043e\u0442\u043a\u0440\u044b\u0442\u0438\u044f \u0434\u043e\u0433\u043e\u0432\u043e\u0440\u0430<\/td>\n<\/tr>\n<tr>\n<td><i>FINAL_PMT_DATE<\/i><\/td>\n<td>\u0414\u0430\u0442\u0430 \u0444\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u043b\u0430\u0442\u0435\u0436\u0430 (\u043f\u043b\u0430\u043d\u043e\u0432\u0430\u044f)<\/td>\n<\/tr>\n<tr>\n<td><i>TYPE<\/i><\/td>\n<td>\u041a\u043e\u0434 \u0442\u0438\u043f\u0430 \u0434\u043e\u0433\u043e\u0432\u043e\u0440\u0430<\/td>\n<\/tr>\n<tr>\n<td rowspan=\"11\"><\/td>\n<td>1 \u2013 \u041a\u0440\u0435\u0434\u0438\u0442 \u043d\u0430 \u0430\u0432\u0442\u043e\u043c\u043e\u0431\u0438\u043b\u044c<\/td>\n<\/tr>\n<tr>\n<td>4 \u2013 \u041b\u0438\u0437\u0438\u043d\u0433<\/td>\n<\/tr>\n<tr>\n<td>6 \u2013 \u0418\u043f\u043e\u0442\u0435\u043a\u0430<\/td>\n<\/tr>\n<tr>\n<td>7 \u2013 \u041a\u0440\u0435\u0434\u0438\u0442\u043d\u0430\u044f \u043a\u0430\u0440\u0442\u0430<\/td>\n<\/tr>\n<tr>\n<td>9 \u2013 \u041f\u043e\u0442\u0440\u0435\u0431\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439 \u043a\u0440\u0435\u0434\u0438\u0442<\/td>\n<\/tr>\n<tr>\n<td>10 \u2013 \u041a\u0440\u0435\u0434\u0438\u0442 \u043d\u0430 \u0440\u0430\u0437\u0432\u0438\u0442\u0438\u0435 \u0431\u0438\u0437\u043d\u0435\u0441\u0430<\/td>\n<\/tr>\n<tr>\n<td>11 \u2013 \u041a\u0440\u0435\u0434\u0438\u0442 \u043d\u0430 \u043f\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043e\u0431\u043e\u0440\u043e\u0442\u043d\u044b\u0445 \u0441\u0440\u0435\u0434\u0441\u0442\u0432<\/td>\n<\/tr>\n<tr>\n<td>12 \u2013 \u041a\u0440\u0435\u0434\u0438\u0442 \u043d\u0430 \u043f\u043e\u043a\u0443\u043f\u043a\u0443 \u043e\u0431\u043e\u0440\u0443\u0434\u043e\u0432\u0430\u043d\u0438\u044f<\/td>\n<\/tr>\n<tr>\n<td>13 \u2013 \u041a\u0440\u0435\u0434\u0438\u0442 \u043d\u0430 \u0441\u0442\u0440\u043e\u0438\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u043e \u043d\u0435\u0434\u0432\u0438\u0436\u0438\u043c\u043e\u0441\u0442\u0438<\/td>\n<\/tr>\n<tr>\n<td>14 \u2013 \u041a\u0440\u0435\u0434\u0438\u0442 \u043d\u0430 \u043f\u043e\u043a\u0443\u043f\u043a\u0443 \u0430\u043a\u0446\u0438\u0439 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043c\u0430\u0440\u0436\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0435 \u043a\u0440\u0435\u0434\u0438\u0442\u043e\u0432\u0430\u043d\u0438\u0435)<\/td>\n<\/tr>\n<tr>\n<td>99 \u2013 \u0414\u0440\u0443\u0433\u043e\u0439<\/td>\n<\/tr>\n<tr>\n<td><i>PMT_STRING_84M<\/i><\/td>\n<td>\u0414\u0438\u0441\u0446\u0438\u043f\u043b\u0438\u043d\u0430 (\u0441\u0432\u043e\u0435\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0441\u0442\u044c) \u043f\u043b\u0430\u0442\u0435\u0436\u0435\u0439. \u0421\u0442\u0440\u043e\u043a\u0430 \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0438\u0437 \u043a\u043e\u0434\u043e\u0432 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0439 \u0441\u0447\u0435\u0442\u0430 \u043d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442\u044b \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0431\u0430\u043d\u043a\u043e\u043c \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u043e \u0441\u0447\u0435\u0442\u0443 \u0432 \u0431\u044e\u0440\u043e, \u043f\u0435\u0440\u0432\u044b\u0439 \u0441\u0438\u043c\u0432\u043e\u043b \u2014 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043d\u0430 \u0434\u0430\u0442\u0443 PMT_STRING_START, \u0434\u0430\u043b\u0435\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0432 \u043f\u043e\u0440\u044f\u0434\u043a\u0435 \u0443\u0431\u044b\u0432\u0430\u043d\u0438\u044f \u0434\u0430\u0442.  <\/td>\n<\/tr>\n<tr>\n<td rowspan=\"11\"><\/td>\n<td>0 \u2013 \u041d\u043e\u0432\u044b\u0439, \u043e\u0446\u0435\u043d\u043a\u0430 \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u0430<\/td>\n<\/tr>\n<tr>\n<td>X \u2013 \u041d\u0435\u0442 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438<\/td>\n<\/tr>\n<tr>\n<td>1 \u2013 \u041e\u043f\u043b\u0430\u0442\u0430 \u0431\u0435\u0437 \u043f\u0440\u043e\u0441\u0440\u043e\u0447\u0435\u043a<\/td>\n<\/tr>\n<tr>\n<td>A \u2013 \u041f\u0440\u043e\u0441\u0440\u043e\u0447\u043a\u0430 \u043e\u0442 1 \u0434\u043e 29 \u0434\u043d\u0435\u0439<\/td>\n<\/tr>\n<tr>\n<td>2 \u2013 \u041f\u0440\u043e\u0441\u0440\u043e\u0447\u043a\u0430 \u043e\u0442 30 \u0434\u043e 59 \u0434\u043d\u0435\u0439<\/td>\n<\/tr>\n<tr>\n<td>3 \u2013 \u041f\u0440\u043e\u0441\u0440\u043e\u0447\u043a\u0430 \u043e\u0442 60 \u0434\u043e 89 \u0434\u043d\u0435\u0439<\/td>\n<\/tr>\n<tr>\n<td>4 \u2013 \u041f\u0440\u043e\u0441\u0440\u043e\u0447\u043a\u0430 \u043e\u0442 90 \u0434\u043e 119 \u0434\u043d\u0435\u0439<\/td>\n<\/tr>\n<tr>\n<td>5 \u2013 \u041f\u0440\u043e\u0441\u0440\u043e\u0447\u043a\u0430 \u0431\u043e\u043b\u0435\u0435 120 \u0434\u043d\u0435\u0439<\/td>\n<\/tr>\n<tr>\n<td>7 \u2013 \u0420\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u044b\u0435 \u043a\u043e\u043d\u0441\u043e\u043b\u0438\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043f\u043b\u0430\u0442\u0435\u0436\u0438<\/td>\n<\/tr>\n<tr>\n<td>8 \u2013 \u041f\u043e\u0433\u0430\u0448\u0435\u043d\u0438\u0435 \u043f\u043e \u043a\u0440\u0435\u0434\u0438\u0442\u0443 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0437\u0430\u043b\u043e\u0433\u0430<\/td>\n<\/tr>\n<tr>\n<td>9 \u2013 \u0411\u0435\u0437\u043d\u0430\u0434\u0451\u0436\u043d\u044b\u0439 \u0434\u043e\u043b\u0433\/ \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043e \u043d\u0430 \u0432\u0437\u044b\u0441\u043a\u0430\u043d\u0438\u0435\/ \u043f\u0440\u043e\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u0439 \u043f\u043b\u0430\u0442\u0435\u0436<\/td>\n<\/tr>\n<tr>\n<td><i>STATUS<\/i><\/td>\n<td>\u0421\u0442\u0430\u0442\u0443\u0441 \u0434\u043e\u0433\u043e\u0432\u043e\u0440\u0430<\/td>\n<\/tr>\n<tr>\n<td rowspan=\"7\"><\/td>\n<td>00 \u2013 \u0410\u043a\u0442\u0438\u0432\u043d\u044b\u0439<\/td>\n<\/tr>\n<tr>\n<td>12 \u2013 \u041e\u043f\u043b\u0430\u0447\u0435\u043d \u0437\u0430 \u0441\u0447\u0435\u0442 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u0438\u044f<\/td>\n<\/tr>\n<tr>\n<td>13 \u2013 \u0421\u0447\u0435\u0442 \u0437\u0430\u043a\u0440\u044b\u0442<\/td>\n<\/tr>\n<tr>\n<td>14 \u2013 \u041f\u0435\u0440\u0435\u0434\u0430\u043d \u043d\u0430 \u043e\u0431\u0441\u043b\u0443\u0436\u0438\u0432\u0430\u043d\u0438\u0435 \u0432 \u0434\u0440\u0443\u0433\u043e\u0439 \u0431\u0430\u043d\u043a<\/td>\n<\/tr>\n<tr>\n<td>21 \u2013 \u0421\u043f\u043e\u0440<\/td>\n<\/tr>\n<tr>\n<td>52 \u2013 \u041f\u0440\u043e\u0441\u0440\u043e\u0447\u0435\u043d<\/td>\n<\/tr>\n<tr>\n<td>61 \u2013 \u041f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0441 \u0432\u043e\u0437\u0432\u0440\u0430\u0442\u043e\u043c<\/td>\n<\/tr>\n<tr>\n<td><i>OUTSTANDING<\/i><\/td>\n<td>\u041e\u0441\u0442\u0430\u0432\u0448\u0430\u044f\u0441\u044f \u043d\u0435\u043f\u043e\u0433\u0430\u0448\u0435\u043d\u043d\u0430\u044f \u0437\u0430\u0434\u043e\u043b\u0436\u0435\u043d\u043d\u043e\u0441\u0442\u044c. \u0421\u0443\u043c\u043c\u0430 \u0432 \u0440\u0443\u0431\u043b\u044f\u0445 \u043f\u043e \u043a\u0443\u0440\u0441\u0443 \u0426\u0411 \u0420\u0424<\/td>\n<\/tr>\n<tr>\n<td><i>NEXT_PMT<\/i>  <\/td>\n<td>\u0420\u0430\u0437\u043c\u0435\u0440 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u043f\u043b\u0430\u0442\u0435\u0436\u0430. \u0421\u0443\u043c\u043c\u0430 \u0432 \u0440\u0443\u0431\u043b\u044f\u0445 \u043f\u043e \u043a\u0443\u0440\u0441\u0443 \u0426\u0411 \u0420\u0424<\/td>\n<\/tr>\n<tr>\n<td><i>INF_CONFIRM_DATE<\/i><\/td>\n<td>\u0414\u0430\u0442\u0430 \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043f\u043e \u0441\u0447\u0435\u0442\u0443<\/td>\n<\/tr>\n<tr>\n<td><i>FACT_CLOSE_DATE<\/i>  <\/td>\n<td>\u0414\u0430\u0442\u0430 \u0437\u0430\u043a\u0440\u044b\u0442\u0438\u044f \u0441\u0447\u0435\u0442\u0430 (\u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f)  <\/td>\n<\/tr>\n<tr>\n<td><i>TTL_DELQ_5<\/i>  <\/td>\n<td>\u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u0440\u043e\u0441\u0440\u043e\u0447\u0435\u043a \u0434\u043e 5 \u0434\u043d\u0435\u0439  <\/td>\n<\/tr>\n<tr>\n<td><i>TTL_DELQ_5_29<\/i>  <\/td>\n<td>\u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u0440\u043e\u0441\u0440\u043e\u0447\u0435\u043a \u043e\u0442 5 \u0434\u043e 29 \u0434\u043d\u0435\u0439  <\/td>\n<\/tr>\n<tr>\n<td><i>TTL_DELQ_30_59<\/i>  <\/td>\n<td>\u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u0440\u043e\u0441\u0440\u043e\u0447\u0435\u043a \u043e\u0442 30 \u0434\u043e 59 \u0434\u043d\u0435\u0439  <\/td>\n<\/tr>\n<tr>\n<td><i>TTL_DELQ_60_89<\/i>  <\/td>\n<td>\u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u0440\u043e\u0441\u0440\u043e\u0447\u0435\u043a \u043e\u0442 60 \u0434\u043e 89 \u0434\u043d\u0435\u0439  <\/td>\n<\/tr>\n<tr>\n<td><i>TTL_DELQ_30<\/i>  <\/td>\n<td>\u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u0440\u043e\u0441\u0440\u043e\u0447\u0435\u043a \u0434\u043e 30 \u0434\u043d\u0435\u0439  <\/td>\n<\/tr>\n<tr>\n<td><i>TTL_DELQ_90_PLUS<\/i>  <\/td>\n<td>\u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u0440\u043e\u0441\u0440\u043e\u0447\u0435\u043a 90+ \u0434\u043d\u0435\u0439  <\/td>\n<\/tr>\n<tr>\n<td><i>PMT_FREQ<\/i>  <\/td>\n<td>\u041a\u043e\u0434 \u0447\u0430\u0441\u0442\u043e\u0442\u044b \u043f\u043b\u0430\u0442\u0435\u0436\u0435\u0439  <\/td>\n<\/tr>\n<tr>\n<td rowspan=\"9\">\u00a0<\/td>\n<td>1 \u2013 \u0415\u0436\u0435\u043d\u0435\u0434\u0435\u043b\u044c\u043d\u043e  <\/td>\n<\/tr>\n<tr>\n<td>2 \u2013 \u0420\u0430\u0437 \u0432 \u0434\u0432\u0435 \u043d\u0435\u0434\u0435\u043b\u0438  <\/td>\n<\/tr>\n<tr>\n<td>3 \u2013 \u0415\u0436\u0435\u043c\u0435\u0441\u044f\u0447\u043d\u043e  <\/td>\n<\/tr>\n<tr>\n<td>A \u2014 \u0420\u0430\u0437 \u0432 2 \u043c\u0435\u0441\u044f\u0446\u0430  <\/td>\n<\/tr>\n<tr>\n<td>4 \u2013 \u041f\u043e\u043a\u0432\u0430\u0440\u0442\u0430\u043b\u044c\u043d\u043e  <\/td>\n<\/tr>\n<tr>\n<td>B \u2014 \u0420\u0430\u0437 \u0432 4 \u043c\u0435\u0441\u044f\u0446\u0430  <\/td>\n<\/tr>\n<tr>\n<td>5 \u2013 \u0420\u0430\u0437 \u0432 \u043f\u043e\u043b\u0433\u043e\u0434\u0430  <\/td>\n<\/tr>\n<tr>\n<td>6 \u2014 \u0415\u0436\u0435\u0433\u043e\u0434\u043d\u043e  <\/td>\n<\/tr>\n<tr>\n<td>7 \u2013 \u0414\u0440\u0443\u0433\u043e\u0435  <\/td>\n<\/tr>\n<tr>\n<td><i>CREDIT_LIMIT<\/i>  <\/td>\n<td>\u041a\u0440\u0435\u0434\u0438\u0442\u043d\u044b\u0439 \u043b\u0438\u043c\u0438\u0442. \u0421\u0443\u043c\u043c\u0430 \u0432 \u0440\u0443\u0431\u043b\u044f\u0445 \u043f\u043e \u043a\u0443\u0440\u0441\u0443 \u0426\u0411 \u0420\u0424  <\/td>\n<\/tr>\n<tr>\n<td><i>DELQ_BALANCE<\/i>  <\/td>\n<td>\u0422\u0435\u043a\u0443\u0449\u0430\u044f \u043f\u0440\u043e\u0441\u0440\u043e\u0447\u0435\u043d\u043d\u0430\u044f \u0437\u0430\u0434\u043e\u043b\u0436\u0435\u043d\u043d\u043e\u0441\u0442\u044c. \u0421\u0443\u043c\u043c\u0430 \u0432 \u0440\u0443\u0431\u043b\u044f\u0445 \u043f\u043e \u043a\u0443\u0440\u0441\u0443 \u0426\u0411 \u0420\u0424  <\/td>\n<\/tr>\n<tr>\n<td><i>MAX_DELQ_BALANCE<\/i>  <\/td>\n<td>\u041c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u043e\u0431\u044a\u0435\u043c \u043f\u0440\u043e\u0441\u0440\u043e\u0447\u0435\u043d\u043d\u043e\u0439 \u0437\u0430\u0434\u043e\u043b\u0436\u0435\u043d\u043d\u043e\u0441\u0442\u0438. \u0421\u0443\u043c\u043c\u0430 \u0432 \u0440\u0443\u0431\u043b\u044f\u0445 \u043f\u043e \u043a\u0443\u0440\u0441\u0443 \u0426\u0411 \u0420\u0424  <\/td>\n<\/tr>\n<tr>\n<td><i>CURRENT_DELQ<\/i>  <\/td>\n<td>\u0422\u0435\u043a\u0443\u0449\u0435\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0434\u043d\u0435\u0439 \u043f\u0440\u043e\u0441\u0440\u043e\u0447\u043a\u0438  <\/td>\n<\/tr>\n<tr>\n<td><i>PMT_STRING_START<\/i>  <\/td>\n<td>\u0414\u0430\u0442\u0430 \u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u0442\u0440\u043e\u043a\u0438 PMT_STRING_84M  <\/td>\n<\/tr>\n<tr>\n<td><i>INTEREST_RATE<\/i>  <\/td>\n<td>\u041f\u0440\u043e\u0446\u0435\u043d\u0442\u043d\u0430\u044f \u0441\u0442\u0430\u0432\u043a\u0430 \u043f\u043e \u043a\u0440\u0435\u0434\u0438\u0442\u0443  <\/td>\n<\/tr>\n<tr>\n<td><i>CURR_BALANCE_AMT<\/i>  <\/td>\n<td>\u041e\u0431\u0449\u0430\u044f \u0432\u044b\u043f\u043b\u0430\u0447\u0435\u043d\u043d\u0430\u044f \u0441\u0443\u043c\u043c\u0430, \u0432\u043a\u043b\u044e\u0447\u0430\u044f \u0441\u0443\u043c\u043c\u0443 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0433\u043e \u0434\u043e\u043b\u0433\u0430, \u043f\u0440\u043e\u0446\u0435\u043d\u0442\u044b, \u043f\u0435\u043d\u0438 \u0438 \u0448\u0442\u0440\u0430\u0444\u044b. \u0421\u0443\u043c\u043c\u0430 \u0432 \u0440\u0443\u0431\u043b\u044f\u0445 \u043f\u043e \u043a\u0443\u0440\u0441\u0443 \u0426\u0411 \u0420\u0424  <\/td>\n<\/tr>\n<\/table>\n<p>  <\/div>\n<\/div>\n<p>  \u0417\u0430\u0434\u0430\u0447\u0430 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u043d\u0430 \u0432\u044b\u0431\u043e\u0440\u043a\u0435 <i>\u00abtrain\u00bb<\/i> \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u044c, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0449\u0443\u044e \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u00ab\u0434\u0435\u0444\u043e\u043b\u0442\u0430\u00bb, \u0438 \u043f\u0440\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0438 \u0435\u0435 \u043f\u043e \u043a\u043b\u0438\u0435\u043d\u0442\u0430\u043c \u0438\u0437 \u0432\u044b\u0431\u043e\u0440\u043a\u0438 <i>\u00abtest\u00bb<\/i>. \u0414\u043b\u044f \u043e\u0446\u0435\u043d\u043a\u0438 \u043c\u043e\u0434\u0435\u043b\u0438 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u0438\u0441\u0442\u0438\u043a\u0430 <b>Area Under ROC Curve<\/b> (\u0442\u0430\u043a\u0436\u0435 \u0443\u043a\u0430\u0437\u0430\u043d\u043e \u0432 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u0445 \u0437\u0430\u0434\u0430\u0447\u0438).<\/p>\n<h4>\u041f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445<\/h4>\n<p>  \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b \u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u043d\u0438\u0445:  <\/p>\n<pre><code class=\"python\">from pandas import read_csv, DataFrame from sklearn.metrics import roc_curve from sklearn.ensemble import RandomForestClassifier, GradientBoostingClassifier from sklearn.cross_validation import train_test_split from sklearn.naive_bayes import GaussianNB from sklearn.neighbors import KNeighborsClassifier from sklearn.decomposition import PCA import ml_metrics, string, re, pylab as pl  SampleCustomers = read_csv(&quot;https:\/\/static.tcsbank.ru\/documents\/olymp\/SAMPLE_CUSTOMERS.csv&quot;, ';') SampleAccounts = read_csv(&quot;https:\/\/static.tcsbank.ru\/documents\/olymp\/SAMPLE_ACCOUNTS.csv&quot;,&quot;;&quot;,decimal =',')  print SampleAccounts <\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"http:\/\/habr.habrastorage.org\/post_images\/428\/028\/3df\/4280283df2545a36cc1c3220e32badea.png\" alt=\"image\"\/><\/p>\n<pre><code class=\"python\">SampleCustomers.head()<\/code><\/pre>\n<p>  <\/p>\n<table>\n<tr>\n<th><\/th>\n<th>tcs_customer_id<\/th>\n<th>bad<\/th>\n<th>sample_type<\/th>\n<\/tr>\n<tr>\n<th>0<\/th>\n<td> 1<\/td>\n<td>NaN<\/td>\n<td> test<\/td>\n<\/tr>\n<tr>\n<th>1<\/th>\n<td> 2<\/td>\n<td> 0<\/td>\n<td> train<\/td>\n<\/tr>\n<tr>\n<th>2<\/th>\n<td> 3<\/td>\n<td> 1<\/td>\n<td> train<\/td>\n<\/tr>\n<tr>\n<th>3<\/th>\n<td> 4<\/td>\n<td> 0<\/td>\n<td> train<\/td>\n<\/tr>\n<tr>\n<th>4<\/th>\n<td> 5<\/td>\n<td> 0<\/td>\n<td> train<\/td>\n<\/tr>\n<\/table>\n<p>  \u0418\u0437 \u0443\u0441\u043b\u043e\u0432\u0438\u0439 \u0437\u0430\u0434\u0430\u0447\u0438 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u0442\u044c, \u0447\u0442\u043e \u043d\u0430\u0431\u043e\u0440 SampleAccounts \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u043f\u0438\u0441\u0435\u0439 \u043f\u043e \u043e\u0434\u043d\u043e\u043c\u0443 \u0437\u0430\u0435\u043c\u0449\u0438\u043a\u0443 \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043c \u044d\u0442\u043e:<\/p>\n<pre><code class=\"python\">SampleAccounts.tcs_customer_id.drop_duplicates().count(), SampleAccounts.tcs_customer_id.count()<\/code><\/pre>\n<p>  \u041d\u0430\u0448\u0435 \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0432\u0435\u0440\u043d\u044b\u043c. \u0423\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0445 \u0437\u0430\u0435\u043c\u0449\u0438\u043a\u043e\u0432 50000 \u0438\u0437 280942 \u0437\u0430\u043f\u0438\u0441\u0435\u0439. \u042d\u0442\u043e \u0441\u0432\u044f\u0437\u0430\u043d\u043e \u0441 \u0442\u0435\u043c, \u0447\u0442\u043e \u0443 \u043e\u0434\u043d\u043e \u0437\u0430\u0435\u043c\u0449\u0438\u043a\u0430 \u0431\u044b\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043a\u0440\u0435\u0434\u0438\u0442\u043e\u0432 \u0438 \u043f\u043e \u043a\u0430\u0436\u0434\u043e\u043c\u0443 \u0438\u0437 \u043d\u0438\u0445 \u0432 \u0440\u0430\u0437\u043d\u044b\u0445 \u0431\u044e\u0440\u043e \u043c\u043e\u0442\u0435 \u0431\u044b\u0442\u044c \u0440\u0430\u0437\u043d\u0430\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f. \u0421\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u043d\u0430\u0434\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043d\u0430\u0434 SampleAccounts, \u0447\u0442\u043e\u0431\u044b \u043e\u0434\u043d\u043e\u043c\u0443 \u0437\u0430\u0435\u043c\u0449\u0438\u043a\u0443 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043e\u0432\u0430\u043b\u0430 \u043e\u0434\u043d\u0430 \u0441\u0442\u0440\u043e\u043a\u0430.<br \/>  \u0422\u0435\u043f\u0435\u0440\u044c \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u0441\u043f\u0438\u0441\u043e\u043a \u0432\u0441\u0435 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0445 \u043a\u0440\u0435\u0434\u0438\u0442\u043e\u0432 \u043f\u043e \u043a\u0430\u0436\u0434\u043e\u043c\u0443 \u0437\u0430\u0435\u043c\u0449\u0438\u043a\u0443:<\/p>\n<pre><code class=\"python\">SampleAccounts[['tcs_customer_id','open_date','final_pmt_date','credit_limit','currency']].drop_duplicates()<\/code><\/pre>\n<p>  \u0421\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u043a\u043e\u0433\u0434\u0430 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u0441\u043f\u0438\u0441\u043e\u043a \u043a\u0440\u0435\u0434\u0438\u0442\u043e\u0432, \u043c\u044b \u0441\u043c\u043e\u0436\u0435\u043c \u0432\u044b\u0432\u0435\u0441\u0442\u0438 \u043a\u0430\u043a\u0443\u044e-\u043b\u0438\u0431\u043e \u043e\u0431\u0449\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043f\u043e \u043a\u0430\u0436\u0434\u043e\u043c\u0443 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0443 \u0441\u043f\u0438\u0441\u043a\u0430. \u0422.\u0435. \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u0432\u0437\u044f\u0442\u044c \u0441\u0432\u044f\u0437\u043a\u0443 \u0438\u0437 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u0445 \u0432\u044b\u0448\u0435 \u043f\u043e\u043b\u0435\u0439 \u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0435\u0435 \u0438\u043d\u0434\u0435\u043a\u0441\u043e\u043c, \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043c\u044b \u0431\u044b \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u043b\u0438 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0438\u0435 \u043c\u0430\u043d\u0438\u043f\u0443\u043b\u044f\u0446\u0438\u0438, \u043d\u043e, \u043a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u0442\u0443\u0442 \u043d\u0430\u0441 \u043f\u043e\u0434\u0441\u0442\u0435\u0440\u0435\u0433\u0430\u0435\u0442 \u043e\u0434\u0438\u043d \u043d\u0435\u043f\u0440\u0438\u044f\u0442\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442. \u041e\u043d \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043f\u043e\u043b\u0435 &#8216;final_pmt_date&#8217; \u0432 \u043d\u0430\u0431\u043e\u0440\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u043c\u0435\u0435\u0442 \u043d\u0435\u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0438\u0437\u0431\u0430\u0432\u0438\u0442\u044c\u0441\u044f \u043e\u0442 \u043d\u0438\u0445.<br \/>  \u0423 \u043d\u0430\u0441 \u0432 \u043d\u0430\u0431\u043e\u0440\u0435 \u0435\u0441\u0442\u044c \u043f\u043e\u043b\u0435 \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0434\u0430\u0442\u0430 \u0437\u0430\u043a\u0440\u044b\u0442\u0438\u044f \u043a\u0440\u0435\u0434\u0438\u0442\u0430, \u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u0435\u0441\u043b\u0438 \u043e\u043d\u0430 \u0435\u0441\u0442\u044c, \u0430 \u043f\u043e\u043b\u0435 &#8216;final_pmt_date&#8217; \u043d\u0435 \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u043e, \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0432 \u043d\u0435\u0433\u043e \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435. \u0414\u043b\u044f \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0445 \u0436\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u0437\u0430\u043f\u0438\u0448\u0435\u043c 0.<\/p>\n<pre><code class=\"python\">SampleAccounts.final_pmt_date[SampleAccounts.final_pmt_date.isnull()] = SampleAccounts.fact_close_date[SampleAccounts.final_pmt_date.isnull()].astype(float) SampleAccounts.final_pmt_date.fillna(0, inplace=True) <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c, \u043a\u043e\u0433\u0434\u0430 \u043e\u0442 \u043f\u0443\u0441\u0442\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u043c\u044b \u0438\u0437\u0431\u0430\u0432\u0438\u043b\u0438\u0441\u044c, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u0441\u0430\u043c\u0443\u044e \u0441\u0432\u0435\u0436\u0443\u044e \u0434\u0430\u0442\u0443 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u0432 \u043a\u0430\u043a\u043e\u0435-\u043b\u0438\u0431\u043e \u0438\u0437 \u0431\u044e\u0440\u043e \u043f\u043e \u043a\u0430\u0436\u0434\u043e\u043c\u0443 \u0438\u0437 \u043a\u0440\u0435\u0434\u0438\u0442\u043e\u0432. \u042d\u0442\u043e \u043f\u0440\u0438\u0433\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u043d\u0430\u043c \u0434\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0435\u0433\u043e \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432, \u0442\u0430\u043a\u0438\u0445 \u043a\u0430\u043a \u0441\u0442\u0430\u0442\u0443\u0441 \u0434\u043e\u0433\u043e\u0432\u043e\u0440\u0430, \u0442\u0438\u043f \u0438 \u0442.\u0434.<\/p>\n<pre><code class=\"python\">sumtbl = SampleAccounts.pivot_table(['inf_confirm_date'],  ['tcs_customer_id','open_date','final_pmt_date','credit_limit','currency'], aggfunc='max') sumtbl.head(15) <\/code><\/pre>\n<p>  <\/p>\n<table>\n<tr>\n<th><\/th>\n<th><\/th>\n<th><\/th>\n<th><\/th>\n<th><\/th>\n<th>inf_confirm_date<\/th>\n<\/tr>\n<tr>\n<th>tcs_customer_id<\/th>\n<th>open_date<\/th>\n<th>final_pmt_date<\/th>\n<th>credit_limit<\/th>\n<th>currency<\/th>\n<th><\/th>\n<\/tr>\n<tr>\n<td rowspan=\"8\">1<\/td>\n<td>39261<\/td>\n<td>39629<\/td>\n<td>19421 <\/td>\n<td>RUB<\/td>\n<td> 39924<\/td>\n<\/tr>\n<tr>\n<td>39505<\/td>\n<td>39870<\/td>\n<td>30000 <\/td>\n<td>RUB<\/td>\n<td> 39862<\/td>\n<\/tr>\n<tr>\n<td>39644<\/td>\n<td>40042<\/td>\n<td>11858 <\/td>\n<td>RUB<\/td>\n<td> 40043<\/td>\n<\/tr>\n<tr>\n<td>39876<\/td>\n<td>41701<\/td>\n<td>300000<\/td>\n<td>RUB<\/td>\n<td> 40766<\/td>\n<\/tr>\n<tr>\n<td>39942<\/td>\n<td>40308<\/td>\n<td>19691 <\/td>\n<td>RUB<\/td>\n<td> 40435<\/td>\n<\/tr>\n<tr>\n<td>40421<\/td>\n<td>42247<\/td>\n<td>169000<\/td>\n<td>RUB<\/td>\n<td> 40756<\/td>\n<\/tr>\n<tr>\n<td>40428<\/td>\n<td>51386<\/td>\n<td>10000 <\/td>\n<td>RUB<\/td>\n<td> 40758<\/td>\n<\/tr>\n<tr>\n<td>40676<\/td>\n<td>41040<\/td>\n<td>28967 <\/td>\n<td>RUB<\/td>\n<td> 40764<\/td>\n<\/tr>\n<tr>\n<td rowspan=\"2\">2<\/td>\n<td>40472<\/td>\n<td>40618<\/td>\n<td>7551 <\/td>\n<td>RUB<\/td>\n<td> 40661<\/td>\n<\/tr>\n<tr>\n<td>40652<\/td>\n<td>40958<\/td>\n<td>21186 <\/td>\n<td>RUB<\/td>\n<td> 40661<\/td>\n<\/tr>\n<tr>\n<td rowspan=\"2\">3<\/td>\n<td>39647<\/td>\n<td>40068<\/td>\n<td>22694 <\/td>\n<td>RUB<\/td>\n<td> 40069<\/td>\n<\/tr>\n<tr>\n<td>40604<\/td>\n<td>0 <\/td>\n<td>20000 <\/td>\n<td>RUB<\/td>\n<td> 40624<\/td>\n<\/tr>\n<tr>\n<td rowspan=\"3\">4<\/td>\n<td>38552<\/td>\n<td>40378<\/td>\n<td>75000 <\/td>\n<td>RUB<\/td>\n<td> 40479<\/td>\n<\/tr>\n<tr>\n<td>39493<\/td>\n<td>39797<\/td>\n<td>5000 <\/td>\n<td>RUB<\/td>\n<td> 39823<\/td>\n<\/tr>\n<tr>\n<td>39759<\/td>\n<td>40123<\/td>\n<td>6023 <\/td>\n<td>RUB<\/td>\n<td> 40125<\/td>\n<\/tr>\n<\/table>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0435 \u043d\u0430\u043c\u0438 \u0434\u0430\u0442\u044b \u043a \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c\u0443 \u043d\u0430\u0431\u043e\u0440\u0443:<\/p>\n<pre><code class=\"python\">SampleAccounts = SampleAccounts.merge(sumtbl, 'left',                                       left_on=['tcs_customer_id','open_date','final_pmt_date','credit_limit','currency'],                                       right_index=True,                                      suffixes=('', '_max'))<\/code><\/pre>\n<p>  \u0418\u0442\u0430\u043a, \u0434\u0430\u043b\u0435\u0435 \u043c\u044b \u0440\u0430\u0437\u043e\u0431\u044c\u0435\u043c \u0441\u0442\u043e\u043b\u0431\u044b, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0441\u0442\u0440\u043e\u0433\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u044b, \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u043a\u0430\u0436\u0434\u043e\u043c\u0443 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044e \u0438\u0437 \u044d\u0442\u0438\u0445 \u043f\u043e\u043b\u0435\u0439 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043e\u0432\u0430\u043b \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0441\u0442\u043e\u043b\u0431\u0435\u0446. \u041f\u043e \u0443\u0441\u043b\u043e\u0432\u0438\u044e \u0441\u0442\u043e\u043b\u0431\u0446\u0430\u043c\u0438 \u0441 \u0437\u0430\u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438 \u0431\u0443\u0434\u0443\u0442:  <\/p>\n<ul>\n<li>pmt_string_84m<\/li>\n<li>pmt_freq<\/li>\n<li>type<\/li>\n<li>status<\/li>\n<li>relationship<\/li>\n<li>bureau_cd<\/li>\n<\/ul>\n<p>  \u041a\u043e\u0434 \u0434\u043b\u044f \u0438\u0445 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d \u043d\u0438\u0436\u0435:<\/p>\n<pre><code class=\"python\"># \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u043c pmt_string_84m vals = list(xrange(10)) + ['A','X'] PMTstr = DataFrame([{'pmt_string_84m_%s' % (str(j)): str(i).count(str(j)) for j in vals} for i in SampleAccounts.pmt_string_84m]) SampleAccounts = SampleAccounts.join(PMTstr).drop(['pmt_string_84m'], axis=1)  # \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u043c pmt_freq SampleAccounts.pmt_freq.fillna(7, inplace=True) SampleAccounts.pmt_freq[SampleAccounts.pmt_freq == 0] = 7 vals = list(range(1,8)) + ['A','B'] PMTstr = DataFrame([{'pmt_freq_%s' % (str(j)): str(i).count(str(j)) for j in vals} for i in SampleAccounts.pmt_freq]) SampleAccounts = SampleAccounts.join(PMTstr).drop(['pmt_freq'], axis=1)  # \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u043c type vals = [1,4,6,7,9,10,11,12,13,14,99] PMTstr = DataFrame([{'type_%s' % (str(j)): str(i).count(str(j)) for j in vals} for i in SampleAccounts.type]) SampleAccounts = SampleAccounts.join(PMTstr).drop(['type'], axis=1)  # \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u043c status vals = [0,12, 13, 14, 21, 52,61] PMTstr = DataFrame([{'status_%s' % (str(j)): str(i).count(str(j)) for j in vals} for i in SampleAccounts.status]) SampleAccounts = SampleAccounts.join(PMTstr).drop(['status'], axis=1)  # \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u043c relationship vals = [1,2,4,5,9] PMTstr = DataFrame([{'relationship_%s' % (str(j)): str(i).count(str(j)) for j in vals} for i in SampleAccounts.relationship]) SampleAccounts = SampleAccounts.join(PMTstr).drop(['relationship'], axis=1)  # \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u043c bureau_cd vals = [1,2,3] PMTstr = DataFrame([{'bureau_cd_%s' % (str(j)): str(i).count(str(j)) for j in vals} for i in SampleAccounts.bureau_cd]) SampleAccounts = SampleAccounts.join(PMTstr).drop(['bureau_cd'], axis=1) <\/code><\/pre>\n<p>  \u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u0448\u0430\u0433\u043e\u043c, \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u043c \u043f\u043e\u043b\u0435 &#8216;fact_close_date&#8217;, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442\u0441\u044f \u0434\u0430\u0442\u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0433\u043e \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043f\u043b\u0430\u0442\u0435\u0436\u0430, \u0447\u0442\u043e\u0431\u044b \u0432 \u043d\u0435\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u043b\u043e\u0441\u044c \u0442\u043e\u043b\u044c\u043a\u043e 2 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f:  <\/p>\n<ul>\n<li>0 \u2014 \u043d\u0435 \u0431\u044b\u043b\u043e \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0433\u043e \u043f\u043b\u0430\u0442\u0435\u0436\u0430<\/li>\n<li>1 \u2014 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u043f\u043b\u0430\u0442\u0435\u0436 \u0431\u044b\u043b<\/li>\n<\/ul>\n<p>  \u0414\u0430\u043d\u043d\u0443\u044e \u0437\u0430\u043c\u0435\u043d\u0443 \u044f \u0441\u0434\u0435\u043b\u0430\u043b \u043f\u043e\u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u043f\u043e\u043b\u0435 \u0431\u044b\u043b\u043e \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u043e \u043d\u0430\u043f\u043e\u043b\u043e\u0432\u0438\u043d\u0443.<\/p>\n<pre><code class=\"python\">SampleAccounts.fact_close_date[SampleAccounts.fact_close_date.notnull()] = 1 SampleAccounts.fact_close_date.fillna(0, inplace=True) <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0438\u0437 \u043d\u0430\u0448\u0435\u0433\u043e \u043d\u0430\u0431\u043e\u0440\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0430\u043c \u043d\u0430\u0434\u043e \u0432\u044b\u0442\u0430\u0449\u0438\u0442\u044c \u0441\u0432\u0435\u0436\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u043e \u0432\u0441\u0435\u043c \u043a\u0440\u0435\u0434\u0438\u0442\u0430\u043c. \u0412 \u044d\u0442\u043e\u043c \u043d\u0430\u043c \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043b\u0435 <i>\u00abinf_confirm_date_max\u00bb<\/i>, \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u0435 \u0432\u044b\u0448\u0435. \u0412 \u043d\u0435\u0433\u043e \u043c\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 \u043a\u0440\u0430\u0439\u043d\u044e\u044e \u0434\u0430\u0442\u0443 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043f\u043e \u043a\u0440\u0435\u0434\u0438\u0442\u0443 \u0432\u043e \u0432\u0441\u0435\u0445 \u0431\u044e\u0440\u043e:<\/p>\n<pre><code class=\"python\">PreFinalDS = SampleAccounts[SampleAccounts.inf_confirm_date == SampleAccounts.inf_confirm_date_max].drop_duplicates()<\/code><\/pre>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u0432\u044b\u0448\u0435\u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0445 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 \u043d\u0430\u0448\u0430 \u0432\u044b\u0431\u043e\u0440\u043a\u0430 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0441\u043e\u043a\u0440\u0430\u0442\u0438\u043b\u0430\u0441\u044c, \u043d\u043e \u0442\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u043c \u043d\u0430\u0434\u043e \u043e\u0431\u043e\u0431\u0449\u0438\u0442\u044c \u0432\u0441\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043f\u043e \u043a\u0440\u0435\u0434\u0438\u0442\u0443 \u0438 \u0437\u0430\u0435\u043c\u0449\u0438\u043a\u0443 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u0443\u044e \u0440\u0430\u043d\u0435\u0435. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043c \u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u043a\u0443 \u043d\u0430\u0448\u0435\u0433\u043e \u043d\u0430\u0431\u043e\u0440\u0430 \u0434\u0430\u043d\u043d\u044b\u0445:<\/p>\n<pre><code class=\"python\">PreFinalDS = PreFinalDS.groupby(['tcs_customer_id','open_date','final_pmt_date','credit_limit','currency']).max().reset_index()<\/code><\/pre>\n<p>  \u041d\u0430\u0448\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u0447\u0442\u0438 \u0433\u043e\u0442\u043e\u0432\u044b \u043a \u043d\u0430\u0447\u0430\u043b\u0443 \u0430\u043d\u0430\u043b\u0438\u0437\u0430. \u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0435\u0449\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439:  <\/p>\n<ol>\n<li>\u0423\u0431\u0440\u0430\u0442\u044c \u043d\u0435 \u043d\u0443\u0436\u043d\u044b\u0435 \u0441\u0442\u043e\u043b\u0431\u0446\u044b<\/li>\n<li>\u041f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u0432\u0441\u0435 \u043a\u0440\u0435\u0434\u0438\u0442\u043d\u044b\u0435 \u043b\u0438\u043c\u0438\u0442\u044b \u0432 \u0440\u0443\u0431\u043b\u0438<\/li>\n<li>\u041f\u043e\u0441\u0447\u0438\u0442\u0430\u0442\u044c \u043a\u0430\u043a\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043a\u0440\u0435\u0434\u0438\u0442\u043e\u0432 \u0443 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0437\u0430\u0435\u043c\u0449\u0438\u043a\u0430 \u043f\u043e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e\u0442 \u0431\u044e\u0440\u043e<\/li>\n<\/ol>\n<p>  \u041d\u0430\u0447\u043d\u0435\u043c \u0441 \u043e\u0447\u0438\u0441\u0442\u043a\u0438 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u043e\u0442 \u043d\u0435\u043d\u0443\u0436\u043d\u044b\u0445 \u0441\u0442\u043e\u043b\u0431\u0446\u043e\u0432:<\/p>\n<pre><code class=\"python\">PreFinalDS = PreFinalDS.drop(['bki_request_date',                               'inf_confirm_date',                               'pmt_string_start',                               'interest_rate',                               'open_date',                               'final_pmt_date',                               'inf_confirm_date_max'], axis=1) <\/code><\/pre>\n<p>  \u0414\u0430\u043b\u0435\u0435 \u043f\u0435\u0440\u0435\u0432\u0435\u0434\u0435\u043c \u0432\u0441\u0435 \u043a\u0440\u0435\u0434\u0438\u0442\u043d\u044b\u0435 \u043b\u0438\u043c\u0438\u0442\u044b \u043a \u0440\u0443\u0431\u043b\u044f\u043c. \u0414\u043b\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u044b \u044f \u0432\u0437\u044f\u043b \u043a\u0443\u0440\u0441\u044b \u0432\u0430\u043b\u044e\u0442 \u043d\u0430 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u043c\u043e\u043c\u0435\u043d\u0442. \u0425\u043e\u0442\u044f \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u0435\u0435 \u043d\u0430\u0432\u0435\u0440\u043d\u043e\u0435 \u0431\u044b\u043b\u043e \u0431\u044b \u0431\u0440\u0430\u0442\u044c \u043a\u0443\u0440\u0441 \u043d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u043e\u0442\u043a\u0440\u044b\u0442\u0438\u044f \u0441\u0447\u0435\u0442\u0430. \u0415\u0449\u0435 \u043e\u0434\u0438\u043d \u043d\u044e\u0430\u043d\u0441, \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0434\u043b\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u043d\u0430\u043c \u043d\u0430\u0434\u043e \u0443\u0431\u0440\u0430\u0442\u044c \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u0435 \u043f\u043e\u043b\u0435 <i>\u00ab\u0441urrency\u00bb<\/i>, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u043e\u0441\u043b\u0435 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0430 \u0432\u0430\u043b\u044e\u0442 \u0432 \u0440\u0443\u0431\u043b\u0438 \u043c\u044b \u043f\u0440\u043e\u0432\u0435\u0434\u0435\u043c \u0441 \u044d\u0442\u0438\u043c \u043f\u043e\u043b\u0435\u043c \u043c\u0430\u043d\u0438\u043f\u0443\u043b\u044f\u0446\u0438\u044e, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u044b \u043f\u0440\u043e\u0432\u0435\u043b\u0438 \u0441 \u043f\u043e\u043b\u044f\u043c\u0438 \u0432\u044b\u0448\u0435:<\/p>\n<pre><code class=\"python\">curs = DataFrame([33.13,44.99,36.49,1], index=['USD','EUR','GHF','RUB'], columns=['crs']) PreFinalDS = PreFinalDS.merge(curs, 'left', left_on='currency', right_index=True) PreFinalDS.credit_limit = PreFinalDS.credit_limit * PreFinalDS.crs  #\u0432\u044b\u0434\u0435\u043b\u044f\u0435\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u0441\u0442\u043e\u043b\u0431\u0446\u044b vals = ['RUB','USD','EUR','CHF'] PMTstr = DataFrame([{'currency_%s' % (str(j)): str(i).count(str(j)) for j in vals} for i in PreFinalDS.currency]) PreFinalDS = PreFinalDS.join(PMTstr).drop(['currency','crs'], axis=1) <\/code><\/pre>\n<p>  \u0418\u0442\u0430\u043a \u043f\u0435\u0440\u0435\u0434 \u0437\u0430\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u043a\u043e\u0439 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043a \u043d\u0430\u0448\u0435\u043c\u0443 \u043d\u0430\u0431\u043e\u0440\u0443 \u043f\u043e\u043b\u0435 \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u043d\u043e\u0435 \u0435\u0434\u0438\u043d\u0438\u0446\u0430\u043c\u0438. \u0422.\u0435. \u043a\u043e\u0433\u0434\u0430 \u043c\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043c \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u044e\u044e \u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u043a\u0443, \u0441\u0443\u043c\u043c\u0430 \u043f\u043e \u043d\u0435\u043c\u0443 \u0434\u0430\u0441\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043a\u0440\u0435\u0434\u0438\u0442\u043e\u0432 \u0443 \u0437\u0430\u0435\u043c\u0449\u0438\u043a\u0430:<\/p>\n<pre><code class=\"python\">PreFinalDS['count_credit'] = 1<\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c, \u043a\u043e\u0433\u0434\u0430 \u0443 \u043d\u0430\u0441 \u0432 \u043d\u0430\u0431\u043e\u0440\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432\u0441\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435, \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043f\u0440\u043e\u0431\u0435\u043b\u044b \u0432 \u0434\u0430\u043d\u043d\u044b\u0445 0 \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0437\u0430\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u043a\u0443 \u043f\u043e \u043a\u043b\u0438\u0435\u043d\u0442\u0443:  <\/p>\n<pre><code class=\"python\">PreFinalDS.fillna(0, inplace=True) FinalDF = PreFinalDS.groupby('tcs_customer_id').sum() FinalDF <\/code><\/pre>\n<h4>\u041f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0430\u043d\u0430\u043b\u0438\u0437<\/h4>\n<p>  \u041d\u0443 \u0447\u0442\u043e \u0436\u0435 \u043f\u0435\u0440\u0432\u0438\u0447\u043d\u0430\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0430 \u0438 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u0442\u044c \u043a \u0438\u0445 \u0430\u043d\u0430\u043b\u0438\u0437\u0443. \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u043c \u043d\u0430\u0448\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0430 \u043e\u0431\u0443\u0447\u0430\u044e\u0449\u0443\u044e \u0438 \u0442\u0435\u0441\u0442\u043e\u0432\u0443\u044e \u0432\u044b\u0431\u043e\u0440\u043a\u0438. \u0412 \u044d\u0442\u043e\u043c \u043d\u0430\u043c \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u0441\u0442\u043e\u043b\u0431\u0435\u0446 <i>\u00absample_type\u00bb<\/i> \u0438\u0437 SampleCustomers, \u043f\u043e \u043d\u0435\u043c\u0443 \u043a\u0430\u043a \u0440\u0430\u0437 \u0441\u0434\u0435\u043b\u0430\u043d\u043e \u0442\u0430\u043a\u043e\u0435 \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u0435.<br \/>  \u0414\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u0440\u0430\u0437\u0431\u0438\u0442\u044c \u043d\u0430\u0448 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u043d\u044b\u0439 DataFrame, \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0438\u0442\u044c \u0435\u0433\u043e \u0441 SampleCustomers \u043f\u043e\u0438\u0433\u0440\u0430\u0442\u044c\u0441\u044f \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u043c\u0438:<\/p>\n<pre><code class=\"python\">SampleCustomers.set_index('tcs_customer_id', inplace=True) UnionDF = FinalDF.join(SampleCustomers) trainDF = UnionDF[UnionDF.sample_type == 'train'].drop(['sample_type'], axis=1) testDF = UnionDF[UnionDF.sample_type == 'test'].drop(['sample_type'], axis=1) <\/code><\/pre>\n<p>  \u0414\u0430\u043b\u0435\u0435 \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0438 \u043a\u043e\u0440\u0440\u0435\u043b\u0438\u0440\u0443\u0435\u0442 \u043c\u0435\u0436\u0434\u0443 \u0441\u043e\u0431\u043e\u0439, \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u043c \u043c\u0430\u0442\u0440\u0438\u0446\u0443 \u0441 \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u0430\u043c\u0438 \u043a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u0438 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432. \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e pandas \u044d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043e\u0434\u043d\u043e\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439:<\/p>\n<pre><code class=\"python\">CorrKoef = trainDF.corr()<\/code><\/pre>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0432\u044b\u0448\u0435 CorrKoef \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u043c\u0430\u0442\u0440\u0438\u0446\u0443 \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u0432 61&#215;61. <br \/>  \u0421\u0442\u0440\u043e\u043a\u0430\u043c\u0438 \u0438 \u0441\u0442\u043e\u043b\u0431\u0446\u0430\u043c\u0438 \u0435\u0435 \u0431\u0443\u0434\u0443\u0442 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0438\u043c\u0435\u043d\u0430 \u043f\u043e\u043b\u0435\u0439, \u0430 \u043d\u0430 \u0438\u0445 \u043f\u0435\u0440\u0435\u0441\u0435\u0447\u0435\u043d\u0438\u0438 \u2014 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u0430 \u043a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u0438. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:  <\/p>\n<table>\n<tr>\n<td><\/td>\n<th>fact_close_date<\/th>\n<\/tr>\n<tr>\n<th>status_13<\/th>\n<td>0.997362<\/td>\n<\/tr>\n<\/table>\n<p>  \u0412\u043e\u0437\u043c\u043e\u0436\u0435\u043d \u0441\u043b\u0443\u0447\u0430\u0439, \u043a\u043e\u0433\u0434\u0430 \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u0430 \u043a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u0438 \u043d\u0435\u0442. \u042d\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442, \u0447\u0442\u043e \u0432 \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u043b\u044f \u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u044b \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u043d\u0438\u043c \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c \u0438 \u0438\u0445 \u043c\u043e\u0436\u043d\u043e \u043e\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043f\u0440\u0438 \u0430\u043d\u0430\u043b\u0438\u0437\u0435. \u041f\u0440\u043e\u0432\u0435\u0440\u0438\u043c:<\/p>\n<pre><code class=\"python\">FieldDrop = [i for i in CorrKoef if CorrKoef[i].isnull().drop_duplicates().values[0]] <\/code><\/pre>\n<p>  \u041d\u0430 \u0432\u044b\u0445\u043e\u0434\u0435 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u0441\u043f\u0438\u0441\u043e\u043a \u043f\u043e\u043b\u0435\u0439 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0436\u043d\u043e \u0443\u0434\u0430\u043b\u0438\u0442\u044c:  <\/p>\n<ul>\n<li>pmt_string_84m_6<\/li>\n<li>pmt_string_84m_8<\/li>\n<li>pmt_freq_5<\/li>\n<li>pmt_freq_A<\/li>\n<li>pmt_freq_B<\/li>\n<li>status_12<\/li>\n<\/ul>\n<p>  \u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u0448\u0430\u0433\u043e\u043c \u043c\u044b \u043d\u0430\u0439\u0434\u0435\u043c \u043f\u043e\u043b\u044f \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043a\u043e\u0440\u0440\u0435\u043b\u0438\u0440\u0443\u044e\u0442 \u043c\u0435\u0436\u0434\u0443 \u0441\u043e\u0431\u043e\u0439 (\u0443 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442 \u043a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u0438 \u0431\u043e\u043b\u044c\u0448\u0435 90%), \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043d\u0430\u0448\u0443 \u043c\u0430\u0442\u0440\u0438\u0446\u0443:<\/p>\n<pre><code class=\"python\">CorField = [] for i in CorrKoef:     for j in CorrKoef.index[CorrKoef[i] &gt; 0.9]:         if i &lt;&gt; j and j not in CorField and i not in CorField:             CorField.append(j)             print &quot;%s--&gt;%s: r^2=%f&quot; % (i,j, CorrKoef[i][CorrKoef.index==j].values[0]) <\/code><\/pre>\n<p>  \u041d\u0430 \u0432\u044b\u0445\u043e\u0434\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435:<\/p>\n<p>  fact_close_date&#8212;&gt;status_13: r^2=0.997362<br \/>  ttl_delq_5_29&#8212;&gt;ttl_delq_30: r^2=0.954740<br \/>  ttl_delq_5_29&#8212;&gt;pmt_string_84m_A: r^2=0.925870<br \/>  ttl_delq_30_59&#8212;&gt;pmt_string_84m_2: r^2=0.903337<br \/>  ttl_delq_90_plus&#8212;&gt;pmt_string_84m_5: r^2=0.978239<br \/>  delq_balance&#8212;&gt;max_delq_balance: r^2=0.986967<br \/>  pmt_freq_3&#8212;&gt;relationship_1: r^2=0.909820<br \/>  pmt_freq_3&#8212;&gt;currency_RUB: r^2=0.910620<br \/>  pmt_freq_3&#8212;&gt;count_credit: r^2=0.911109<\/p>\n<p>  \u0418\u0442\u0430\u043a, \u0438\u0441\u0445\u043e\u0434\u044f \u0438\u0437 \u0441\u0432\u044f\u0437\u0435\u0439 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u043d\u0430 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u043c \u0448\u0430\u0433\u0435, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 \u0441\u043f\u0438\u0441\u043e\u043a \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043f\u043e\u043b\u044f:<\/p>\n<pre><code class=\"python\">FieldDrop =FieldDrop + ['fact_close_date','ttl_delq_30',                         'pmt_string_84m_5',                         'pmt_string_84m_A',                         'pmt_string_84m_A',                         'max_delq_balance',                         'relationship_1',                         'currency_RUB',                         'count_credit'] newtr = trainDF.drop(FieldDrop, axis=1) <\/code><\/pre>\n<h4>\u041f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0435 \u0438 \u0432\u044b\u0431\u043e\u0440 \u043c\u043e\u0434\u0435\u043b\u0438<\/h4>\n<p>  \u041d\u0443 \u0447\u0442\u043e \u0436\u0435 \u043f\u0435\u0440\u0432\u0438\u0447\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u044b \u0438 \u0442\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u043a \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044e \u043c\u043e\u0434\u0435\u043b\u0438.<br \/>  \u041e\u0442\u0434\u0435\u043b\u0438\u043c \u043f\u0440\u0438\u0437\u043d\u0430\u043a \u043a\u043b\u0430\u0441\u0441\u0430 \u043e\u0442 \u043e\u0431\u0443\u0447\u0430\u044e\u0449\u0435\u0439 \u0432\u044b\u0431\u043e\u0440\u043a\u0438:<\/p>\n<pre><code class=\"python\">target = newtr.bad.values train = newtr.drop('bad', axis=1).values <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0443\u043c\u0435\u043d\u044c\u0448\u0438\u043c \u0440\u0430\u0437\u043c\u0435\u0440\u043d\u043e\u0441\u0442\u044c \u043d\u0430\u0448\u0435\u0439 \u0432\u044b\u0431\u043e\u0440\u043a\u0438, \u0434\u0430\u0431\u044b \u0432\u0437\u044f\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0437\u043d\u0430\u0447\u0438\u043c\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f <a href=\"http:\/\/www.machinelearning.ru\/wiki\/index.php?title=%D0%9C%D0%B5%D1%82%D0%BE%D0%B4_%D0%B3%D0%BB%D0%B0%D0%B2%D0%BD%D1%8B%D1%85_%D0%BA%D0%BE%D0%BC%D0%BF%D0%BE%D0%BD%D0%B5%D0%BD%D1%82\">\u043c\u0435\u0442\u043e\u0434\u043e\u043c \u0433\u043b\u0430\u0432\u043d\u044b\u0445 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442<\/a> \u0438 \u0435\u0433\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439 <a href=\"http:\/\/scikit-learn.org\/stable\/modules\/generated\/sklearn.decomposition.PCA.html#sklearn.decomposition.PCA\">PCA()<\/a> \u0432 \u043c\u043e\u0434\u0443\u043b\u0435 <i>sklearn<\/i>. \u0412 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0435 \u043c\u044b \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c(\u044f \u0432\u044b\u0431\u0440\u0430\u043b 20, \u0442.\u043a. \u043f\u0440\u0438 \u043d\u0438\u0445 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043d\u0435 \u043e\u0442\u043b\u0438\u0447\u0430\u043b\u0438\u0441\u044c \u043e\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 \u043f\u043e \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u043c \u0434\u0430\u043d\u043d\u044b\u043c)<\/p>\n<pre><code class=\"python\">coder = PCA(n_components=20) train = coder.fit_transform(train) <\/code><\/pre>\n<p>  \u041f\u0440\u0438\u0448\u043b\u043e \u0432\u0440\u0435\u043c\u044f \u0434\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438. \u0412\u043e\u0437\u044c\u043c\u0435\u043c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u0432 \u0438 \u0441\u0440\u0430\u0432\u043d\u0438\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0438\u0445 \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u0438\u0441\u0442\u0438\u043a\u0438 <a href=\"http:\/\/ru.wikipedia.org\/wiki\/ROC-%D0%BA%D1%80%D0%B8%D0%B2%D0%B0%D1%8F\">Area Under ROC Curve<\/a> (<b>auc<\/b>). \u0414\u043b\u044f \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0431\u0443\u0434\u0443\u0442 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u044b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b:  <\/p>\n<ul>\n<li><a href=\"http:\/\/ru.wikipedia.org\/wiki\/Random_forest\">\u0421\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0439 \u043b\u0435\u0441<\/a><\/li>\n<li><a href=\"http:\/\/en.wikipedia.org\/wiki\/Gradient_boosting\">\u0413\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u043d\u044b\u0439 \u0431\u0443\u0441\u0442\u0438\u043d\u0433<\/a><\/li>\n<li><a href=\"http:\/\/www.machinelearning.ru\/wiki\/index.php?title=KNN\">\u041c\u0435\u0442\u043e\u0434 \u0431\u043b\u0438\u0436\u0430\u0439\u0448\u0438\u0445 \u0441\u043e\u0441\u0435\u0434\u0435\u0439<\/a><\/li>\n<li><a href=\"http:\/\/ru.wikipedia.org\/wiki\/%D0%9D%D0%B0%D0%B8%D0%B2%D0%BD%D1%8B%D0%B9_%D0%B1%D0%B0%D0%B9%D0%B5%D1%81%D0%BE%D0%B2%D1%81%D0%BA%D0%B8%D0%B9_%D0%BA%D0%BB%D0%B0%D1%81%D1%81%D0%B8%D1%84%D0%B8%D0%BA%D0%B0%D1%82%D0%BE%D1%80\">\u00ab\u041d\u0430\u0438\u0432\u043d\u044b\u0439\u00bb \u0431\u0430\u0439\u0435\u0441\u043e\u0432\u0441\u043a\u0438\u0439 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440<\/a><\/li>\n<\/ul>\n<pre><code class=\"python\">models = [] models.append(RandomForestClassifier(n_estimators=165, max_depth=4, criterion='entropy')) models.append(GradientBoostingClassifier(max_depth =4)) models.append(KNeighborsClassifier(n_neighbors=20)) models.append(GaussianNB()) <\/code><\/pre>\n<p>  \u0418\u0442\u0430\u043a \u043c\u043e\u0434\u0435\u043b\u0438 \u0432\u044b\u0431\u0440\u0430\u043d\u044b. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0441\u0435\u0439\u0447\u0430\u0441 \u0440\u0430\u0437\u043e\u0431\u044c\u0435\u043c \u043d\u0430\u0448\u0443 \u043e\u0431\u0443\u0447\u0430\u044e\u0449\u0443\u044e \u0432\u044b\u0431\u043e\u0440\u043a\u0443 \u043d\u0430 2 \u043f\u043e\u0434\u0432\u044b\u0431\u043e\u0440\u043a\u0438: \u0442\u0435\u0441\u0442\u043e\u0432\u0443\u044e \u0438 \u043e\u0431\u0443\u0447\u0430\u044e\u0449\u0443\u044e. \u0414\u0430\u043d\u043d\u043e\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043d\u0443\u0436\u043d\u043e \u0447\u0442\u043e\u0431\u044b \u043c\u044b \u043c\u043e\u0433\u043b\u0438 \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u0438\u0441\u0442\u0438\u043a\u0443 auc \u0434\u043b\u044f \u043d\u0430\u0448\u0438\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439. \u0420\u0430\u0437\u0431\u0438\u0435\u043d\u0438\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0441\u0442\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439 <a href=\"http:\/\/scikit-learn.org\/stable\/modules\/generated\/sklearn.cross_validation.train_test_split.html\">train_test_split()<\/a> \u0438\u0437 \u043c\u043e\u0434\u0443\u043b\u044f <i>sklearn<\/i>:<\/p>\n<pre><code class=\"python\">TRNtrain, TRNtest, TARtrain, TARtest = train_test_split(train, target, test_size=0.3, random_state=0)<\/code><\/pre>\n<p>  \u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u043e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u043e\u0431\u0443\u0447\u0438\u0442\u044c \u043d\u0430\u0448\u0438 \u043c\u043e\u0434\u0435\u043b\u0438 \u0438 \u043e\u0446\u0435\u043d\u0438\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442.<br \/>  \u0414\u043b\u044f \u0440\u0430\u0441\u0447\u0435\u0442\u0430 \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u0438\u0441\u0442\u0438\u043a\u0438 <b>auc<\/b> \u0435\u0441\u0442\u044c 2 \u043f\u0443\u0442\u0438:  <\/p>\n<ol>\n<li>\u0421\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u043c\u0438 \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430\u043c\u0438 \u043c\u043e\u0434\u0443\u043b\u044f <i>sklearn<\/i> \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <a href=\"http:\/\/scikit-learn.org\/stable\/modules\/generated\/sklearn.metrics.roc_auc_score.html#sklearn.metrics.roc_auc_score\">roc_auc_score<\/a> \u0438\u043b\u0438 <a href=\"http:\/\/scikit-learn.org\/stable\/modules\/generated\/sklearn.metrics.auc.html#sklearn.metrics.auc\">auc<\/a><\/li>\n<li>\u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0435\u0433\u043e \u043f\u0430\u043a\u0435\u0442\u0430 <a href=\"https:\/\/github.com\/benhamner\/Metrics\">ml_metrics<\/a> \u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 auc()<\/li>\n<\/ol>\n<p>  \u042f \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0441\u044c \u0432\u0442\u043e\u0440\u044b\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c, \u0442.\u043a. \u043f\u0435\u0440\u0432\u044b\u0439 \u0431\u044b\u043b \u043f\u043e\u043a\u0430\u0437\u0430\u043d \u0432 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0435. \u041f\u0430\u043a\u0435\u0442 <b>ml_metrics<\/b> \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u043c \u0434\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435\u043c \u043a sklearn, \u0442.\u043a. \u0432 \u043d\u0435\u043c \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u044e\u0442 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u0435\u0442\u0440\u0438\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043d\u0435\u0442 \u0432 sklearn.<br \/>  \u0418\u0442\u0430\u043a, \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u043c ROC \u043a\u0440\u0438\u0432\u044b\u0435 \u0438 \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u0435\u043c \u0438\u0445 \u043f\u043b\u043e\u0449\u0430\u0434\u0438:<\/p>\n<pre><code class=\"python\">plt.figure(figsize=(10, 10))  for model in models:     model.fit(TRNtrain, TARtrain)     pred_scr = model.predict_proba(TRNtest)[:, 1]     fpr, tpr, thresholds = roc_curve(TARtest, pred_scr)     roc_auc = ml_metrics.auc(TARtest, pred_scr)     md = str(model)     md = md[:md.find('(')]     pl.plot(fpr, tpr, label='ROC fold %s (auc = %0.2f)' % (md, roc_auc))  pl.plot([0, 1], [0, 1], '--', color=(0.6, 0.6, 0.6)) pl.xlim([0, 1]) pl.ylim([0, 1]) pl.xlabel('False Positive Rate') pl.ylabel('True Positive Rate') pl.title('Receiver operating characteristic example') pl.legend(loc=&quot;lower right&quot;) pl.show() <\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"http:\/\/habr.habrastorage.org\/post_images\/e76\/550\/a20\/e76550a20afe303651244c1ff6d82eb4.png\" alt=\"image\"\/><br \/>  \u0418\u0442\u0430\u043a, \u043f\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430\u043c \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u043d\u0430\u0448\u0438\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u043c\u043e\u0436\u043d\u043e \u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e \u043b\u0443\u0447\u0448\u0435 \u0432\u0441\u0435\u0433\u043e \u0441\u0435\u0431\u044f \u043f\u043e\u043a\u0430\u0437\u0430\u043b \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u043d\u044b\u0439 \u0431\u0443\u0441\u0442\u0438\u043d\u0433, \u0435\u0433\u043e \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u0440\u044f\u0434\u043a\u0430 69%. \u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0434\u043b\u044f \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0439 \u0432\u044b\u0431\u043e\u0440\u043a\u0438 \u043c\u044b \u0432\u044b\u0431\u0435\u0440\u0435\u043c \u0435\u0433\u043e. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u043c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0432 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0439 \u0432\u044b\u0431\u043e\u0440\u043a\u0435, \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0432 \u0435\u0435 \u0434\u043e \u043d\u0443\u0436\u043d\u043e\u0433\u043e \u0444\u043e\u0440\u043c\u0430\u0442\u0430:<\/p>\n<pre><code class=\"python\">#\u043f\u0440\u0438\u0432\u043e\u0434\u0438\u043c \u0442\u0435\u0441\u0442\u043e\u0432\u0443\u044e \u0432\u044b\u0431\u043e\u0440\u043a\u0443 \u043a \u043d\u0443\u0436\u043d\u043e\u043c\u0443 \u0444\u043e\u0440\u043c\u0430\u0442\u0443 FieldDrop.append('bad') test = testDF.drop(FieldDrop, axis=1).values test = coder.fit_transform(test) #\u043e\u0431\u0443\u0447\u0430\u0435\u043c \u043c\u043e\u0434\u0435\u043b\u044c model = models[1] model.fit(train, target) #\u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 testDF.bad = model.predict(test) <\/code><\/pre>\n<p>  <\/p>\n<h4>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h4>\n<p>  \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0437\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0431\u044b \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u0430\u044f \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u0438 \u0432 69%, \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0435 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0445\u043e\u0440\u043e\u0448\u0435\u0439, \u043d\u043e \u0431\u043e\u043b\u044c\u0448\u0435\u0439 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438 \u044f \u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f \u043d\u0435 \u0441\u043c\u043e\u0433. \u0425\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0431\u044b \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0442\u043e\u0442 \u0444\u0430\u043a\u0442, \u0447\u0442\u043e \u043f\u0440\u0438 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0438 \u043c\u043e\u0434\u0435\u043b\u0438 \u043f\u043e \u043f\u043e\u043b\u043d\u043e\u0439 \u0440\u0430\u0437\u043c\u0435\u0440\u043d\u043e\u0441\u0442\u0438, \u0442.\u0435. \u0431\u0435\u0437 \u0443\u0447\u0435\u0442\u0430 \u043a\u043e\u0440\u0440\u0435\u043b\u0438\u0440\u0443\u0435\u043c\u044b\u0445 \u0441\u0442\u043e\u043b\u0431\u0446\u043e\u0432 \u0438 \u0441\u043e\u043a\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u0440\u0430\u0437\u043c\u0435\u0440\u043d\u043e\u0441\u0442\u0438, \u043e\u043d\u0430 \u0434\u0430\u043b\u0430 \u0442\u0430\u043a \u0436\u0435 69% \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438 (\u044d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043b\u0435\u0433\u043a\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043d\u0430\u0431\u043e\u0440 trainDF \u0434\u043b\u044f \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u043c\u043e\u0434\u0435\u043b\u0438)<br \/>  \u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435, \u044f \u043f\u043e\u0441\u0442\u0430\u0440\u0430\u043b\u0441\u044f \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0432\u0441\u0435 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u044d\u0442\u0430\u043f\u044b \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u043e\u0442 \u043f\u0435\u0440\u0432\u0438\u0447\u043d\u043e\u0439 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0441\u044b\u0440\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u043e \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f \u043c\u043e\u0434\u0435\u043b\u0438 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u0430. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0431\u044b \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0432 \u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c\u044b\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 \u043d\u0435 \u0431\u044b\u043b \u0432\u043a\u043b\u044e\u0447\u0435\u043d \u043c\u0435\u0442\u043e\u0434 \u043e\u043f\u043e\u0440\u043d\u044b\u0445 \u0432\u0435\u043a\u0442\u043e\u0440\u043e\u0432, \u044d\u0442\u043e \u0441\u0432\u044f\u0437\u0430\u043d\u043e \u0441 \u0442\u0435\u043c, \u0447\u0442\u043e \u043f\u043e\u0441\u043b\u0435 \u043d\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u0438 \u043e\u043f\u0443\u0441\u0442\u0438\u043b\u0430\u0441\u044c \u0434\u043e 51% \u0438 \u043b\u0443\u0447\u0448\u0438\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441 \u043d\u0438\u043c \u0431\u044b\u043b \u0432 \u0440\u0430\u0439\u043e\u043d\u0435 60%, \u043f\u0440\u0438 \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0437\u0430\u0442\u0440\u0430\u0442\u0430\u0445 \u043f\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438.<br \/>  \u0422\u0430\u043a\u0436\u0435 \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0431\u044b \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e, \u043a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e \u043d\u0430 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0439 \u0432\u044b\u0431\u043e\u0440\u043a\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u043d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c, \u0442.\u043a. \u043d\u0435 \u0443\u043b\u043e\u0436\u0438\u043b\u0441\u044f \u0432 \u0441\u0440\u043e\u043a\u0438 \u043f\u0440\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u0442\u0443\u0440\u043d\u0438\u0440\u0430.    \t<\/p>\n<div class=\"clear\"><\/div>\n<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/204500\/\"> http:\/\/habrahabr.ru\/post\/204500\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">\n<h4>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h4>\n<p>  \u0414\u043e\u0431\u0440\u044b\u0439 \u0434\u0435\u043d\u044c, \u0443\u0432\u0430\u0436\u0430\u0435\u043c\u044b\u0435 \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u0438.<br \/>  \u041d\u0435\u0434\u0430\u0432\u043d\u043e, \u0431\u0440\u043e\u0434\u044f \u043f\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u0440\u0430\u043c \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u0430\u0443\u0442\u0438\u043d\u044b, \u044f \u043d\u0430\u0442\u043a\u043d\u0443\u043b\u0441\u044f \u043d\u0430 <a href=\"https:\/\/www.tcsbank.ru\/tournament\/\">\u0442\u0443\u0440\u043d\u0438\u0440<\/a>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u043e\u0432\u043e\u0434\u0438\u043b\u0441\u044f \u0431\u0430\u043d\u043a\u043e\u043c \u0422\u041a\u0421 \u0432 \u043d\u0430\u0447\u0430\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u0433\u043e\u0434\u0430. \u041e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0432\u0448\u0438\u0441\u044c \u0441 \u0437\u0430\u0434\u0430\u043d\u0438\u044f\u043c\u0438, \u044f \u0440\u0435\u0448\u0438\u043b \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0441\u0432\u043e\u0438 \u043d\u0430\u0432\u044b\u043a\u0438 \u0432 \u0430\u043d\u0430\u043b\u0438\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0430 \u043d\u0438\u0445.<br \/>  \u041d\u0430\u0447\u0430\u0442\u044c \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u044f \u0440\u0435\u0448\u0438\u043b \u0441 \u0437\u0430\u0434\u0430\u0447\u0438 \u043e \u0441\u043a\u043e\u0440\u0438\u043d\u0433\u0435 (\u0417\u0430\u0434\u0430\u043d\u0438\u0435 \u21163). \u0414\u043b\u044f \u0435\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u044f, \u043a\u0430\u043a \u0432\u0441\u0435\u0433\u0434\u0430, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b Python \u0441 \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c\u0438 \u043c\u043e\u0434\u0443\u043b\u044f\u043c\u0438 <a href=\"http:\/\/pandas.pydata.org\/pandas-docs\/stable\/\">pandas<\/a> \u0438 <a href=\"http:\/\/scikit-learn.org\/stable\/index.html\">scikit-learn<\/a>.  <\/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-204500","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/204500","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=204500"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/204500\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=204500"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=204500"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=204500"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}