<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[DataMiningApps Articles - Medium]]></title>
        <description><![CDATA[Publications from dataminingapps.com — the Data Mining, Data Science and Analytics research team chaired by prof. dr. Bart Baesens and dr. Seppe vanden Broucke at KU Leuven (Belgium). - Medium]]></description>
        <link>https://medium.com/dataminingapps-articles?source=rss----39db1fe7f950---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>DataMiningApps Articles - Medium</title>
            <link>https://medium.com/dataminingapps-articles?source=rss----39db1fe7f950---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 27 Nov 2026 23:39:57 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/dataminingapps-articles" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Markov Chains for CLV Modeling: a Review]]></title>
            <link>https://medium.com/dataminingapps-articles/markov-chains-for-clv-modeling-a-review-9218d0c3f13e?source=rss----39db1fe7f950---4</link>
            <guid isPermaLink="false">https://medium.com/p/9218d0c3f13e</guid>
            <category><![CDATA[markov-chains]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[clv-modeling]]></category>
            <dc:creator><![CDATA[Seppe vanden Broucke]]></dc:creator>
            <pubDate>Fri, 05 Jun 2020 14:26:58 GMT</pubDate>
            <atom:updated>2020-06-05T14:26:58.256Z</atom:updated>
            <content:encoded><![CDATA[<p><em>This article first appeared in Data Science Briefings, the </em><a href="http://www.dataminingapps.com/"><em>DataMiningApps</em></a><em> newsletter. </em><a href="http://www.dataminingapps.com/dataminingapps-newsletter/"><em>Subscribe now</em></a><em> for free if you want to be the first to receive our feature articles, or follow us </em><a href="https://twitter.com/DataMiningApps"><em>@DataMiningApps</em></a><em>. Do you also wish to contribute to Data Science Briefings? Shoot us an e-mail over at </em><a href="/service/mailto:briefings@dataminingapps.com"><em>briefings@dataminingapps.com</em></a><em> and let’s get in touch!</em></p><p><em>Contributed by: </em><a href="https://www.dataminingapps.com/dma_staff/bart-baesens/"><em>Bart Baesens</em></a><em>, </em><a href="https://www.dataminingapps.com/dma_staff/seppe-vanden-broucke/"><em>Seppe vanden Broucke</em></a></p><p>Let’s start with the basic idea of Markov Chains before we work out a small example. We start from a collection of random variables X0, X1, X2, etc. which can take values in one of M states.</p><p>The process is said to be a finite-valued Markov chain if</p><p>P(Xt+1=j|X0=k0, X1=k1, …,Xt-1=kt-1, Xt=i) = P(Xt+1=j|Xt=i) <br>for all t, i, j where 1 ≤ i and j ≤ M</p><p>In other words, once the current state is known, the history may be thrown away. The current state is a sufficient statistic for the future. Essentially, a Markov process is a <em>memoryless random process</em>. The probabilities P(Xt+1=j|Xt=i) are called <em>transition probabilities</em> and are usually represented as pt(i,j). Obviously, all probabilities are between 0 and 1 and at any given time point t, the sum of the probabilities of moving from a given state i to any other state j should equal 1.</p><p>The transition probabilities can be obtained using the idea of maximum likelihood where the probabilities p(i,j) = n(i,j)/n(i) with n(i) the total number of times state i appeared and n(i,j) the total number of times the sequence (i,j) appeared from time 1 to T. Note that there are Chi-squared testing procedures available to test for the Markov assumption. The reason the Markov assumption is often made is because it simplifies simulations as we will see below. Also, it is an assumption which comes close to reality in many real-life situations. As an example consider weather forecasting. If we adopt a very simple model stating the weather of tomorrow is the same as that of today, then you will in fact observe that you have a pretty good weather forecasting model.</p><p>Let’s work out an example of Markov Chain analysis in a Customer Lifetime Value (CLV) setting. Examples of customer states could be platinum, gold, silver, bronze and churn. Other examples could be based on the outcome of an RFM analysis or deciles of the CLV distribution. Three types of transitions can be distinguished: staying in the current state, upgrading from silver to gold for example, or downgrading from bronze to churn for example. Note that in this case churn is considered an absorbing state since once in it, you can not get out of it anymore.</p><p>Below you can see an example of a transition matrix with 5 states: platinum, gold, silver, bronze and churn. You can see the absolute numbers at the top. At the bottom, you can see the corresponding maximum likelihood probabilities. Note again that churn is an absorbing state, so once in it, you cannot get out of it anymore. Hence, the 100% in the lower right cell.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/540/0*GOlF510ztJo8Ktj9.png" /></figure><p>Here you can see an alternative network representation of our Markov Chain. The nodes represent the states. The arcs the transitions. The transition probabilities are added next to each arc. Obviously, from a given node all transition probabilities should sum to 1. The more states the harder it becomes to visualize the Markov chain as a network.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/540/0*6-UdNBapSlhEMcO1.png" /></figure><p>Let’s study the migration matrix into some more detail. As said, all migration probabilities are between 0 and 1 and the sum across the rows is always 1. The latter is obvious since a customer can either keep the same state, downgrade or upgrade. Do note that the sum across the columns is not equal to 1. When smooth transitions are desired, the business might require the transition probabilities to decrease as you are getting further away from the diagonal, so some additional smoothing operators might be applied. Above diagonal elements represent downgrades and below diagonal elements represent upgrades. Also note that many migration matrices are typically diagonally dominant which means that many customers tend to keep their state and only a minority migrates. These then typically represent the loyal customers with a steady-state purchasing behavior.</p><p>Remember the Markov assumption which stated that the state at time t+1 only depends upon the state at time t. Because of this assumption, it is really easy to start doing simulations or projections by multiplying the transition matrix by itself. In other words, the two period transition matrix can be obtained by squaring T. More generally, the n-period transition matrix can be obtained by raising T to the power n.</p><p>Let’s illustrate this with an example. Say we continue from our earlier example with 5 states: platinum, gold, silver, bronze and churn. Assume we start with 10 Platinum customers, 20 Gold customers, 100 Silver customers, 50 Bronze customers and 0 Churners. We can then calculate the state after 1 period of time using simple matrix calculation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/540/0*68aZy6faao7otmdr.png" /></figure><p>Remember, matrix calculation is done by pairwise multiplying the row elements with the column elements and adding everything up. In our example, the first result is calculated as 10 times 0.6 + 20 times 0.125 + 100 times 0.05 + 50 times 0 + 0 times 0 which equals 14. The other numbers are calculated in a similar way. After one period, this gives us 14 platinum customers, 30 gold customers, 63 silver customers, 61 bronze customers and 12 churners.</p><p>We can now continue the analysis and calculate the state after two periods of time.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/540/0*vaaI3JbJsBQ9Wt8e.png" /></figure><p>We multiply the previous result with the transition matrix once more. This gives us 15 platinum customers, 34 gold customers, 49 silver customers, 59 bronze customers and 23 churners. We can continue the analysis as far as we want.</p><p>A Markov reward process is essentially a Markov chain with values which represent rewards assigned to a state or transition. In a CLV setting, it is obvious that a state reward could represent the customer value in that given state. An example of a transition award could be the cost for upgrading a customer from silver to gold for example. Note that the reward is negative in this case. A discounting factor could also be applied to properly discount future rewards to the time of evaluation. You can see this illustrated here to compute CLV and customer equity. We start from the value formula as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/228/0*riffABlUjH_DR4uy.png" /></figure><p>Essentially, Vk is a column vector of expected present values over k periods for each of the states. Let’s work out a small example to illustrate this. Say we have a 5 by 1 reward vector R which we assume to be constant in time but different for the different states: platinum, gold, silver, bronze and churn.</p><p>R = [ 20 10 5 2 0 ]</p><p>You can see that platinum customers give a value of 20, gold customers a value of 10, etc. The transition matrix is the same as previously. We apply a yearly discount factor of 15% and calculate Vk with a time horizon of 3 years. Doing the simulations according to what we explained earlier results in the 5 by 1 Vk vector you can see illustrated here:</p><p>Vk = [ 21 13 6 4 0 ]</p><p>The expected present value for the platinum state equals 21, for the gold state 13, etc.</p><p>Say we again started with 10 Platinum customers, 20 Gold customers, 100 Silver customers, 50 Bronze customers and 0 Churners as represented by the vector P. We can then calculate the customer equity for the 3 year period using simple matrix multiplication which results into the final customer equity value of 1270.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/540/0*o665bH3bgD6nnn94.png" /></figure><p>We can now also be more ambitious and consider an infinite time horizon, with t going to infinity. Mathematically, it can be shown that the expression then becomes</p><p>where I represents the identity matrix. If we work this out for our example, the V vector becomes as illustrated. The customer equity at infinity can then again be calculated using matrix multiplication and becomes 6210. If you want more information about this, I am happy to refer to the paper by Pfeifer and Carraway which appeared in the Journal of Interactive Marketing in 2000.</p><p>For more information on Markov Chains (e.g., Markov Decision Processes) for Customer Lifetime Value Modeling, we are happy to refer to our BlueCourses course <a href="https://www.bluecourses.com/courses/course-v1:bluecourses%2BBC8%2B2020_Q2/about">Customer Lifetime Value Modeling</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9218d0c3f13e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/dataminingapps-articles/markov-chains-for-clv-modeling-a-review-9218d0c3f13e">Markov Chains for CLV Modeling: a Review</a> was originally published in <a href="https://medium.com/dataminingapps-articles">DataMiningApps Articles</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Fraud Analytics using Benford’s Law]]></title>
            <link>https://medium.com/dataminingapps-articles/fraud-analytics-using-benfords-law-b206996b7fe9?source=rss----39db1fe7f950---4</link>
            <guid isPermaLink="false">https://medium.com/p/b206996b7fe9</guid>
            <category><![CDATA[fraud-analytics]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[data-mining]]></category>
            <dc:creator><![CDATA[Seppe vanden Broucke]]></dc:creator>
            <pubDate>Wed, 27 May 2020 19:55:56 GMT</pubDate>
            <atom:updated>2020-05-27T19:55:56.848Z</atom:updated>
            <content:encoded><![CDATA[<p>In this article, we’ll introduce Benford’s law, which describes a surprising and fascinating fact about the distribution of the first digits of numbers. We’ll explain how this law has become an important tool in detecting fraud.</p><p>Let’s start by taking a newspaper at a random page and write down the first or leftmost digit which is either 1, 2, 3, until 9. What are the expected frequencies of these digits? If all digits are equally likely then we expect to observe each digit as the first digit in approximately 1 out of 9 or 11% of cases:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/0*FEHayXPWs-N_ax2S.png" /></figure><p>Benford’s law, however, predicts a different distribution for the first digit of a number. According to Benford’s law, the probability that the first digit equals 1 is about 30%, while it’s only 4.6% for digit 9:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/0*-Tre5rqr-PUrC2w2.png" /></figure><p>This surprising phenomenon was first discovered by astronomist Newcomb in 1881 and later rediscovered by Benford in 1938. Both noted that in a book of logarithms the first pages, with low first digits, are more frequently used than the last pages with digits 7, 8 and 9 since they were more dirty. In that time logarithm tables were frequently used to speed up the multiplication of two numbers. Benford analyzed the distribution of the first digits in 20 tables concerning populations, molecular weights, mathematical sequences and death rates. In total he observed 20,229 numbers by hand. He found the leading digit, d=1 to 9, occurs with a probability:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/157/0*STAFQRh7KetDudRX.png" /></figure><p>The antifraud rationale behind the use of the law is that producing empirical distributions of digits that conform to the law is difficult for non-experts. Fraudsters may thus be biased toward simpler and more intuitive distributions, such as the uniform. Strong deviations from the expected frequencies might indicate that the data is suspicious, possibly manipulated, and thus fraudulent. Hence, Benford’s law can be used as a screening tool for fraud detection. If Benford’s law is not satisfied, then it is probable that the involved data was manipulated and further investigation is required. Conversely, if a data set complies with Benford’s law, it can still be fraudulent. Data sets satisfying one of the following conditions typically conform to Benford’s Law:</p><ul><li>Data where numbers represent sizes of facts or events</li><li>Data in which numbers have no relationship to each other</li><li>Data sets that grow exponentially or arise from multiplicative fluctuations</li><li>Mixtures of different data sets</li><li>And finally, some well-known infinite integer sequences</li></ul><p>Typically, the more orders of magnitude that the data covers (at least 4 digits) and the more observations we have (typically 1000 or more), the more likely the data set will satisfy Benford’s Law.</p><p>We have already seen that many real datasets conform to Benford’s Law. Most financial data and accounting numbers generally conform to Benford’s Law. Fraudsters typically change the dataset by adding invented numbers or changing real observations which do not follow Benford’s Law. Due to these abnormal duplications and atypical numbers, the dataset is not conform to Benford’s Law anymore. Hence Benford’s Law is a popular tool for fraud detection since it identifies deviations that need further review. It is even legally admissible as evidence in the US in criminal cases at the federal, state and local levels. Benford’s law has been successfully used for</p><ul><li>check fraud</li><li>electricity theft</li><li>forensic accounting</li><li>payments fraud</li></ul><p>Benford’s Law was for example used as evidence of voter fraud in the 2009 Iranian election. Mark Nigrini showed that Benford’s Law could be used in forensic accounting and auditing as an indicator of accounting and expenses fraud.</p><p>Not every dataset has to conform to Benford’s Law and many will never do. Examples are:</p><ul><li>If there is a lower and/or upper bound or data is concentrated in a narrow interval, e.g. hourly wage rate or height of people.</li><li>If numbers are used as identification numbers or labels, e.g. social security number, flight numbers, car license plate numbers, phone numbers.</li><li>If fluctuations are additive instead of multiplicative, e.g. heartbeats on a given day</li></ul><p>Let’s work out an example of using Benford’s law for fraud detection. Assume the internal audit department of a company needs to check employee reimbursements for fraud. Employees may reimburse business meals and travel expenses after mailing scanned images of receipts. Assume we want to analyze the amounts that were reimbursed to employee Tom in the last 5 years. Below you can see the distribution of the reimbursements depicted by the light blue histogram. The red line corresponds to Benford’s law. It is clear that the dataset has less 1’s and more 7’s than expected under Benford’s Law. Based on this discrepancy, the company can then further investigate Tom’s expenses. After analyzing his reimbursements starting with 7, it was detected that Tom replaced 1/3 of his expenses starting with a 1 by a 7 before scanning the receipt.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/0*KgIeEMNP_riOY3nx.png" /></figure><p>Benford’s law has also been extended to the first-two digits. A dataset satisfies Benford’s Law for the first-two digits if the probability that the first-two digits equal is approximately:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/0*LriffprPfqnrRaUI.png" /></figure><p>This test is considered more reliable than the first digits test and is more frequently used in fraud detection. Below you can see an example of this. This data contains the populations of 19509 towns and cities of US (July 2009). You can see that the distribution of the first two digits nicely corresponds to Benford’s law.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/0*Qw8eKiw9h2zSVPAJ.png" /></figure><p>We can then create predictive features based on Benford’s law. More specifically, we can featurize the discrepancy between the empirical distribution and Benford’s law using a statistical distance measure such as the Kullback-Leibler divergence or Kolmogorov-Smirnov statistic. These can then be added to the fraud data set for predictive modeling.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b206996b7fe9" width="1" height="1" alt=""><hr><p><a href="https://medium.com/dataminingapps-articles/fraud-analytics-using-benfords-law-b206996b7fe9">Fraud Analytics using Benford’s Law</a> was originally published in <a href="https://medium.com/dataminingapps-articles">DataMiningApps Articles</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Using Autoencoders for Fraud Detection]]></title>
            <link>https://medium.com/dataminingapps-articles/using-autoencoders-for-fraud-detection-86182f843cc0?source=rss----39db1fe7f950---4</link>
            <guid isPermaLink="false">https://medium.com/p/86182f843cc0</guid>
            <category><![CDATA[fraud-detection]]></category>
            <category><![CDATA[autoencoder]]></category>
            <category><![CDATA[neural-networks]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Seppe vanden Broucke]]></dc:creator>
            <pubDate>Sat, 23 May 2020 09:22:57 GMT</pubDate>
            <atom:updated>2020-05-23T09:22:40.951Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Contributed by: Jeroen Frans</em></p><p><em>(This article first appeared in Data Science Briefings, the </em><a href="http://www.dataminingapps.com/"><em>DataMiningApps</em></a><em> newsletter. </em><a href="http://www.dataminingapps.com/dataminingapps-newsletter/"><em>Subscribe now</em></a><em> for free if you want to be the first to receive our feature articles, or follow us </em><a href="https://twitter.com/DataMiningApps"><em>@DataMiningApps</em></a><em>.)</em></p><p>For this demonstration of using autoencoders in the context of fraud detection, we’ll use a Kaggle data set that is <a href="https://www.kaggle.com/mlg-ulb/creditcardfraud">readily available</a>. It contains European credit card transactions in the period of September 2013.</p><p>Fraud is a rare phenomenon. Out of the total of 284,807 transactions, only a mere 492 were fraudulent. This corresponds to an incidence rate of 0.172%. This means there is a strong class imbalance. The dataset contains 28 numerical features (V1 — V28) that are the result of a PCA transformation (for confidentiality reasons). On top of these features also the time is registered (expressed as seconds after the first observation) as well as the transaction.</p><p>A visual inspection of the data already shows that some of the features have a different distribution for the fraudulent cases compared to the non-fraudulent ones:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/0*HcHnLs0_IIcMaTK4.png" /></figure><p>As preparatory steps, we take the (chronologically) first 230,000 data points as a training set and the rest for validation. This resembles the real-life scenario where you will want to predict for future transactions whether they are fraudulent based on the earlier transactions done.</p><pre>df &lt;- read_csv(&quot;Data/creditcard.csv&quot;, <br>               col_types = list(Time = col_number()))</pre><pre>df_train &lt;- df %&gt;% <br>  filter(row_number(Time) &lt;= 230000) %&gt;% select(-Time)</pre><pre>df_test &lt;- df %&gt;% <br>  filter(row_number(Time) &gt; 230000) %&gt;% select(-Time)</pre><pre>## Picking joint bandwidth of 0.0309</pre><p>We are going to use autoencoders to detect the fraudulent cases. To do so, we will only use the non-fraudulent training data to learn an encoding function for the data. When we apply this on the validation set, we expect to see that the fraudulent transactions are not well reconstructed and can hence be detected. Since an autoencoder is a type of neural network, it is very important to normalize your data first. You can do this by rescaling the data to either a [0,1] or [-1,1] range or by standardizing them so that they are normally distributed with mean 0 and standard deviation 1. In R we can use the caret package which has a preprocessing functionality. With this functionality, we create a transformator with our training data that we can apply on the “future” data points or test set.</p><pre>minMaxScale &lt;- df_train %&gt;% select(-Class) %&gt;%<br>  preProcess(method = &quot;range&quot;) <br>  # use c(&quot;center&quot;, &quot;scale&quot;) for standardization</pre><pre>x_train &lt;- predict(minMaxScale, df_train) %&gt;%<br>  select(-Class) %&gt;%<br>  as.matrix()<br>x_test &lt;- predict(minMaxScale, df_test) %&gt;%<br>  select(-Class) %&gt;%<br>  as.matrix()</pre><pre>y_train &lt;- df_train$Class<br>y_test &lt;- df_test$Class</pre><p>Next, we need to design a neural network model architecture. In this example we will use Keras to define our model architecture and TensorFlow to do the actual calculations. Here we will use three hidden layers. One with 12 neurons, one bottleneck layer of 6 and one layer of 12 again. For the activation function we will use the hyperbolic tangent function. Any non-linear function should work fine here and you can also use linear functions. You can play around with other activation functions like ReLU and sigmoid as well. If you were to use an identity function as activation, then the autoencoder would perform similar to a PCA analysis.</p><p>Also, since we are training on only the non-fraudulent transactions, you will want to learn as much as possible from these transaction. We can also consider increasing the number of nodes in the symmetric hidden layers to a number higher than 28. This will make the model learn latent features in the data and puts less emphasis on compressing the data. We did not use Time as a feature in the model. A great possible way to further improve the model could be by engineering a new feature out of this variable.</p><p>After having defined the model, we compile it and train it. The loss function used is the mean squared error. This makes sense since we want to minimize the distance between our inputs and the reconstructed output. For the optimization, adam was used.</p><pre>model &lt;- keras_model_sequential()<br>model %&gt;%<br>  layer_dense(units = 12, activation = &quot;tanh&quot;, input_shape = ncol(x_train)) %&gt;%<br>  layer_dense(units = 6, activation = &quot;tanh&quot;) %&gt;%<br>  layer_dense(units = 12, activation = &quot;tanh&quot;) %&gt;%<br>  layer_dense(units = ncol(x_train))<br>summary(model)<br>model %&gt;% compile(<br>  loss = &quot;mean_squared_error&quot;,<br>  optimizer = &quot;adam&quot;<br>)<br>history &lt;- model %&gt;% fit(<br>  x = x_train[y_train == 0,],<br>  y = x_train[y_train == 0,],<br>  epochs = 30,<br>  batch_size = 256,<br>  validation_data = list(x_test[y_test == 0,], x_test[y_test == 0,])<br>)</pre><p>If we now look at the reconstruction error (MSE) on the test set we see that there are some quite extreme outliers. Most errors lie between 0.01 and 0.025, but there are larger cases going up to 14. The density plot also shows the difference in reconstruction error between non-fraudulent transactions (in red) and fraud (in blue). We can see that there is a different distribution in terms of reconstruction error:</p><pre>pred_train &lt;- predict(model, x_train)<br>mse_train &lt;- apply((x_train - pred_train)^2, 1, sum)<br>pred_test &lt;- predict(model, x_test)<br>mse_test &lt;- apply((x_test - pred_test)^2, 1, sum)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/0*U_ATKiZIBJLvkEPc.png" /></figure><p>The way we handle this outcome might depend on the resources that are available. One very coarse approach is to take the 200/500/. . . observations with the highest reconstruction error of our test set or perhaps the 0.1% with highest reconstruction error. A second approach is to find a good cutoff value based on precision, recall or other evaluation measures. A third approach is to find a cost-optimal cutoff value. This means we will have to express the cost of investigating a transaction, the cost of a fraud case that goes undetected and possibly also the cost of a false alarm. Let’s try the first approach:</p><pre>top_200 &lt;- plotdata %&gt;% arrange(desc(mse_test)) %&gt;% top_n(200)<br>## Selecting by mse_test<br>incidence_rate &lt;- sum(top_200$y_test)/200</pre><p>We see that in the 200 highest there is an incidence rate of 19%. Compared to the dataset as a whole, which had an incidence rate of fraud of 0.17%, this is already quite an improvement.</p><p>The second approach would be to create a trade-off based on precision and recall values of the model:</p><pre>possible_k &lt;- seq(0, 1, length.out = 100)<br>precision &lt;- sapply(possible_k, function(k) {<br>  predicted_class &lt;- as.numeric(mse_test &gt; k)<br>  sum(predicted_class == 1 &amp; y_test == 1)/sum(predicted_class)<br>})<br>ggplot(data=as.data.frame(cbind(possible_k,precision)), aes(x = possible_k, y = precision)) +<br>geom_line(color=&quot;steelblue&quot;) + xlab(&quot;k treshold&quot;)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/0*IIaI3I3jEn8j_onK.png" /></figure><p>We want to detect as many fraud cases as possible, but try to avoid false alarm cases. If we merely look at the precision, we see that the optimal cutoff is somewhere around 0.3. Be aware however, that you also have to balance it out with respect to other evaluation measures like the recall value.</p><pre>recall &lt;- sapply(possible_k, function(k) {<br>  predicted_class &lt;- as.numeric(mse_test &gt; k)<br>  sum(predicted_class == 1 &amp; y_test == 1)/sum(y_test)<br>})<br>ggplot(data=as.data.frame(cbind(possible_k,recall)), aes(x = possible_k, y = recall)) +<br>geom_line(color=&quot;steelblue&quot;) + xlab(&quot;k treshold&quot;)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/0*IIIGU_yVGy5d8QOe.png" /></figure><p>In practice, there might be a cost involved in having wrong predictions. This can change the cutoff problem<br>to a cost optimisation problem. Every inspection of a transaction could have a fixed cost, since an employee<br>will have to spend time on it. Suppose this cost is 2.5 euro. The cost of not detecting a fraud case will also<br>have a cost, namely the amount of money of the fraudulent transaction. The problem would then change to:</p><pre>avg_cost_per_check &lt;- 2.5<br>lost_money &lt;- sapply(possible_k, function(k) {<br>  predicted_class &lt;- as.numeric(mse_test &gt; k)<br>  sum(avg_cost_per_check * predicted_class + (predicted_class == 0) * y_test * df_test$Amount)<br>})<br>ggplot(data = as.data.frame(cbind(possible_k,lost_money)), aes(x = possible_k, y = lost_money)) +<br>geom_line(color=&quot;steelblue&quot;) + xlab(&quot;k treshold&quot;) + ylab(&quot;Cost&quot;)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/0*84T4y6pAG67Bu29P.png" /></figure><p>Now the optimal cutoff would be 0.101. You could also make the cost function more complex: there might also be a cost for false<br>alarms, where y_test == 0 and predicted_class == 1. Customers could leave when their card is blocked too often for no reason. What would be the cost of losing a customer?</p><p>This initial exploration and some of the cost functions are inspired on a <a href="https://blogs.rstudio.com/tensorflow/posts/2018-01-24-keras-fraud-autoencoder">blog post of D Falbel</a>, which includes an extra section on hyperparameter tuning. The workflow would look very similar in Python: the model is trained with the same TensorFlow/Keras setup and the normalization can be done with scikit-learn. Code for this post can be found on <a href="https://gitlab.com/JeroenFrans/autoencoder-for-fraud-demo">this Gitlab repository</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=86182f843cc0" width="1" height="1" alt=""><hr><p><a href="https://medium.com/dataminingapps-articles/using-autoencoders-for-fraud-detection-86182f843cc0">Using Autoencoders for Fraud Detection</a> was originally published in <a href="https://medium.com/dataminingapps-articles">DataMiningApps Articles</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ProfLogit: a Proﬁt Maximizing Logistic Regression Model for Customer Churn Prediction]]></title>
            <link>https://medium.com/dataminingapps-articles/proflogit-a-pro%EF%AC%81t-maximizing-logistic-regression-model-for-customer-churn-prediction-2aa5dd293934?source=rss----39db1fe7f950---4</link>
            <guid isPermaLink="false">https://medium.com/p/2aa5dd293934</guid>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Seppe vanden Broucke]]></dc:creator>
            <pubDate>Tue, 24 Jul 2018 20:32:17 GMT</pubDate>
            <atom:updated>2018-07-24T20:32:17.446Z</atom:updated>
            <content:encoded><![CDATA[<p>Contributed by: <a href="http://www.dataminingapps.com/sendpress/eyJpZCI6MCwicmVwb3J0IjoyNDc5LCJ2aWV3IjoidHJhY2tlciIsInVybCI6Imh0dHA6XC9cL3d3dy5kYXRhbWluaW5nYXBwcy5jb21cL2RtYV9zdGFmZlwvZXVnZW4tc3RyaXBsaW5nXC8ifQ/">Eugen Stripling</a>, <a href="http://www.dataminingapps.com/sendpress/eyJpZCI6MCwicmVwb3J0IjoyNDc5LCJ2aWV3IjoidHJhY2tlciIsInVybCI6Imh0dHA6XC9cL3d3dy5kYXRhbWluaW5nYXBwcy5jb21cL2RtYV9zdGFmZlwvc2VwcGUtdmFuZGVuLWJyb3Vja2VcLyJ9/">Seppe vanden Broucke</a> and <a href="http://www.dataminingapps.com/sendpress/eyJpZCI6MCwicmVwb3J0IjoyNDc5LCJ2aWV3IjoidHJhY2tlciIsInVybCI6Imh0dHA6XC9cL3d3dy5kYXRhbWluaW5nYXBwcy5jb21cL2RtYV9zdGFmZlwvYmFydC1iYWVzZW5zXC8ifQ/">Bart Baesens</a></p><p><em>(This article first appeared in Data Science Briefings, the </em><a href="http://www.dataminingapps.com/"><em>DataMiningApps</em></a><em> newsletter. </em><a href="http://www.dataminingapps.com/dataminingapps-newsletter/"><em>Subscribe now</em></a><em> for free if you want to be the first to receive our feature articles, or follow us </em><a href="https://twitter.com/DataMiningApps"><em>@DataMiningApps</em></a><em>.)</em></p><p><em>Profit maximization </em>is a main business requirement of corporate organizations, hence a data science application should focus on the <em>profitability </em>of a given business setting [1, 2]. The adaptation of analytics to a specific business application (e.g., churn) is crucial, since it leads to <em>better decision making</em>. Insights from the analytical model support business decisions that allow attaining the <em>maximum </em>net profit, return, payoff, or value [3]. We refer to this value-centric approach as <em>profit-driven business analytics</em>.</p><p>In the spirit of the value-centric approach, we briefly outline in this column our new profit-driven modeling technique called <em>ProfLogit </em>[4]. Our associated research paper has been recently <a href="http://www.dataminingapps.com/sendpress/eyJpZCI6MCwicmVwb3J0IjoyNDc5LCJ2aWV3IjoidHJhY2tlciIsInVybCI6Imh0dHA6XC9cL2F1dGhvcnMuZWxzZXZpZXIuY29tXC9zZFwvYXJ0aWNsZVwvUzIyMTA2NTAyMTYzMDE3NTQifQ/">accepted for publication</a> by the international journal of <a href="http://www.dataminingapps.com/sendpress/eyJpZCI6MCwicmVwb3J0IjoyNDc5LCJ2aWV3IjoidHJhY2tlciIsInVybCI6Imh0dHBzOlwvXC93d3cuam91cm5hbHMuZWxzZXZpZXIuY29tXC9zd2FybS1hbmQtZXZvbHV0aW9uYXJ5LWNvbXB1dGF0aW9uIn0/">Swarm and Evolutionary Computation.</a> A software implementation of <em>ProfLogit </em>is available at: <a href="http://www.dataminingapps.com/sendpress/eyJpZCI6MCwicmVwb3J0IjoyNDc5LCJ2aWV3IjoidHJhY2tlciIsInVybCI6Imh0dHBzOlwvXC9naXRodWIuY29tXC9lc3RyaXBsaW5nXC9wcm9mbG9naXQtcHl0aG9uIn0/">https://github.com/ estripling/proflogit-python</a>.</p><p>For a churn management campaign, a predictive model is typically built such that it identifies customers who are about to leave the company (i.e., churners) as accurately as possible. Such model does not take into consideration the costs and benefits that originate from the retention campaign. To guarantee the success of the campaign, scarce marketing resources should focus on churners that are the <em>most valuable </em>to the organization. Hence, correctly predicting a customer as a churner is not enough — it is also vital for the company to discriminate within the pool of churners in order to retain the valuable customers.</p><p>The expected maximum profit measure for customer churn (<em>EMPC</em>) is a first step toward this ambitious goal [2, 5]. It integrates the costs and benefits associated with the retention campaign into a coherent performance measure and allows users to select the most profitable churn prediction model. Yet, the <em>EMPC </em>solely permits a <em>profit-based model selection</em>, the internal decision mechanisms of the classification model are still optimized according to some non-profit objective function.</p><p><em>ProfLogit </em>has been developed to close this gap by changing the objective function of the logistic model such that the regression coefficients are directly optimized for maximizing the <em>EMPC </em>measure in the model construction step [4, 6]. Given the complex nature of the optimization problem, <em>ProfLogit </em>makes use of a real-coded genetic algorithm, which finds an optimal solution by mimicking the biological process of evolution.</p><p>In a benchmark study with nine real-world churn data sets, we compared <em>ProfLogit </em>to other common linear classifiers. As a result, our <em>ProfLogit </em>technique attains the overall highest, out-of-sample <em>EMPC </em>performance (see Figure). The figure also reveals the <em>profit-accuracy discrepancy</em>, a pattern also observed by Verbraken et al. [5]. That is, <em>ProfLogit </em>achieves the highest profit, but, at the same time, performs weak in terms of accuracy-based measures. This highlights the importance of our proclaimed statement that the consideration of accuracy alone is not sufficient and more attention must be paid to profitability when building the predictive model. With <em>ProfLogit</em>, users can create a profit-oriented classification model for retention campaigns. We developed <em>ProfLogit </em>because we believe that the application of profit-driven business analytics is vital for corporate organizations to stay competitive.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/0*gSuAg-0QhHGCZ_U3.png" /><figcaption><em>ProfLogit </em>is the overall most profitable churn model.</figcaption></figure><h4>References</h4><ul><li>Wouter Verbeke, Karel Dejaeger, David Martens, Joon Hur, and Bart Baesens. New Insights into Churn Prediction in the Telecommunication Sector: a Profit Driven Data Mining Approach. <em>European Journal of Operational Research</em>, 218(1):211–229, 2012.</li><li>Tomas Verbraken. <em>Business-Oriented Data Analytics: Theory and Case Studies</em>. PhD thesis, Department of Decision Sciences and Information Management, Faculty of Economics and Business, KU Leuven, Leuven, Belgium, 2013. Ph.D. Dissertation.</li><li>Wouter Verbeke, Bart Baesens, and Cristián Bravo. <em>Profit Driven Business Analytics: a Practitioner’s Guide to Transforming Big Data into Added Value</em>. Wiley and SAS Business Series. John Wiley &amp; Sons, 2017.</li><li>Eugen Stripling, Seppe vanden Broucke, Katrien Antonio, Bart Baesens, and Monique Snoeck. Profit Maximizing Logistic Model for Customer Churn Prediction Using Genetic Algorithms. <em>Swarm and Evolutionary Computation</em>, 2017. doi: 10.1016/j.swevo.2017.10.010. In Press.</li><li>Thomas Verbraken, Wouter Verbeke, and Bart Baesens. A Novel Profit Maximizing Metric for Measuring Classification Performance of Customer Churn Prediction Models. <em>IEEE Transactions on Knowledge and Data Engineering</em>, 25(5):961–973, 2013.</li><li>Eugen Stripling, Seppe vanden Broucke, Katrien Antonio, Bart Baesens, and Monique Snoeck. Profit Maximizing Logistic Regression Modeling for Customer Churn Prediction. In <em>2015 IEEE International Conference on Data Science and Advanced Analytics (DSAA)</em>, pages 1–10, Paris, France, 2015. IEEE. doi: 10.1109/DSAA.2015.7344874.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2aa5dd293934" width="1" height="1" alt=""><hr><p><a href="https://medium.com/dataminingapps-articles/proflogit-a-pro%EF%AC%81t-maximizing-logistic-regression-model-for-customer-churn-prediction-2aa5dd293934">ProfLogit: a Proﬁt Maximizing Logistic Regression Model for Customer Churn Prediction</a> was originally published in <a href="https://medium.com/dataminingapps-articles">DataMiningApps Articles</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Improving the ROI of Big Data and Analytics through Leveraging New Sources of Data]]></title>
            <link>https://medium.com/dataminingapps-articles/improving-the-roi-of-big-data-and-analytics-through-leveraging-new-sources-of-data-b57d2637891f?source=rss----39db1fe7f950---4</link>
            <guid isPermaLink="false">https://medium.com/p/b57d2637891f</guid>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Seppe vanden Broucke]]></dc:creator>
            <pubDate>Tue, 03 Jul 2018 15:21:15 GMT</pubDate>
            <atom:updated>2018-07-03T15:21:14.909Z</atom:updated>
            <content:encoded><![CDATA[<p>Big Data and Analytics are all around these days. Most companies already have their first analytical models in production and are thinking about further boosting their performance. Far too often, they hereby focus on the analytical techniques rather than on the key ingredient: data! We believe the best way to boost the performance and ROI of an analytical model is by investing in new sources of data which can help to further unravel complex customer behavior and improve key analytical insights. In what follows, we briefly explore various types of data sources that could be worthwhile pursuing in order to squeeze more economic value out of your analytical models.</p><p>A first option concerns the exploration of network data by carefully studying relationships between customers. These relationships can be explicit or implicit. Examples of explicit networks are calls between customers, shared board members between firms, and social connections (e.g., family, friends ). Explicit networks can be readily distilled from underlying data sources (e.g., call logs) and their key characteristics can then be summarized using featurization procedures resulting into new characteristics which can be added to the modeling data set. In our previous research (Verbeke et al., 2014; Van Vlasselaer et al., 2017), we found network data to be highly predictive for both customer churn prediction and fraud detection. Implicit networks or pseudo networks are a lot more challenging to define and featurize. Martens and Provost (2016) built a network of customers where links were defined based upon which customers transferred money to the same entities (e.g., retailers) using data from a major bank. When combined with non-network data, this innovative way of defining a network based upon similarity instead of explicit social connections gave a better lift and generated more profit for almost any targeting budget. In another, award-winning study they built a geosimilarity network among users based upon location-visitation data in a mobile environment (Provost et al., 2015). More specifically, two devices are considered similar and thus connected, when they share at least one visited location. They are more similar if they have more shared locations and as these are visited by fewer people. This implicit network can then be leveraged to target advertisements to the same user on different devices or to users with similar tastes, or to improve online interactions by selecting users with similar tastes. Both of these examples clearly illustrate the potential of implicit networks as an important data source. A key challenge here is to creatively think about how to define these networks based upon the goal of the analysis.</p><p>Data are often branded as the new oil. Hence, data pooling firms capitalize on this by gathering various types of data, analyzing them in innovative and creative ways, and selling the results thereof. Popular examples are Equifax, Experian, Moody’s, S&amp;P, Nielsen, and Dun &amp; Bradstreet, among many others. These firms consolidate publically available data, data scraped from websites or social media, survey data, and data contributed by other firms. By doing so, they can perform all kinds of aggregated analyses (e.g., geographical distribution of credit default rates in a country, average churn rates across industry sectors), build generic scores (e.g., the FICO in the US) and sell these to interested parties. Because of the low-entry barrier in terms of investment, externally purchased analytical models are sometimes adopted by smaller firms (e.g., SMEs) to take their first steps in analytics. Besides commercially available external data, open data can also be a valuable source of external information. Examples are industry and government data, weather data, news data, and search data (e.g., Google Trends). Both commercial and open external data can significantly boost the performance and thus economic return of an analytical model.</p><p>Macro-economic data are another valuable source of information. Many analytical models are developed using a snapshot of data at a particular moment in time. This is obviously conditional on the external environment at that moment. Macro-economic up- or down-turns can have a significant impact on the performance and thus ROI of the analytical model. The state of the macro-economy can be summarized using measures such as gross domestic product (GDP), inflation and unemployment. Incorporating these effects will allow us to further improve the performance of analytical models and make them more robust against external influences.</p><p>Textual data are also an interesting type of data to consider. Examples are product reviews, Facebook posts, Twitter tweets, book recommendations, complaints, and legislation. Textual data are difficult to process analytically since they are unstructured and cannot be directly represented into a matrix format. Moreover, these data depend upon the linguistic structure (e.g., type of language, relationship between words, negations, etc.) and are typically quite noisy data due to grammatical or spelling errors, synonyms and homographs. However, they can contain very relevant information for your analytical modeling exercise. Just as with network data (see above), it will be important to find ways to featurize text documents and combine it with your other structured data. A popular way of doing this is by using a document term matrix indicating what terms (similar to variables) appear and how frequently in which documents (similar to observations). It is clear that this matrix will be large and sparse. Dimension reduction will thus be very important as the following activities illustrate:</p><ul><li>represent every term in lower case (e.g., PRODUCT, Product, product become product)</li><li>remove terms which are uninformative such as stop words and articles (e.g., the product, a product, this product become product)</li><li>use synonym lists to map synonym terms to one single term (product, item, article become product)</li><li>stem all terms to their root (products, product become product)</li><li>remove terms that only occur in a single document</li></ul><p>Even after the above activities have been performed, the number of dimensions may still be too big for practical analysis. Singular Value Decomposition (SVD) offers a more advanced way to do dimension reduction (Meyer, 2000). SVD works similar to principal component analysis (PCA) and summarizes the document term matrix into a set of singular vectors (also called latent concepts) which are linear combinations of the original terms. These reduced dimensions can then be added as new features to your existing, structured data set.</p><p>Besides textual data, other types of unstructured data such as audio, images, videos, fingerprint, GPS, and RFID data can be considered as well. To successfully leverage these types of data in your analytical models, it is of key importance to carefully think about creative ways of featurizing them. When doing so, it is recommended that any accompanying metadata are taken into account; for example, not only the image itself might be relevant, but also who took it, where, and at what time. This information could be very useful for fraud detection.</p><p>To summarize, we strongly believe that the best way to boost the performance and ROI of your analytical models is by investing in data first! In this contribution, we gave some examples of alternative data sources which can contain valuable information about the behavior of your customers.</p><h3>References</h3><ul><li>Martens D., Provost F., Mining Massive Fine-Grained Behavior Data to Improve Predictive Analytics, MIS Quarterly, Volume 40, Number 4, pp. 869–888, 2016.</li><li>Meyer C.D., Matrix Analysis and Applied Linear Algebra, SIAM, Philadelphia, 2000.</li><li>Provost F., Martens D., Murray A., Finding Similar Mobile Consumers with a Privacy-Friendly Geosocial Design, Information Systems Research, Volume 26, Issue 2, pp. 243–265, 2015.</li><li>Van Vlasselaer V., Eliassi-Rad T., Akoglu L., Snoeck M., Baesens B., GOTCHA! Network-based Fraud Detection for Security Fraud, <em>Management Science</em>, forthcoming, 2017</li><li>Verbeke W., Martens D., Baesens B., Social network analysis for customer churn prediction, <em>Applied Soft Computing</em>, Volume 14, pp. 341–446, 2014.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b57d2637891f" width="1" height="1" alt=""><hr><p><a href="https://medium.com/dataminingapps-articles/improving-the-roi-of-big-data-and-analytics-through-leveraging-new-sources-of-data-b57d2637891f">Improving the ROI of Big Data and Analytics through Leveraging New Sources of Data</a> was originally published in <a href="https://medium.com/dataminingapps-articles">DataMiningApps Articles</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Simple Linear Regression? Do It The Bayesian Way]]></title>
            <link>https://medium.com/dataminingapps-articles/simple-linear-regression-do-it-the-bayesian-way-e26a5d32a31?source=rss----39db1fe7f950---4</link>
            <guid isPermaLink="false">https://medium.com/p/e26a5d32a31</guid>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Seppe vanden Broucke]]></dc:creator>
            <pubDate>Wed, 16 May 2018 14:20:49 GMT</pubDate>
            <atom:updated>2018-05-16T14:20:48.542Z</atom:updated>
            <content:encoded><![CDATA[<p>Contributed by: <a href="http://www.dataminingapps.com/dma_staff/eugen-stripling/">Eugen Stripling</a>, <a href="http://www.dataminingapps.com/dma_staff/seppe-vanden-broucke/">Seppe vanden Broucke</a>, <a href="http://www.dataminingapps.com/dma_staff/bart-baesens/">Bart Baesens</a></p><p><em>This article first appeared in Data Science Briefings, the </em><a href="http://www.dataminingapps.com/"><em>DataMiningApps</em></a><em> newsletter. </em><a href="http://www.dataminingapps.com/dataminingapps-newsletter/"><em>Subscribe now</em></a><em> for free if you want to be the first to receive our feature articles, or follow us </em><a href="https://twitter.com/DataMiningApps"><em>@DataMiningApps</em></a><em>. Do you also wish to contribute to Data Science Briefings? Shoot us an e-mail over at </em><a href="/service/mailto:briefings@dataminingapps.com"><em>briefings@dataminingapps.com</em></a><em> and let’s get in touch!</em></p><p>In this column, we demonstrate the Bayesian method to estimate the parameters of the simple linear regression (SLR) model. The goal of the SLR is to ﬁnd a straight line that describes the linear relationship between the metric response variable Y and the metric predictor X. In the frequentist (or classical) approach, the normal error regression model is deﬁned as follows [1]:</p><blockquote>Yi = β0 + β1Xi + εi (1)</blockquote><p>where:</p><ul><li>Yi is the observed response of observation i,</li><li>Xi is the level of the predictor variable of observation i, a known constant,</li><li>β0 is the intercept parameter,</li><li>β1 is the slope parameter,</li><li>and εi are independent normal distributions with zero mean and constant variance σ2, <em>N</em>(0,σ2), for i = 1,…,n.</li></ul><p>The response Yi of observation i is the sum of two components [1]: (i) the constant term β0+β1Xi and (ii) the random term εi. Due to the induced randomness of εi, Y becomes a random variable as well. In other words, there is a probability distribution of the response variable Y for each level of the predictor variable X, and the means of these probability distributions vary in some systematic fashion with X [1]. The figure below illustrates an example taken from [1] in which it is assumed that the intercept and the slope are known, i.e., β0 = 9.5 and β1 = 2.1.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/0*qK4IccW0vyr6rkQR.png" /><figcaption><em>Simple linear regression [1].</em></figcaption></figure><p>Suppose we are in the possession of a data set (X1,Y1),…,(Xn,Yn), where Xi and Yi (i = 1,…,n) are the observed predictor and response measurements of observation i, respectively. We are then able to estimate the model parameters from the data. Usually, our primary interest is in the slope, β1, which reveals how Y will, on average, change when X increases by one unit.</p><p>Knowing the value of the slope reveals the strength of the dependency of Y on X. The SLR in fact has a closed-form solution, meaning that the intercept and slope estimates can be computed directly from the data without having to rely on numeric optimization techniques. However, the frequentist approach will return only one solution which is referred to as a single point estimate.</p><p>In contrast, as we will see by the end of the column, the Bayesian approach returns a whole distribution of so-called credible values for each parameter. Credibility is a term used to express our belief in certain parameter values. Typically, common probability distributions are used to specify the allocation of credibility over possible parameter values. The beneﬁt of working with distributions is that they provide a natural way to reﬂect uncertainty of estimates. The application of Bayesian estimation requires a probabilistic reformulation of the SLR, which may look like the following (2):</p><blockquote>Yi ∼<em>N</em>(µi,σ)<br>µi = β0 + β1Xi<br>β0 ∼<em>N</em>(M0,T0)<br>β1 ∼<em>N</em>(M1,T1)<br>σ ∼|Cauchy(<em>G</em>)|</blockquote><p>A graphical (perhaps more intuitive) way to represent the same model is achieved by means of Kruschke’s DBDA-style diagrams [2, 3, 4]:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/394/0*btCw1Rkv76iWrnr6.png" /><figcaption><em>Probabilistic formulation of the simple linear regression model.</em></figcaption></figure><p>From the diagram, it is easy to see that the response Yi of observation i is modeled as a normal distribution with mean µi = β0 + β1Xi and standard deviation σ (depending on the software program, either variance, standard deviation, or precision is speciﬁed). To make Bayesian estimation possible, we are required to assign so-called prior distributions to all model parameters, thus making our assumptions about the parameters explicit. In the figure above, we assign for each regression parameter βj (j = 0,1) a normal distribution with mean Mj and precision Tj (reciprocal of the variance), and for σ we assign a half-Cauchy distribution (i.e., considering only non-negative values) with scale parameter G. The prior distributions reﬂect our prior belief about each parameter in the SLR. If no prior knowledge is available, values for Mj, Tj, and G are typically chosen such that these distributions become so ﬂat that they almost resemble a uniform distribution, implying that we do not favor any particular parameter values.</p><p>Additionally, we need to specify an appropriate likelihood, which is the normal likelihood function for the SLR. The likelihood component is the part that incorporates the data. Now, Bayes’ rule [5] can be applied in order to update the priors to the posterior distributions, which reﬂect the distribution of credible parameter values taken into account the data. When specifying such “weak” priors as described above, even a modest amount of data will easily overrule the priors and the likelihood component will have a much stronger inﬂuence on the resulting posterior distributions [3, 4].</p><p>To provide a formal deﬁnition, suppose we are interested in the estimation of some parameter θ and we are given some data D, Bayes’ rule is then deﬁned as follows [4], (3):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/370/0*TRiiEychSYcEaUbV.png" /></figure><p>Without going into much detail, the crucial part to remember is that Bayes’ rule merely describes the mathematical relation between the prior and the posterior conditional on the data. In other words, Bayes’ rule precisely dictates how prior allocation of credibility is to be re-allocated to obtain the distribution of credible parameter values taking the data into account [4].</p><p>In practice, we typically rely on so-called Markov chain Monte Carlo (MCMC) methods which allow users to generate a large, representative sample from the posterior distribution, which is often also referred to as trace or MCMC chain. Common computer programs to generate such sample are BUGS [6], WinBUGS [7], JAGS [8], Stan [9], and PyMC3 [10]. This sample of representative, posterior parameter values can be utilized to perform statistical inference. In case of the SLR, each step in the MCMC chain, which typically encompasses several thousands, refers to credible parameter values that correspond to estimates for the intercept β0, slope β1, and standard deviation σ. Thus, the Bayesian method returns a whole distribution of credible regression lines. Let us demonstrate the frequentist and Bayesian approach on some toy data. To do so, we assume the true values of the regression parameters are as follows: β0 = 9.5, β1 = 2.1, and σ = 3. Having created the data set, we can now compute the parameter estimates according to the frequentist approach and plot the result (figure below). Clearly, since we estimate the parameter values based on a ﬁnite sample of modest size, the estimates will most likely not be exactly equal to the true parameter values. The main message, however, is that the frequentist approach returns only one solution, and therefore no particular notion that accounts for the uncertainty in the parameter estimates is considered.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/482/0*eYMGSuFzX-bWyeg9.png" /><figcaption><em>Simple linear regression.</em></figcaption></figure><p>However, when doing data analysis, it can be beneﬁcial to take the estimation uncertainties into account. This can be achieved with Bayesian estimation methods in which the posterior holds the distribution of credible parameter values, which in turn allows user to make a richer statistical inference [3, 4]. When running the computer program, the Bayesian method returns a distribution of credible regression lines (figure below). The ﬁgure shows only a sample of credible regression lines randomly taken from the generated MCMC chain. Yet, it can clearly be seen that there is some variation among the lines, reﬂecting the uncertainty in the parameter estimates.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/494/0*jygl67_LoS29WOeZ.png" /><figcaption><em>Bayesian SLR: Sample of credible linear regression lines (light blue).</em></figcaption></figure><p>A closer look at the posteriors gives more information about distribution of credible parameter values (figure below). In the ﬁgure, the middle numbers correspond to the means computed based on the values in the MCMC chain. The numbers on the left and right are the limits of the 95% highest posterior density (HPD) interval, which corresponds to the minimum width Bayesian credible interval (BCI). Kruschke [3, 4] refers to the HPD as the highest density interval (HDI). Regardless of the terminology, the interpretation is that all values within the 95% HPD are deemed as having the highest credibility. For all three regression parameters, we see that the 95% HPD indeed covers well the true parameter values: β0 = 9.5, β1 = 2.1, and σ = 3:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/281/0*uRPwycXd5PMrZYkR.png" /><figcaption><em>Marginal posterior distributions of each SLR model parameter. Means correspond to the middle numbers. Limits of the 95% HPD interval correspond to the numbers left and right.</em></figcaption></figure><p>Whenever we want to make a prediction of Y given a value of the predictor X (be it the mean or predicted response), we simply go over the MCMC chain and at each step of the chain we plug in the posterior estimates into the regression model to compute the response of interest. In this way, we can create a credible distribution of the mean and predicted response of Y and determine, for example, the 95% HPD (figure below). And indeed, the band for the mean response (darker blue) captures the true regression line well. Similarly, the prediction band (lighter blue) contains almost all observations. Conﬁrming that the Bayesian SLR is a good representation of the data:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/489/0*v0d5sLM6p1kXVb5S.png" /><figcaption><em>Bayesian SLR with 95% HPD bands for the mean and predicted response. The blue, thick line corresponds to the means of the posterior distributions.</em></figcaption></figure><p>What makes Bayesian methods so attractive is that it is fairly straightforward to adapt the model to challenging circumstances. For example, one could replace the bottom normal distribution in the Kruschke’s DBDA-style diagram figure above, which models the response, with a Student’s t-distribution and rerun the computer program (with some minor adjustments). This modiﬁcation will make the model robust against outlying observations. Kruschke [4] provides a detailed example of the robust linear regression model. Needless to say, another beneﬁt of Bayesian methods is that they easily allow users to incorporate their valuable expert knowledge into the modeling process by adapting the priors appropriately.</p><h3>Conclusion</h3><p>In this column, we demonstrated the application of Bayesian parameter estimation for the simple linear regression model. We showed that the concepts applied in Bayesian inference diﬀer fundamentally from the traditional ones. That is, in the frequentist approach, it is assumed that the data are randomly sampled from normal distributions with ﬁxed parameters. On the contrary, the Bayesian approach assumes the exact opposite, i.e., the data are ﬁxed and the parameters follow some (probability) distribution. Refer to Eq. (3) which expresses the posterior distribution, p(θ | D), of some parameter θ given the data D. Once the data are observed, they are ﬁxed and know to us. It is the set of parameters we are uncertain about and want to learn their true values. In this sense, Bayesian methods are more aligned with circumstances experienced in everyday practice. On top, working with the posterior distribution allows for a richer statistical inference, since more information is processed.</p><h3>References:</h3><ol><li>M. H. Kutner, C. J. Nachtsheim, J. Neter, and W. Li, Applied Linear Statistical Models, ser. McGrwaHill International Edition. McGraw-Hill Irwin, 2005.</li><li>J. K. Kruschke, “Diagrams for hierarchical models — we need your opinion,” [<a href="http://doingbayesiandataanalysis.blogspot.be/2013/10/diagrams-for-hierarchical-models-we.html">Online; accessed May 2017</a>], 2013.</li><li>Doing Bayesian Data Analysis: A Tutorial with R and BUGS. Academic Press, 2011.</li><li>Doing Bayesian Data Analysis: A Tutorial with R, JAGS, and Stan, 2nd ed. Academic Press, 2014.</li><li>T. Bayes and R. Price, “An essay towards solving a problem in the doctrine of chances. By the late Rev. Mr. Bayes, F.R.S. Communicated by Mr. Price, in a letter to John Canton, A.M.F.R.S.” Philosophical Transactions, vol. 53, pp. 370–418, 1763.</li><li>D. Lunn, C. Jackson, N. Best, A. Thomas, and D. Spiegelhalter, The BUGS Book: A Practical Introduction to Bayesian Analysis, ser. Chapman &amp; Hall/CRC Texts in Statistical Science. Taylor &amp; Francis, 2012.</li><li>D. J. Lunn, A. Thomas, N. Best, and D. Spiegelhalter, “WinBUGS: A Bayesian modelling framework: concepts, structure, and extensibility,” Statistics and Computing, vol. 10, no. 4, pp. 325–337, 2000.</li><li>M. Plummer, “JAGS: A Program for Analysis of Bayesian Graphical Models Using Gibbs Sampling,” in Proceedings of the 3rd International Workshop on Distributed Statistical Computing, 2003.</li><li>Stan Development Team, “The Stan C++ Library, Version 2.15.0.” [Online]. Available: <a href="http://mc-stan.org/">http://mc-stan.org</a></li><li>J. Salvatier, T. V. Wiecki, and C. Fonnesbeck, “Probabilistic programming in Python using PyMC3,” PeerJ Computer Science, vol. 2, p. e55, 2016. [Online]. Available: <a href="https://doi.org/10.7717/peerj-cs.55">https://doi.org/10.7717/peerj-cs.55</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e26a5d32a31" width="1" height="1" alt=""><hr><p><a href="https://medium.com/dataminingapps-articles/simple-linear-regression-do-it-the-bayesian-way-e26a5d32a31">Simple Linear Regression? Do It The Bayesian Way</a> was originally published in <a href="https://medium.com/dataminingapps-articles">DataMiningApps Articles</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Big Data for Credit Scoring: Opportunities and Challenges]]></title>
            <link>https://medium.com/dataminingapps-articles/big-data-for-credit-scoring-opportunities-and-challenges-29766b57f322?source=rss----39db1fe7f950---4</link>
            <guid isPermaLink="false">https://medium.com/p/29766b57f322</guid>
            <category><![CDATA[big-data]]></category>
            <dc:creator><![CDATA[Seppe vanden Broucke]]></dc:creator>
            <pubDate>Wed, 17 Jan 2018 17:18:23 GMT</pubDate>
            <atom:updated>2018-01-17T17:18:22.894Z</atom:updated>
            <content:encoded><![CDATA[<h4>Contributed by: <a href="http://www.dataminingapps.com/dma_staff/bart-baesens/">Bart Baesens</a></h4><p>Throughout the past few decades banks have gathered plenty of information describing the default behavior of their customers. Examples are historical information about a customer’s date of birth, gender, income, employment status, etc. All this data has been nicely stored into huge (e.g. relational) databases or data warehouses. On top of this, banks have accumulated lots of business experience about their credit products. As an example, many credit experts do a pretty good job at discriminating between low risk and high risk mortgages using their business expertise only. It is now the aim of credit scoring to analyze both sources of data into more detail and come up with a statistically based decision model which allows to score future credit applications and ultimately decide which ones to accept or reject.</p><p>The emergence of big data has created both opportunities and challenges for credit scoring. Big data is often characterized in terms of its 4 V’s: Volume, Variety, Velocity and Veracity. To illustrate this, let’s briefly zoom into some key sources or processes generating big data. Traditional sources are large scale transactional enterprise systems such as OLTP (On-Line Transaction Processing), ERP (Enterprise Resource Planning) and CRM (Customer Relationship Management) applications. Classical credit scorecards are typically constructed using data extracted from these traditional transactional systems.</p><p>The online social graph is a more recent example. Think about the major social networks such as Facebook, Twitter, LinkedIn, Weibo, and WeChat. All together these networks capture information about close to two billion people about their friends, preferences and other behavior, hereby leaving a massive digital trail of data. Also think about the Internet of Things (IOT) or the emerging sensor enabled ecosystem that is going to connect various objects (e.g. homes, cars, etc.) with each other, and with humans. Finally, we see more and more open or public data such as data about weather, traffic, maps, macro-economy, etc. It is clear that all these new data source offer a tremendous potential for building better credit scoring models.</p><p>All the above data generating processes can be characterized in terms of the sheer <strong>volume</strong> of data that is being generated. Clearly, this poses seriously challenges in terms of setting up scalable storage architectures combined with a distributed approach to data manipulation and querying.</p><p>Big data usually comes in a great <strong>variety</strong> or various formats. Traditional data types or structured data such as customer name, customer birth date, etc. are more and more complemented with unstructured data such as images, fingerprints, tweets, emails, Facebook pages, sensor data, GPS data, etc. Although the former can be easily stored in traditional (e.g. relational) databases, the latter needs to be accommodated using the appropriate database technology facilitating the storage, querying and manipulation of each of these types of unstructured data. Also here, this requires a substantial effort since it is claimed that at least 80% of all data is unstructured.</p><p><strong>Velocity</strong> refers to the speed at which the data is generated and needs to be stored and analyzed. Think about streaming applications such as on-line trading platforms, YouTube, SMS messages, credit card swipes, phone calls, etc. which are all examples where high velocity is a key concern.</p><p><strong>Veracity</strong> indicates the quality or trustworthiness of the data. Unfortunately, more data does not automatically imply better data, so the quality of the data generating process must be closely monitored and guaranteed.</p><p>As the volume, variety, velocity and veracity of data continues to grow, so do the new opportunities for building better credit scoring models. Think about Facebook or Twitter as an example. It is quite obvious that knowing a credit applicant’s hobbies, followers, friends, likes, education and workplace could be very beneficial to better quantify his/her creditworthiness. In other words, a customer’s social standing, on-line reputation and professional connections are likely to be related to his/her credit quality. Another useful data source concerns call detail records or CDR data which capture the mobile phone usage of an applicant. Also surfing behavior could be a nice add-on.</p><blockquote>As the volume, variety, velocity and veracity of data continues to grow, so do the new opportunities for building better credit scoring models.</blockquote><p>Clearly, the availability of these big data sources creates both opportunities as well as challenges for credit scoring. E.g., the availability of social network and CDR data may be beneficial in various settings. First, it may be useful to score customers who lack borrowing experience (e.g. because it’s their first loan or they recently moved to a new country) and would be automatically perceived as risky according to traditional credit scoring models which rely on historical information. By using these alternative data sources, a better assessment of the credit risk can be made, which can then be translated into a more favorable interest rate. This obviously gives an incentive to the customer to disclose his/her social network, CDR or other relevant data to the bank. Another example are developing countries. In these countries, banks often lack historical credit information and no local credit bureaus may be available. Hence, other data sources should be used to optimize access to credit. Given the widespread use of social networks and/or mobile phones (even in developing countries!), the data gathered might be an interesting alternative to do credit scoring.</p><blockquote>Obviously, using the above mentioned data sources also comes with various challenges. The first one concerns privacy.</blockquote><p>Obviously, using the above mentioned data sources also comes with various challenges. The first one concerns privacy. It is important that customers are properly informed about what data is used to calculate their credit score. An opt-out option should always be provided. Furthermore, using social network data for credit scoring can trigger new fraud behavior whereby customers strategically construct their social network to artificially and maliciously brush up their credit quality. One example is that customers can easily buy Twitter followers to boost their credit scores. Finally, also regulatory compliance might become an important issue. Many countries prohibit the use of gender, age, marital status, national origin, ethnicity and beliefs for credit scoring. Much of this information can be easily scraped from social networks. Hence, it may be harder to oversee regulatory compliance when using social network or other data for credit scoring.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=29766b57f322" width="1" height="1" alt=""><hr><p><a href="https://medium.com/dataminingapps-articles/big-data-for-credit-scoring-opportunities-and-challenges-29766b57f322">Big Data for Credit Scoring: Opportunities and Challenges</a> was originally published in <a href="https://medium.com/dataminingapps-articles">DataMiningApps Articles</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Understanding Deep Learning in 5 Minutes]]></title>
            <link>https://medium.com/dataminingapps-articles/understanding-deep-learning-in-5-minutes-cc140a10078b?source=rss----39db1fe7f950---4</link>
            <guid isPermaLink="false">https://medium.com/p/cc140a10078b</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[deep-learning]]></category>
            <dc:creator><![CDATA[Seppe vanden Broucke]]></dc:creator>
            <pubDate>Tue, 05 Dec 2017 08:53:02 GMT</pubDate>
            <atom:updated>2017-12-05T08:57:11.306Z</atom:updated>
            <content:encoded><![CDATA[<h4>Contributed by: <a href="http://www.dataminingapps.com/dma_staff/michael-reusens/">Michael Reusens</a>, Wilfried Lemahieu, <a href="http://www.dataminingapps.com/dma_staff/bart-baesens/">Bart Baesens</a></h4><p><em>This article first appeared in Data Science Briefings, the </em><a href="http://www.dataminingapps.com/"><em>DataMiningApps</em></a><em> newsletter. </em><a href="http://www.dataminingapps.com/dataminingapps-newsletter/"><em>Subscribe now</em></a><em> for free if you want to be the first to receive our feature articles, or follow us </em><a href="https://twitter.com/DataMiningApps"><em>@DataMiningApps</em></a><em>. Do you also wish to contribute to Data Science Briefings? Shoot us an e-mail over at </em><a href="/service/mailto:briefings@dataminingapps.com"><em>briefings@dataminingapps.com</em></a><em> and let’s get in touch!</em></p><p>In this short article, we present a brief introduction to deep learning. We will discuss its prominent algorithms and applications, and main drawbacks that are slowing down adoption.</p><p>In order to capture simple patterns in data, basic modelling techniques (also called <em>shallow </em>modelling techniques) such as SVM’s and logistics regression are usually performing well. However, as the complexity of the input data increases, artificial neural networks (ANN’s) tend to be more performant in capturing the underlying patterns in the data. For very complex input data (such as images, unstructured text and audio) ANN’s with a small number of hidden layers (also called <em>shallow </em>ANN’s) become insufficiently accurate. For this type of data, deep ANN’s, which are ANN’s with more hidden layers, are currently the most performant algorithms.</p><p>Deep ANN’s are just one class of algorithms in the broader category covered by <em>deep learning. </em>Many definitions of deep learning exist (Deng &amp; Yu, 2014; Schmidhuber, 2015), however, most definitions agree that deep learning is defined as a branch of machine learning that covers the set of algorithms that model complex patterns by feeding data through multiple non-linear transformations causing each level to capture a different level of abstraction. A nice example of the hierarchical levels of abstraction in deep learning can be found in the domain of face recognition. In face recognition, the task is to automatically detect faces of specific people on images. The first abstraction level of a typical deep learning face recognition model is the raw input data, usually the individual pixels of the image, followed by edges and contrasting colors. A combination of edges and color contrasts can then constitute facial features, such as eyes, a nose, a mouth,… and finally, a combination of facial features can constitute a specific face. These different levels of abstractions are also shown in Figure 1.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/414/0*vO9beO4-xsVJnnBI.jpg" /><figcaption>Figure 1: Different level of abstraction in facial recognition. Image From: Andrew Ng<br>Source: <a href="http://www.nature.com/news/computer-science-the-learning-machines-1.14481">http://www.nature.com/news/computer-science-the-learning-machines-1.14481</a></figcaption></figure><p>Most deep learning techniques are extensions or adaptions of ANN’s, called <em>deep nets</em>. Different configurations of deep nets are suitable for different machine learning tasks: <em>Restricted Boltzman Machines </em>(RBM’s) (Smolensky 1986; Hinton &amp; Salakhutdinov, 2006) and Autoencoders (Vincent, Larochelle, Bengio, &amp; Manzagol ,2008) are the main deep learning techniques for finding patterns in unlabeled data. This includes tasks such as feature extraction, pattern recognition and other unsupervised learning settings. Recurrent nets (Graves et al. , 2009. ; Sak, Senior &amp; Beaufays, 2014) are the state of the art in text processing (sentiment analysis, text parsing, named entity recognition,…), speech recognition and time series analysis. Deep believe nets (Hinton, Osindero &amp; The, 2006; Taylor, Hinton &amp; Roweis, 2006) and convolutional nets (Lee, Grosse, Ranganath &amp; Ng, 2009) are today’s best choice for imagine recognition. Deep believe networks are also state of the art in classification, together with multilayered perceptrons with rectified linear units (MLP/RELU).</p><p>In many of the aforementioned tasks, deep nets are outperforming their shallow counterparts. However, algorithms required to capture complex patterns tend to have two main drawbacks: lack of scrutability and large training time-complexity. The scrutability of models and their predictions refers to how understandable they are. For example, if a deep net would classify a person as someone likely to default on a loan it is very hard to find out what interplay of features describing the person are the reason of the classification. Models with very low scrutability are also called <em>black box technique</em>s. The opposite of black box techniques are <em>white box techniques</em>. These are the techniques of which the reasoning is more easy to understand. One of the “whitest” white box techniques are decision trees. They are easily inspectable, and classifications made by decision trees are trivially understandable by manually traversing the tree. In domains that require an understanding of why certain predictions are made by its models, black box techniques such as deep nets are often unacceptable. However, extracting rules from neural networks, and thereby <em>de-blackboxing</em> them, is a current interesting research domain that can mitigate this drawback and make deep nets applicable in domains in which scrutability is a requirement (Baesens, Setiono, Mues &amp; Vanthienen, 2003).</p><p>The training time-complexity drawback stems from the fact that using many layers of interconnected nodes requires many connection-weights to be optimized and a large amount of training data to do so. Training algorithms that are applicable when training shallow ANN’s, such as backpropagation (Rumelhart, Hinton &amp; Williams, 1988), become unusable for deep nets in terms of training time and model performance. In the current state of the art of training algorithms, running the algorithms on multiple high-performance GPU’s (Graphical Processing Units), training a deep net can take weeks in complex cases.</p><p>Nevertheless, as research on deep learning advances, processing power of GPU’s increases, and research on deblackboxing neural networks advances, these drawbacks could soon be mitigated, making deep learning something to look out for in the future of many machine learning tasks.</p><h3>References and Further Reading</h3><ul><li>Baesens, B., Setiono, R., Mues, C., &amp; Vanthienen, J. (2003). Using neural network rule extraction and decision tables for credit-risk evaluation.<em>Management science</em>, <em>49</em>(3), 312–329.</li><li>Deng, L., &amp; Yu, D. (2014). Foundations and Trends in Signal Processing.<em>Signal Processing</em>, <em>7</em>, 3–4.</li><li>Graves, A., Liwicki, M., Fernández, S., Bertolami, R., Bunke, H., &amp; Schmidhuber, J. (2009). A novel connectionist system for unconstrained handwriting recognition. <em>Pattern Analysis and Machine Intelligence, IEEE Transactions on</em>, <em>31</em>(5), 855–868.</li><li>Hinton, G. E., Osindero, S., &amp; Teh, Y. W. (2006). A fast learning algorithm for deep belief nets. <em>Neural computation</em>, <em>18</em>(7), 1527–1554.</li><li>Hinton, G. E., &amp; Salakhutdinov, R. R. (2006). Reducing the dimensionality of data with neural networks. <em>Science</em>, <em>313</em>(5786), 504–507.</li><li>Lee, H., Grosse, R., Ranganath, R., &amp; Ng, A. Y. (2009). Convolutional deep belief networks for scalable unsupervised learning of hierarchical representations. In <em>Proceedings of the 26th Annual International Conference on Machine Learning</em> (pp. 609–616). ACM.</li><li>Rumelhart, D. E., Hinton, G. E., &amp; Williams, R. J. (1988). Learning representations by back-propagating errors. Cognitive modeling, 5(3), 1.</li><li>Sak, H., Senior, A. W., &amp; Beaufays, F. (2014). Long short-term memory recurrent neural network architectures for large scale acoustic modeling. In <em>INTERSPEECH</em> (pp. 338–342).</li><li>Schmidhuber, J. (2015). Deep learning in neural networks: An overview. <em>Neural Networks</em>, <em>61</em>, 85–117.</li><li>Smolensky, P. (1986). Chapter 6: Information Processing in Dynamical Systems: Foundations of Harmony Theory. Processing of the Parallel Distributed: Explorations in the Microstructure of Cognition, Volume 1: Foundations.</li><li>Taylor, G. W., Hinton, G. E., &amp; Roweis, S. T. (2006). Modeling human motion using binary latent variables. In <em>Advances in neural information processing systems</em> (pp. 1345–1352).</li><li>Vincent, P., Larochelle, H., Bengio, Y., &amp; Manzagol, P. A. (2008). Extracting and composing robust features with denoising autoencoders. In<em>Proceedings of the 25th international conference on Machine learning</em> (pp. 1096–1103). ACM.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cc140a10078b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/dataminingapps-articles/understanding-deep-learning-in-5-minutes-cc140a10078b">Understanding Deep Learning in 5 Minutes</a> was originally published in <a href="https://medium.com/dataminingapps-articles">DataMiningApps Articles</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Capturing the Wisdom of your Employees]]></title>
            <link>https://medium.com/dataminingapps-articles/capturing-the-wisdom-of-your-employees-385d0b3f9791?source=rss----39db1fe7f950---4</link>
            <guid isPermaLink="false">https://medium.com/p/385d0b3f9791</guid>
            <category><![CDATA[bitcoin]]></category>
            <dc:creator><![CDATA[Seppe vanden Broucke]]></dc:creator>
            <pubDate>Mon, 24 Jul 2017 09:58:24 GMT</pubDate>
            <atom:updated>2017-07-24T09:58:23.906Z</atom:updated>
            <content:encoded><![CDATA[<h3>Forecasting with Prediction Markets</h3><p>The price traded at the stock exchange is designed to reflect the true value of shares. Traders buy and sell based on whether they belief stocks will go up or down. As such, it’s a continuous forecasting of what a company is worth. But what if we would trade on something else than stocks, e.g. events?</p><p>In 2005, Google implemented prediction markets for their employees [1]. This mechanism -which also goes by the name of “information market” or “event futures”- allows people to trade on events such as demand forecasts, internal performance but also external events related and not related to Google (e.g. about the quality of the new Star Wars). In 2002, Hewlett-Packard reported that their prediction market beat the official HP forecasts [4]. And with many others implementing this new way of forecasting, e.g. Best Buy, Eli Lilly, General Electric, Microsoft and Siemens [2], the popularity of prediction markets in the business sector is growing.</p><p><strong>How does it work?</strong> In the most common system, a winner-take-all contract with continuous actions of bidders and sellers, the market price reflects the probability that an event will occur. For example, imagine we’re betting on whether the Red Devils, the Belgian football team, will win its first match in the European Championship. Upon closing of the market, the winners get a pay-off of €1 per contract and losers get nothing. If I believe chances are low they’ll win, around 20%, then I’ll buy contracts until the price is €0.20. If the price increases, because other participants believe that the chance that the Red Devils will win is higher, I can sell my contracts. A participant will only take action (buy/sell) when the price is different from his belief. As such, the final price will reflect the mean belief of the traders. In this example, this mean belief reveals the probability that the Red Devils will win. It captures the “<strong>wisdom of the crowd</strong>”.</p><p>Off course, other <strong>contracts and market designs</strong> exist and companies need to carefully reflect on the details. The design and whether participants trade with play or real money will determine the flexibility of your market (think of US gambling laws which might create barriers). The type of contract will tell us what the market price reflects: the probability of occurrence (winner-take-all contract); the mean value of the outcome (index contract); or the market’s expectation of median outcome (spread contract). Finally, the set-up and incentive will also affect whether your employees will be motivated to participate. When Google implemented their prediction market, they decided to work with play money, “Goobles”, which could be exchanged for prizes. This allows some flexibility in comparison to trading with real money and still provides a great incentive for their “Googlers”. If you’re interested in experiencing a prediction market yourself, we recommend a visit to the Iowa Electronic Markets [3]. IEM are small-scale, real-money markets developed for research purposes at the University of Iowa. Starting off in 1998, IEM are also one of the oldest and well-known prediction markets.</p><p><strong>Why start with prediction markets?</strong> You probably already have some form of forecasting implemented in your company. And this might be a very good tool for doing so. Nevertheless, researchers found that prediction markets outperform polls, expert surveys and Delphi panels in accuracy. Moreover, they are less costly, especially now soft- and hardware costs are decreasing, and easily scalable. They aggregate the knowledge of your employees in a continuous, real-time manner which contrasts with conventional techniques solely based on historical data. Finally, you motivate employees to engage in a new way. However, we need to keep in mind that we’re working with human beings who not always act rational. Participants might overprice their favourites (e.g. an Apple fan bidding on the new IPhone sales), often perceive extreme outcomes as less plausible or might be overly optimistic. But in the end, it offers an interesting way to aggregate the opinion of many. As such, it’s a great technique to complement your traditional decision-making process.</p><p><strong>To conclude</strong>:</p><ul><li>Prediction markets are an interesting mechanism to complement traditional forecasting.</li><li>It captures the knowledge and believes of your employees and, as such, transforms tacit insights into valuable information.</li><li>It creates new opportunities for continuous, real-time forecasting but also for new product development (“idea markets”) or other forms of information aggregation.</li><li>Before implementation, companies need to carefully reflect on the design of the market.</li></ul><h3>References</h3><ol><li>Cowgill, Bo, Wolfers, Justin, and Zitzewitz, Eric. 2009. Using prediction markets to track information flows: Evidence from Google. <a href="http://www.bocowgill.com/GooglePredictionMarketPaper.pdf">www.bocowgill.com/GooglePredictionMarketPaper.pdf</a></li><li>Graefe, Andreas, Luckner, Stefan, and Weinhardt, Christof. 2010. Prediction markets for foresight. <em>Futures</em>, 42(4): 394–404.</li><li>Iowa Electronic Markets, <a href="http://tippie.uiowa.edu/iem/">http://tippie.uiowa.edu/iem/</a></li><li>Plott, Charles R., and Chen, Kay-Yut. 2002. Information Aggregation Mechanisms: Concept, Design and Implementation for a Sales Forecasting Problem. Social Science Working Paper, 1131. California Institute of Technology , Pasadena, CA. <a href="http://resolver.caltech.edu/CaltechAUTHORS:20140317-135547085">http://resolver.caltech.edu/CaltechAUTHORS:20140317-135547085</a></li><li>Wolfers, Justin, and Zitzewitz, Eric. 2004. “Prediction Markets.” <em>Journal of Economic Perspectives</em>, 18(2): 107–126. <a href="http://www.nber.org/papers/w10504">http://www.nber.org/papers/w10504</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=385d0b3f9791" width="1" height="1" alt=""><hr><p><a href="https://medium.com/dataminingapps-articles/capturing-the-wisdom-of-your-employees-385d0b3f9791">Capturing the Wisdom of your Employees</a> was originally published in <a href="https://medium.com/dataminingapps-articles">DataMiningApps Articles</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Using Survival Analysis to Model Time to Default]]></title>
            <link>https://medium.com/dataminingapps-articles/using-survival-analysis-to-model-time-to-default-f918e6d5ff36?source=rss----39db1fe7f950---4</link>
            <guid isPermaLink="false">https://medium.com/p/f918e6d5ff36</guid>
            <category><![CDATA[survival-analysis]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[fintech]]></category>
            <dc:creator><![CDATA[Seppe vanden Broucke]]></dc:creator>
            <pubDate>Mon, 23 May 2016 07:20:10 GMT</pubDate>
            <atom:updated>2016-05-23T07:20:10.269Z</atom:updated>
            <content:encoded><![CDATA[<p>With the recent financial crisis hitting the US and Europe, credit risk modeling has become more important than ever. The introduction of compliance guidelines such as the Basel and Solvency accords has had a huge impact on the strategies of financial institutions. Mainly triggered by the Basel II accord statement that allows large banks to assess risk based on their own models in order to determine the minimum amount of capital they need to hold as a buffer against unexpected losses, extensive research in the credit risk domain was encouraged. The bank’s objective here is to build a model that can assess a borrower’s risk as accurately as possible. This is where survival analysis can play an important role.</p><p>With the probability of default (PD) as a key credit risk parameter, credit risk models typically aim at distinguishing “good” customers from “bad” customers. This is historically done through classification techniques such as decision trees, neural networks and logistic regression. A disadvantage of these techniques, however, is that they do not take the timing of default into account. When using survival analysis, we are able to predict<em> when</em> customers are likely to default. Not only can this lead to more accurate credit risk calculations, there are some other advantages that will be discussed in what follows.</p><p>Firstly, survival analysis can deal with censoring. In the credit risk context, censoring occurs when a specific loan is under repayment at the moment of data gathering. At that stage, it is clear that default has not occurred. However, as the loan has not reached the end term yet, we cannot draw final conclusions on whether in the end this particular loan will be a defaulted one or not — or in classification terms, whether we are dealing with a “good” or a “bad” customer. When using traditional classification techniques, it is not possible to include the information regarding this customer (functioning as a data point) as an input in the model. Focusing on the time aspect of default, censoring can be dealt with when using survival analysis techniques, and the valuable information “customer X with characteristics Y has at least been repaying for Z months” can be taken into account. The advantage of not being forced to leave out these censored cases is straightforward: as more information can be included when building a model, one is able to make more accurate predictions when using survival analysis models as opposed to standard classification techniques.</p><p>A natural consequence of using survival analysis, and at the same time a second advantage, is the fact that this method does not produce one PD estimate, but a range of PD estimates, depending on time, per customer. A PDXYZ can then be interpreted as “what is the probability that customer X with characteristics Y will have defaulted by month Z”. Incorporating the risk of default using these time-dependent PD, it is child’s play to make accurate predictions on the expected revenue for a specific loan.</p><p>Classically, PD models include application information of loan applicants as fixed predictor variables. This application information may include home ownership information, age, marital status,… A pitfall of including these as fixed variables is that most of these variables can change over time: creditors can buy or sell a house, get married or divorced,… while a loan is under repayment. These specific events will most likely change the probability of default. A third advantage of survival analysis is that these method allows us to include these so-called time-dependent covariates. Other covariates that are typically of this nature can be the current account balance (which changes each month!) and covariates that are not related to a specific customer but to the state of the economy. These so-called “macro-economic factors”, such as unemployment level, interest rate and house price index play a very important role in credit risk modeling.</p><p>As a final advantage we refer to the possibility to model several event types in one model. As survival analysis models the time to a specific event, not only default can be taken into consideration, but also the early repayment of a loan. Through more complex mixtures of survival models, one can compute the probabilities of default and early repayment for a specific customer all in one model.</p><p>Despite the many advantages, banks are still hesitant towards the use of survival analysis. While there are still some challenges, such as dealing with the generally high amount of censoring due to low default rates and more difficult interpretation of these models with respect to standard classification techniques, the potential of survival analysis in the credit risk area is enormous. It will only a matter of time before survival analysis will conquer the financial world!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f918e6d5ff36" width="1" height="1" alt=""><hr><p><a href="https://medium.com/dataminingapps-articles/using-survival-analysis-to-model-time-to-default-f918e6d5ff36">Using Survival Analysis to Model Time to Default</a> was originally published in <a href="https://medium.com/dataminingapps-articles">DataMiningApps Articles</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>