<p><div><div><div><div data-show-faces="false" data-height="21" data-width="100" data-layout="button_count" data-send="true" data-href="https://www.r-bloggers.com/kaggle-competition-in-30-minutes-predict-home-credit-default-risk-with-r/"></div></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="http://www.business-science.io/business/2018/08/07/kaggle-competition-home-credit-default-risk.html"> business-science.io - Articles</a></strong>, and kindly contributed to <a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers)</a> </div>
<p>We were very excited when <a rel="nofollow" href="http://www.homecredit.net/" target="_blank">Home Credit</a> teamed up with <a rel="nofollow" href="https://www.kaggle.com/" target="_blank">Kaggle</a> to host the <a rel="nofollow" href="https://www.kaggle.com/c/home-credit-default-risk" target="_blank">Home Credit Default Risk Challenge</a>. Default risk is a topic that impacts all financial institutions, one that machine learning can help solve. We decided to <strong>flip the goal</strong> of this challenge: Kaggle competitions are performance driven, where a data scientist has months to fine tune a model to get maximum performance. This is not reality. <strong>We turned this goal upside down, focusing on a combination of speed, efficiency, and performance.</strong></p>
<p>In the real world businesses have finite schedules for data science projects. Because of this, we redesigned the competition goal to <strong>get very good results quickly</strong>. We took a look at the top performance (<a rel="nofollow" href="https://en.wikipedia.org/wiki/Receiver_operating_characteristic#Area_under_the_curve" target="_blank">measured by AUC or area under the curve</a>), which is currently around 0.80. We decided to see how quickly we could develop a competitive model. Follow along and <strong>learn how we got a model of 0.70 on a Kaggle submission in about 30 minutes with H2O automated machine learning (AutoML)</strong>!</p>
<h1>Related Business Machine Learning Articles</h1>
<ul>
<li>
<p><a rel="nofollow" href="http://www.business-science.io/business/2017/09/18/hr_employee_attrition.html" target="_blank">HR Analytics: Using Machine Learning To Predict Employee Turnover</a></p>
</li>
<li>
<p><a rel="nofollow" href="http://www.business-science.io/business/2017/11/28/customer_churn_analysis_keras.html" target="_blank">Customer Analytics: Using Deep Learning With Keras To Predict Customer Churn</a></p>
</li>
<li>
<p><a rel="nofollow" href="http://www.business-science.io/business/2017/10/16/sales_backorder_prediction.html" target="_blank">Sales Analytics: How To Use Machine Learning To Predict And Optimize Product Backorders</a></p>
</li>
</ul>
<h2>Learning Trajectory</h2>
<p>In this article, we flip the Kaggle Competition goal upside down focusing on a combination of efficiency and performance. Matt shows you how to get a very good model that gets a 0.70 AUC in about 30 minutes of analysis effort.</p>
<p>We kick the project off with an overview of credit default risk. You’ll begin by <a rel="nofollow" href="http://www.business-science.io/business/2018/08/07/kaggle-competition-home-credit-default-risk.html#definition" target="_blank">understanding what credit default risk is</a> and <a rel="nofollow" href="http://www.business-science.io/business/2018/08/07/kaggle-competition-home-credit-default-risk.html#ml-help" target="_blank">how machine learning can help identify personal loan applications that are likely to lead to default</a>. We’ll also go over <a rel="nofollow" href="http://www.business-science.io/business/2018/08/07/kaggle-competition-home-credit-default-risk.html#challenge-redesign" target="_blank">why a Kaggle challenge redesign is more representative of what you’ll need to do in the real world</a>.</p>
<p>Next, we’ll go through the process Matt used to <a rel="nofollow" href="http://www.business-science.io/business/2018/08/07/kaggle-competition-home-credit-default-risk.html#thirty-minute-kaggle" target="_blank">build a competitive model in about 30 minutes</a>. This includes about 10 minutes of strategizing and 20 minutes of actual coding. You’ll see how Matt used the following process to efficiently build a high performance model.</p>
<p><img alt="Simplified H2O AutoML Preprocessing Workflow" src="https://i0.wp.com/www.business-science.io/assets/2018-08-07-kaggle-credit-risk/h2o_strategy.png?w=456" data-recalc-dims="1"></p>
<p>H2O AutoML Preprocessing Workflow</p>
<p>We end on <a rel="nofollow" href="http://www.business-science.io/business/2018/08/07/kaggle-competition-home-credit-default-risk.html#next-steps" target="_blank">next steps</a>, which provides details on our <a rel="nofollow" href="https://university.business-science.io/p/hr201-using-machine-learning-h2o-lime-to-predict-employee-turnover/?product_id=635023&coupon_code=DS4B_15" target="_blank">end-to-end data science project course</a> that will transform your data science abilities in 10 weeks.</p>
<p></p>
<hr>
<h2>Transform Your Abilities In 10 Weeks</h2>
<p>
If you’re interested in learning how to apply critical thinking and data science while solving a real-world business problem following an end-to-end data science project, check out <strong>Data Science For Business (DS4B 201-R)</strong>. Over the course of 10 weeks you will solve an <strong>end-to-end Employee Churn data science project following our systematic Business Science Problem Framework</strong>.
</p>
<p>
<a rel="nofollow" href="https://university.business-science.io/p/hr201-using-machine-learning-h2o-lime-to-predict-employee-turnover/?product_id=635023&coupon_code=DS4B_15" target="_blank"><strong>Get Started Today!</strong></a>
</p>
<hr>
<p></p>
<h2>Overview</h2>
<p>We’ll briefly touch on what credit default risk is, how machine learning can help, and why a 30-Minute Kaggle Challenge.</p>
<h3>What Is Credit Default Risk?</h3>
<p>In the world of finance, <a rel="nofollow" href="https://www.investopedia.com/terms/d/defaultrisk.asp" target="_blank">Credit or Default Risk</a> is the probability that companies or individuals will be unable to make the required payments on their debt obligations. Lenders are exposed to default risk on every extension of credit. Think of financial institutions like <strong>Citi</strong>, which lend to millions of people worldwide, or <strong>JP Morgan Chase &amp; Co</strong>, which lend to hundreds of thousands of companies worldwide.</p>
<p><img alt="JP Morgan" src="https://i2.wp.com/www.business-science.io/assets/2018-08-07-kaggle-credit-risk/jpmorgan.jpg?w=456" data-recalc-dims="1"></p>
<p>JP Morgan: A Major Lender Of Corporate Loans</p>
<p>Every time Citi or JP Morgan extends a loan to a person or a corporation it assesses the <strong><em>level of risk</em></strong> involved in the transaction. This is because every once in a while people or companies won’t be able to make payments. In the dynamic world we live in unfortunate events happen and circumstances change.<br>
<a rel="nofollow" href="https://www.investopedia.com/university/risk/risk2.asp" target="_blank">Default risk is comprised of two components</a>:</p>
<ol>
<li>
<p><strong><em>Systemic Risk</em></strong> – The risk related to an external system of interconnected relationships (think of this as the risk associated with they economy, interest rate changes, inflation, recessions, and wars). This risk is often considered unavoidable. The only option is to hedge or not be in the market.</p>
</li>
<li>
<p><strong><em>Unsystematic Risk</em></strong> – The risk inherent to a person or company (think of this as a company that has a competitor that moves in driving down sales). This risk is avoidable through <a rel="nofollow" href="https://www.investopedia.com/terms/d/diversification.asp" target="_blank">diversification</a> or making bets on many assets preferably uncorrelated.</p>
</li>
</ol>
<p>In this article, we’ll be focusing on a specific type of risk called <strong><em>Credit or Default Risk</em></strong>, which has both systemic and unsystemic drivers. The main point is that the drivers of default risk can be measured and analyzed for patterns related to default. As a result, the probability of default for a person or an institution is not random. <strong>This is where machine learning can help.</strong></p>
<blockquote>
<p>The probability of default for a person or an institution is not random. This is where machine learning can help.</p>
</blockquote>
<h3>Machine Learning For Personal Default Risk</h3>
<p>Like any machine learning problem, default risk has drivers, or features related to the person or company that have a relationship with the likelihood of a default. As discussed previously, some of the drivers are systemic and others are unsystemic. Identifying and measuring these drivers are the keys to predicting default.</p>
<p>For the Kaggle Competition, <em>Home Credit</em> (the company) has supplied us with data from several data sources. The following Data Architecture Diagram shows the interrelationships between the data files provided.</p>
<p><img alt="Home Credit Default Risk Data Architecture" src="https://i0.wp.com/www.business-science.io/assets/2018-08-07-kaggle-credit-risk/home_credit.png?w=456" data-recalc-dims="1"></p>
<p><a rel="nofollow" href="https://www.kaggle.com/c/home-credit-default-risk" target="_blank">Data Architecture Diagram For Home Credit Default Risk Competition</a></p>
<p>For the purposes of this article, we’ll focus on the <code>application_train.csv</code> and <code>application_test.csv</code> files, which contain a significant amount of useful information for predicting credit default. This is the main source of information for people that have applied for personal loans including features related to their loan application.</p>
<p>Several other data sources are provided such as <code>bureau.csv</code> and <code>previous_application.csv</code>. These data have “one-to-many relationships”, which can be combined through a process called feature engineering. In a tentative future article, we will go into strategies for feature engineering with data that have “one-to-many relationships” (e.g. creating features from <code>bureau.csv</code> that can be combined with <code>application_train.csv</code>).</p>
<h3>Why A Kaggle Challenge Redesign?</h3>
<p>While we enjoy the idea of the Kaggle Challenge, it’s not representative of a real world scenario where projects have fixed time schedules. The <strong><em>Kaggle Competition goal</em></strong> is to compete on maximum performance. The <strong><em>goal in the real world</em></strong> is quite often to get a good model within a defined project schedule.</p>
<p><strong><em>Time to completion</em></strong> is important because projects have fixed resources. The longer you are on a project, the more you cost the company money and the more you delay other projects that you could be helping with.</p>
<p>The task of developing a high performance model is just one small piece of a data scientists job. It’s unrealistic to think that an organization will be OK with you (the data scientist) dedicating hundreds of man-hours to squeezing every last drop of performance out of the model. It’s not reality. Refer to the saying, “Great is the enemy of Good”. This is often the case in real-world data science.</p>
<h4>Real-World End-To-End Data Science Project Structure</h4>
<p>In the real world, you won’t have months that you can dedicate to a model. Rather, you will have maybe a day or two. The majority of your project time will be spent on:</p>
<ol>
<li>
<p>Understanding the business (2 weeks)</p>
</li>
<li>
<p>Communicating with decision makers to turn their input into a data collection strategy (2 weeks)</p>
</li>
<li>
<p>Collecting and cleaning the data (1 week to several months)</p>
</li>
<li>
<p>Building a model (1 to 2 days)</p>
</li>
<li>
<p>Converting machine learning results to expected savings or profitability from a business change/improvement and communicating results (1 to 2 weeks)</p>
</li>
<li>
<p>Releasing these results into production via web applications (Several weeks)</p>
</li>
</ol>
<p>This is what we call an <strong>“end-to-end” data science project</strong>.</p>
<p></p>
<hr>
<h2>Interested in Solving an End-To-End Data Science Project?</h2>
<p>
If you’re interested in learning how to apply critical thinking and data science while solving a real-world business problem following an end-to-end data science project, check out <strong>Data Science For Business (DS4B 201-R)</strong>. Over the course of 10 weeks you will solve an <strong>end-to-end Employee Churn data science project following our systematic Business Science Problem Framework</strong>.
</p>
<p>
<a rel="nofollow" href="https://university.business-science.io/p/hr201-using-machine-learning-h2o-lime-to-predict-employee-turnover/?product_id=635023&coupon_code=DS4B_15" target="_blank"><strong>Get Started Today!</strong></a>
</p>
<hr>
<p></p>
<h2>Completing A Kaggle Competition In 30 Minutes</h2>
<blockquote>
<p>By Matt Dancho, Founder of Business Science</p>
</blockquote>
<p>Why 30-minutes for a Kaggle Challenge?</p>
<p>Because I wanted to show you that you that if you leverage high performance tools, you can drastically cut your modeling time down while getting a very good model. As a result, you can spend more time getting better features (up front in the project) and communicating results (after the model is developed). If you get more time after the first round of models are built, you can always go back and improve model performance by adding more data (more features) and improving model performance.</p>
<p>I’ll be providing details how I personally approached the Kaggle Competition and what I did each step of the way to get a good solution fast. Here’s the general process with code that I used to complete a high performing model in about 30 minutes.</p>
<p><strong>Important Note: I did not set out with 30 minutes in mind.</strong></p>
<p>My actual time was roughly 30 minutes.</p>
<h3>Basis For Kaggle Competition Redesign</h3>
<p>One of my favorite episodes of the <a rel="nofollow" href="https://tim.blog/podcast/" target="_blank"><strong><em>Tim Ferris Podcast</em></strong></a> is one in which he interviews <a rel="nofollow" href="https://tim.blog/2016/02/16/scorpion/" target="_blank">Walter O’Brien, “the real life Scorpion”</a>. Walter is the basis for the hit TV show, <strong><em>Scorpion</em></strong>, that brings together a team of hackers and intellectual misfits to solve crime with technology. While the podcast episode sparked a lot of controversy related to Walter’s history and claims that could not be verified, I found a particular piece of the episode very interesting: <strong>The setup of the 1993 Computing Olympics, which Walter reportedly participated in.</strong></p>
<p>In the final challenge of the Computing Olympics, a computer scientist had a fixed amount of time (3 hours) to solve a very complicated business problem by creating an algorithm. The best contestants followed this strategy:</p>
<ol>
<li>
<p>The top contestants began by <strong>critically thinking</strong>: Thinking about the problem and what tools they had in their arsenal to solve it. This could be upwards of 50% to 2/3rd of the allotted competition time.</p>
</li>
<li>
<p>They spent the remaining 50% to 1/3rd <strong>speed coding</strong>: Hammering out their solution, converting to code with the programming languages that they knew would be the best tool for the scenario.</p>
</li>
</ol>
<p>There’s a lot of value in this approach because of the critical thinking process and the fact that in the real world you will likely only have a fixed amount of days you can work on a model before the business deadline is hit. I wanted to see if this approach could be applied to the <a rel="nofollow" href="https://www.kaggle.com/c/home-credit-default-risk" target="_blank">Home Credit Default Risk</a> challenge.</p>
<h3>Setup And Data (5 min)</h3>
<p>This part took about 5 minutes excluding the time to download the data and place it into a folder.</p>
<p>You can collect the data from the <a rel="nofollow" href="https://www.kaggle.com/c/home-credit-default-risk/data" target="_blank">Kaggle Home Credit Default Risk Competition</a> site. Just a heads up, the datasets in full total 688MB so we need to be mindful of space but more importantly RAM.</p>
<p>Once the data is downloaded, I added it to a folder in my home directory called “00_data”.</p>
<h4>Libraries</h4>
<p>I loaded the following libraries to tackle this Home Credit Default Risk problem. The <code>tidyverse</code> pulls in <code>dplyr</code>, <code>ggplot2</code>, and several other must-haves (e.g. <code>forcats</code>, <code>purrr</code>, etc). The <code>recipes</code> package is loaded for preprocessing. The <code>h2o</code> package is going to do the heavy lifting via automated machine learning (AutoML).</p>
<figure>
<pre><code data-lang="r"><span># General </span><span>
</span><span>library</span><span>(</span><span>tidyverse</span><span>)</span><span>
</span><span>library</span><span>(</span><span>skimr</span><span>)</span><span>
</span><span># Preprocessing</span><span>
</span><span>library</span><span>(</span><span>recipes</span><span>)</span><span>
</span><span># Machine Learning</span><span>
</span><span>library</span><span>(</span><span>h</span><span>2</span><span>o</span><span>)</span></code></pre>
</figure>
<h4>Data</h4>
<p>Next, I read the data with <code>read_csv()</code>, which takes care of much of the column formats for us.</p>
<figure>
<pre><code data-lang="r"><span>application_train_tbl</span><span> </span><span>&lt;-</span><span> </span><span>read_csv</span><span>(</span><span>&quot;00_data/application_train.csv&quot;</span><span>)</span><span>
</span><span>application_test_tbl</span><span> </span><span>&lt;-</span><span> </span><span>read_csv</span><span>(</span><span>&quot;00_data/application_test.csv&quot;</span><span>)</span></code></pre>
</figure>
<p>Note that the files size is 158MB. This can be a problem when making multiple copies of this data in R, which can quickly cause us to run out of RAM. A strategy I used was to remove previous iterations of the data as I went through processing. You’ll see me use <code>rm()</code> a lot.</p>
<p>Next, I took a quick <code>slice()</code> of the data to see what features are present. I use <code>kable()</code> to format the table for printing here, but this was not done during the 30 minutes of coding.</p>
<figure>
<pre><code data-lang="r"><span>application_train_tbl</span><span> </span><span>%>%</span><span>
</span><span>slice</span><span>(</span><span>1</span><span>:</span><span>10</span><span>)</span><span> </span><span>%>%</span><span>
</span><span>knitr</span><span>::</span><span>kable</span><span>()</span></code></pre>
</figure>
<table>
<thead>
<tr>
<th>SK_ID_CURR</th>
<th>TARGET</th>
<th>NAME_CONTRACT_TYPE</th>
<th>CODE_GENDER</th>
<th>FLAG_OWN_CAR</th>
<th>FLAG_OWN_REALTY</th>
<th>CNT_CHILDREN</th>
<th>AMT_INCOME_TOTAL</th>
<th>AMT_CREDIT</th>
<th>AMT_ANNUITY</th>
<th>AMT_GOODS_PRICE</th>
<th>NAME_TYPE_SUITE</th>
<th>NAME_INCOME_TYPE</th>
<th>NAME_EDUCATION_TYPE</th>
<th>NAME_FAMILY_STATUS</th>
<th>NAME_HOUSING_TYPE</th>
<th>REGION_POPULATION_RELATIVE</th>
<th>DAYS_BIRTH</th>
<th>DAYS_EMPLOYED</th>
<th>DAYS_REGISTRATION</th>
<th>DAYS_ID_PUBLISH</th>
<th>OWN_CAR_AGE</th>
<th>FLAG_MOBIL</th>
<th>FLAG_EMP_PHONE</th>
<th>FLAG_WORK_PHONE</th>
<th>FLAG_CONT_MOBILE</th>
<th>FLAG_PHONE</th>
<th>FLAG_EMAIL</th>
<th>OCCUPATION_TYPE</th>
<th>CNT_FAM_MEMBERS</th>
<th>REGION_RATING_CLIENT</th>
<th>REGION_RATING_CLIENT_W_CITY</th>
<th>WEEKDAY_APPR_PROCESS_START</th>
<th>HOUR_APPR_PROCESS_START</th>
<th>REG_REGION_NOT_LIVE_REGION</th>
<th>REG_REGION_NOT_WORK_REGION</th>
<th>LIVE_REGION_NOT_WORK_REGION</th>
<th>REG_CITY_NOT_LIVE_CITY</th>
<th>REG_CITY_NOT_WORK_CITY</th>
<th>LIVE_CITY_NOT_WORK_CITY</th>
<th>ORGANIZATION_TYPE</th>
<th>EXT_SOURCE_1</th>
<th>EXT_SOURCE_2</th>
<th>EXT_SOURCE_3</th>
<th>APARTMENTS_AVG</th>
<th>BASEMENTAREA_AVG</th>
<th>YEARS_BEGINEXPLUATATION_AVG</th>
<th>YEARS_BUILD_AVG</th>
<th>COMMONAREA_AVG</th>
<th>ELEVATORS_AVG</th>
<th>ENTRANCES_AVG</th>
<th>FLOORSMAX_AVG</th>
<th>FLOORSMIN_AVG</th>
<th>LANDAREA_AVG</th>
<th>LIVINGAPARTMENTS_AVG</th>
<th>LIVINGAREA_AVG</th>
<th>NONLIVINGAPARTMENTS_AVG</th>
<th>NONLIVINGAREA_AVG</th>
<th>APARTMENTS_MODE</th>
<th>BASEMENTAREA_MODE</th>
<th>YEARS_BEGINEXPLUATATION_MODE</th>
<th>YEARS_BUILD_MODE</th>
<th>COMMONAREA_MODE</th>
<th>ELEVATORS_MODE</th>
<th>ENTRANCES_MODE</th>
<th>FLOORSMAX_MODE</th>
<th>FLOORSMIN_MODE</th>
<th>LANDAREA_MODE</th>
<th>LIVINGAPARTMENTS_MODE</th>
<th>LIVINGAREA_MODE</th>
<th>NONLIVINGAPARTMENTS_MODE</th>
<th>NONLIVINGAREA_MODE</th>
<th>APARTMENTS_MEDI</th>
<th>BASEMENTAREA_MEDI</th>
<th>YEARS_BEGINEXPLUATATION_MEDI</th>
<th>YEARS_BUILD_MEDI</th>
<th>COMMONAREA_MEDI</th>
<th>ELEVATORS_MEDI</th>
<th>ENTRANCES_MEDI</th>
<th>FLOORSMAX_MEDI</th>
<th>FLOORSMIN_MEDI</th>
<th>LANDAREA_MEDI</th>
<th>LIVINGAPARTMENTS_MEDI</th>
<th>LIVINGAREA_MEDI</th>
<th>NONLIVINGAPARTMENTS_MEDI</th>
<th>NONLIVINGAREA_MEDI</th>
<th>FONDKAPREMONT_MODE</th>
<th>HOUSETYPE_MODE</th>
<th>TOTALAREA_MODE</th>
<th>WALLSMATERIAL_MODE</th>
<th>EMERGENCYSTATE_MODE</th>
<th>OBS_30_CNT_SOCIAL_CIRCLE</th>
<th>DEF_30_CNT_SOCIAL_CIRCLE</th>
<th>OBS_60_CNT_SOCIAL_CIRCLE</th>
<th>DEF_60_CNT_SOCIAL_CIRCLE</th>
<th>DAYS_LAST_PHONE_CHANGE</th>
<th>FLAG_DOCUMENT_2</th>
<th>FLAG_DOCUMENT_3</th>
<th>FLAG_DOCUMENT_4</th>
<th>FLAG_DOCUMENT_5</th>
<th>FLAG_DOCUMENT_6</th>
<th>FLAG_DOCUMENT_7</th>
<th>FLAG_DOCUMENT_8</th>
<th>FLAG_DOCUMENT_9</th>
<th>FLAG_DOCUMENT_10</th>
<th>FLAG_DOCUMENT_11</th>
<th>FLAG_DOCUMENT_12</th>
<th>FLAG_DOCUMENT_13</th>
<th>FLAG_DOCUMENT_14</th>
<th>FLAG_DOCUMENT_15</th>
<th>FLAG_DOCUMENT_16</th>
<th>FLAG_DOCUMENT_17</th>
<th>FLAG_DOCUMENT_18</th>
<th>FLAG_DOCUMENT_19</th>
<th>FLAG_DOCUMENT_20</th>
<th>FLAG_DOCUMENT_21</th>
<th>AMT_REQ_CREDIT_BUREAU_HOUR</th>
<th>AMT_REQ_CREDIT_BUREAU_DAY</th>
<th>AMT_REQ_CREDIT_BUREAU_WEEK</th>
<th>AMT_REQ_CREDIT_BUREAU_MON</th>
<th>AMT_REQ_CREDIT_BUREAU_QRT</th>
<th>AMT_REQ_CREDIT_BUREAU_YEAR</th>
</tr>
</thead>
<tbody>
<tr>
<td>100002</td>
<td>1</td>
<td>Cash loans</td>
<td>M</td>
<td>N</td>
<td>Y</td>
<td>0</td>
<td>202500</td>
<td>406597.5</td>
<td>24700.5</td>
<td>351000</td>
<td>Unaccompanied</td>
<td>Working</td>
<td>Secondary / secondary special</td>
<td>Single / not married</td>
<td>House / apartment</td>
<td>0.018801</td>
<td>-9461</td>
<td>-637</td>
<td>-3648</td>
<td>-2120</td>
<td>NA</td>
<td>1</td>
<td>1</td>
<td>0</td>
<td>1</td>
<td>1</td>
<td>0</td>
<td>Laborers</td>
<td>1</td>
<td>2</td>
<td>2</td>
<td>WEDNESDAY</td>
<td>10</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>Business Entity Type 3</td>
<td>0.0830370</td>
<td>0.2629486</td>
<td>0.1393758</td>
<td>0.0247</td>
<td>0.0369</td>
<td>0.9722</td>
<td>0.6192</td>
<td>0.0143</td>
<td>0.00</td>
<td>0.0690</td>
<td>0.0833</td>
<td>0.1250</td>
<td>0.0369</td>
<td>0.0202</td>
<td>0.0190</td>
<td>0.0000</td>
<td>0.0000</td>
<td>0.0252</td>
<td>0.0383</td>
<td>0.9722</td>
<td>0.6341</td>
<td>0.0144</td>
<td>0.0000</td>
<td>0.0690</td>
<td>0.0833</td>
<td>0.1250</td>
<td>0.0377</td>
<td>0.022</td>
<td>0.0198</td>
<td>0</td>
<td>0</td>
<td>0.0250</td>
<td>0.0369</td>
<td>0.9722</td>
<td>0.6243</td>
<td>0.0144</td>
<td>0.00</td>
<td>0.0690</td>
<td>0.0833</td>
<td>0.1250</td>
<td>0.0375</td>
<td>0.0205</td>
<td>0.0193</td>
<td>0.0000</td>
<td>0.00</td>
<td>reg oper account</td>
<td>block of flats</td>
<td>0.0149</td>
<td>Stone, brick</td>
<td>No</td>
<td>2</td>
<td>2</td>
<td>2</td>
<td>2</td>
<td>-1134</td>
<td>0</td>
<td>1</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>1</td>
</tr>
<tr>
<td>100003</td>
<td>0</td>
<td>Cash loans</td>
<td>F</td>
<td>N</td>
<td>N</td>
<td>0</td>
<td>270000</td>
<td>1293502.5</td>
<td>35698.5</td>
<td>1129500</td>
<td>Family</td>
<td>State servant</td>
<td>Higher education</td>
<td>Married</td>
<td>House / apartment</td>
<td>0.003541</td>
<td>-16765</td>
<td>-1188</td>
<td>-1186</td>
<td>-291</td>
<td>NA</td>
<td>1</td>
<td>1</td>
<td>0</td>
<td>1</td>
<td>1</td>
<td>0</td>
<td>Core staff</td>
<td>2</td>
<td>1</td>
<td>1</td>
<td>MONDAY</td>
<td>11</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>School</td>
<td>0.3112673</td>
<td>0.6222458</td>
<td>NA</td>
<td>0.0959</td>
<td>0.0529</td>
<td>0.9851</td>
<td>0.7960</td>
<td>0.0605</td>
<td>0.08</td>
<td>0.0345</td>
<td>0.2917</td>
<td>0.3333</td>
<td>0.0130</td>
<td>0.0773</td>
<td>0.0549</td>
<td>0.0039</td>
<td>0.0098</td>
<td>0.0924</td>
<td>0.0538</td>
<td>0.9851</td>
<td>0.8040</td>
<td>0.0497</td>
<td>0.0806</td>
<td>0.0345</td>
<td>0.2917</td>
<td>0.3333</td>
<td>0.0128</td>
<td>0.079</td>
<td>0.0554</td>
<td>0</td>
<td>0</td>
<td>0.0968</td>
<td>0.0529</td>
<td>0.9851</td>
<td>0.7987</td>
<td>0.0608</td>
<td>0.08</td>
<td>0.0345</td>
<td>0.2917</td>
<td>0.3333</td>
<td>0.0132</td>
<td>0.0787</td>
<td>0.0558</td>
<td>0.0039</td>
<td>0.01</td>
<td>reg oper account</td>
<td>block of flats</td>
<td>0.0714</td>
<td>Block</td>
<td>No</td>
<td>1</td>
<td>0</td>
<td>1</td>
<td>0</td>
<td>-828</td>
<td>0</td>
<td>1</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
</tr>
<tr>
<td>100004</td>
<td>0</td>
<td>Revolving loans</td>
<td>M</td>
<td>Y</td>
<td>Y</td>
<td>0</td>
<td>67500</td>
<td>135000.0</td>
<td>6750.0</td>
<td>135000</td>
<td>Unaccompanied</td>
<td>Working</td>
<td>Secondary / secondary special</td>
<td>Single / not married</td>
<td>House / apartment</td>
<td>0.010032</td>
<td>-19046</td>
<td>-225</td>
<td>-4260</td>
<td>-2531</td>
<td>26</td>
<td>1</td>
<td>1</td>
<td>1</td>
<td>1</td>
<td>1</td>
<td>0</td>
<td>Laborers</td>
<td>1</td>
<td>2</td>
<td>2</td>
<td>MONDAY</td>
<td>9</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>Government</td>
<td>NA</td>
<td>0.5559121</td>
<td>0.7295667</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>-815</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
</tr>
<tr>
<td>100006</td>
<td>0</td>
<td>Cash loans</td>
<td>F</td>
<td>N</td>
<td>Y</td>
<td>0</td>
<td>135000</td>
<td>312682.5</td>
<td>29686.5</td>
<td>297000</td>
<td>Unaccompanied</td>
<td>Working</td>
<td>Secondary / secondary special</td>
<td>Civil marriage</td>
<td>House / apartment</td>
<td>0.008019</td>
<td>-19005</td>
<td>-3039</td>
<td>-9833</td>
<td>-2437</td>
<td>NA</td>
<td>1</td>
<td>1</td>
<td>0</td>
<td>1</td>
<td>0</td>
<td>0</td>
<td>Laborers</td>
<td>2</td>
<td>2</td>
<td>2</td>
<td>WEDNESDAY</td>
<td>17</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>Business Entity Type 3</td>
<td>NA</td>
<td>0.6504417</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>2</td>
<td>0</td>
<td>2</td>
<td>0</td>
<td>-617</td>
<td>0</td>
<td>1</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
</tr>
<tr>
<td>100007</td>
<td>0</td>
<td>Cash loans</td>
<td>M</td>
<td>N</td>
<td>Y</td>
<td>0</td>
<td>121500</td>
<td>513000.0</td>
<td>21865.5</td>
<td>513000</td>
<td>Unaccompanied</td>
<td>Working</td>
<td>Secondary / secondary special</td>
<td>Single / not married</td>
<td>House / apartment</td>
<td>0.028663</td>
<td>-19932</td>
<td>-3038</td>
<td>-4311</td>
<td>-3458</td>
<td>NA</td>
<td>1</td>
<td>1</td>
<td>0</td>
<td>1</td>
<td>0</td>
<td>0</td>
<td>Core staff</td>
<td>1</td>
<td>2</td>
<td>2</td>
<td>THURSDAY</td>
<td>11</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>1</td>
<td>1</td>
<td>Religion</td>
<td>NA</td>
<td>0.3227383</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>-1106</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>1</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
</tr>
<tr>
<td>100008</td>
<td>0</td>
<td>Cash loans</td>
<td>M</td>
<td>N</td>
<td>Y</td>
<td>0</td>
<td>99000</td>
<td>490495.5</td>
<td>27517.5</td>
<td>454500</td>
<td>Spouse, partner</td>
<td>State servant</td>
<td>Secondary / secondary special</td>
<td>Married</td>
<td>House / apartment</td>
<td>0.035792</td>
<td>-16941</td>
<td>-1588</td>
<td>-4970</td>
<td>-477</td>
<td>NA</td>
<td>1</td>
<td>1</td>
<td>1</td>
<td>1</td>
<td>1</td>
<td>0</td>
<td>Laborers</td>
<td>2</td>
<td>2</td>
<td>2</td>
<td>WEDNESDAY</td>
<td>16</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>Other</td>
<td>NA</td>
<td>0.3542247</td>
<td>0.6212263</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>-2536</td>
<td>0</td>
<td>1</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>1</td>
<td>1</td>
</tr>
<tr>
<td>100009</td>
<td>0</td>
<td>Cash loans</td>
<td>F</td>
<td>Y</td>
<td>Y</td>
<td>1</td>
<td>171000</td>
<td>1560726.0</td>
<td>41301.0</td>
<td>1395000</td>
<td>Unaccompanied</td>
<td>Commercial associate</td>
<td>Higher education</td>
<td>Married</td>
<td>House / apartment</td>
<td>0.035792</td>
<td>-13778</td>
<td>-3130</td>
<td>-1213</td>
<td>-619</td>
<td>17</td>
<td>1</td>
<td>1</td>
<td>0</td>
<td>1</td>
<td>1</td>
<td>0</td>
<td>Accountants</td>
<td>3</td>
<td>2</td>
<td>2</td>
<td>SUNDAY</td>
<td>16</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>Business Entity Type 3</td>
<td>0.7747614</td>
<td>0.7239999</td>
<td>0.4920601</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>1</td>
<td>0</td>
<td>1</td>
<td>0</td>
<td>-1562</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>1</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>1</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>1</td>
<td>1</td>
<td>2</td>
</tr>
<tr>
<td>100010</td>
<td>0</td>
<td>Cash loans</td>
<td>M</td>
<td>Y</td>
<td>Y</td>
<td>0</td>
<td>360000</td>
<td>1530000.0</td>
<td>42075.0</td>
<td>1530000</td>
<td>Unaccompanied</td>
<td>State servant</td>
<td>Higher education</td>
<td>Married</td>
<td>House / apartment</td>
<td>0.003122</td>
<td>-18850</td>
<td>-449</td>
<td>-4597</td>
<td>-2379</td>
<td>8</td>
<td>1</td>
<td>1</td>
<td>1</td>
<td>1</td>
<td>0</td>
<td>0</td>
<td>Managers</td>
<td>2</td>
<td>3</td>
<td>3</td>
<td>MONDAY</td>
<td>16</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>1</td>
<td>1</td>
<td>Other</td>
<td>NA</td>
<td>0.7142793</td>
<td>0.5406545</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>2</td>
<td>0</td>
<td>2</td>
<td>0</td>
<td>-1070</td>
<td>0</td>
<td>1</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
</tr>
<tr>
<td>100011</td>
<td>0</td>
<td>Cash loans</td>
<td>F</td>
<td>N</td>
<td>Y</td>
<td>0</td>
<td>112500</td>
<td>1019610.0</td>
<td>33826.5</td>
<td>913500</td>
<td>Children</td>
<td>Pensioner</td>
<td>Secondary / secondary special</td>
<td>Married</td>
<td>House / apartment</td>
<td>0.018634</td>
<td>-20099</td>
<td>365243</td>
<td>-7427</td>
<td>-3514</td>
<td>NA</td>
<td>1</td>
<td>0</td>
<td>0</td>
<td>1</td>
<td>0</td>
<td>0</td>
<td>NA</td>
<td>2</td>
<td>2</td>
<td>2</td>
<td>WEDNESDAY</td>
<td>14</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>XNA</td>
<td>0.5873340</td>
<td>0.2057473</td>
<td>0.7517237</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>1</td>
<td>0</td>
<td>1</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>1</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>1</td>
</tr>
<tr>
<td>100012</td>
<td>0</td>
<td>Revolving loans</td>
<td>M</td>
<td>N</td>
<td>Y</td>
<td>0</td>
<td>135000</td>
<td>405000.0</td>
<td>20250.0</td>
<td>405000</td>
<td>Unaccompanied</td>
<td>Working</td>
<td>Secondary / secondary special</td>
<td>Single / not married</td>
<td>House / apartment</td>
<td>0.019689</td>
<td>-14469</td>
<td>-2019</td>
<td>-14437</td>
<td>-3992</td>
<td>NA</td>
<td>1</td>
<td>1</td>
<td>0</td>
<td>1</td>
<td>0</td>
<td>0</td>
<td>Laborers</td>
<td>1</td>
<td>2</td>
<td>2</td>
<td>THURSDAY</td>
<td>8</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>Electricity</td>
<td>NA</td>
<td>0.7466436</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>2</td>
<td>0</td>
<td>2</td>
<td>0</td>
<td>-1673</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
<td>NA</td>
</tr>
</tbody>
</table>
<p>application_train_tbl: First 10 Rows</p>
<p>A few points about the data:</p>
<ul>
<li>
<p>The training data contains 307K observations, which are people applied for and received loans</p>
</li>
<li>
<p>The “TARGET” column identifies whether or not the person defaulted</p>
</li>
<li>
<p>The remaining 121 features describe various attributes about the person, loan, and application</p>
</li>
<li>
<p>There are several additional data sets (<code>bureau.csv</code>, <code>previous_application.csv</code>). I ignored these since most of the important data was likely to be in the main file. These auxiliary files contain data that is one-to-many relationship, which would require aggregation (a feature engineering method) and considerably more work for the unknown benefit.</p>
</li>
</ul>
<p>I was more interested in <strong>agile iteration</strong>: Building a good model quickly, then going back to try to improve later.</p>
<h4>Train And Test Sets</h4>
<p>Next, I formatted the data as train and test sets. I noted that the “application_test_tbl” did not have a TARGET column (I found this out when I tried to process it with <code>recipes</code> during the first go-around). The “test” set is the set that the Kaggle Competition is measured against that we will submit later. Note that I remove the unnecessary data sets after I’m finished with them in order to save memory.</p>
<figure>
<pre><code data-lang="r"><span># Training data: Separate into x and y tibbles</span><span>
</span><span>x_train_tbl</span><span> </span><span>&lt;-</span><span> </span><span>application_train_tbl</span><span> </span><span>%>%</span><span> </span><span>select</span><span>(</span><span>-</span><span>TARGET</span><span>)</span><span>
</span><span>y_train_tbl</span><span> </span><span>&lt;-</span><span> </span><span>application_train_tbl</span><span> </span><span>%>%</span><span> </span><span>select</span><span>(</span><span>TARGET</span><span>)</span><span> </span><span># Testing data: What we submit in the competition</span><span>
</span><span>x_test_tbl</span><span> </span><span>&lt;-</span><span> </span><span>application_test_tbl</span><span>
</span><span># Remove the original data to save memory</span><span>
</span><span>rm</span><span>(</span><span>application_train_tbl</span><span>)</span><span>
</span><span>rm</span><span>(</span><span>application_test_tbl</span><span>)</span></code></pre>
</figure>
<h4>Data Inspection</h4>
<p>I used one of my favorite packages for data investigation, <code>skimr</code>. This package helps me understand how much missing data I’m dealing with and overall sense of the data by data type.</p>
<p>Normally I just run <code>skim()</code> on the data. However, for the purposes of outputting in a readable format on the web, I’ll use <code>skim_to_list()</code></p>
<figure>
<pre><code data-lang="r"><span>skim_to_list</span><span>(</span><span>x_train_tbl</span><span>)</span></code></pre>
</figure>
<figure>
<pre><code data-lang="text">## $integer
## # A tibble: 40 x 12
##    variable  missing complete n      mean   sd     p0    p25   median
##  * </code></pre></figure>