Churn Prediction using BigQueryML
Tags: opensource, machinelearning, database, rudderstack
Published: 2020-04-27 20:12:06

<!-- wp:paragraph -->
<p>There are a lot of blogs out there on building churn prediction models using scikit-learn, R, or other advanced ML toolkits. However, most of them require strong engineering as well as data science skills. That said, it is now possible to create robust models using SQL and basic knowledge of data science by leveraging the tools that companies like Google have developed to democratize machine learning.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>In this post, we will use Google’s BigQueryML together with the clickstream data collected and delivered using the RudderStack platform. This data represents events, such as slot machine spins, associated with a <a rel="noreferrer noopener" aria-label="mobile casino game (opens in a new tab)" href="https://rudderstack.com/blog/rudderstack-case-study-casino-game-analytics/" target="_blank">mobile casino game</a>. The volume of the data is typical for such scenarios, and as we will see, performing churn analysis is both easily accessible and efficient without having to spend a fortune on the infrastructure.</p>
<!-- /wp:paragraph -->

<!-- wp:heading -->
<h2>What is Customer Churn and Why We Care About It</h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Customer churn is a problem for any consumer business, be it eCommerce or mobile games. Its definition is simple - churn happens whenever a customer stops doing business with your company or stops buying your product. The <strong>impact</strong> of losing a customer does not result in just <strong>revenue loss</strong>. The <strong>cost</strong> of <strong>customer acquisition</strong> can range from a few dollars to tens of dollars; hence losing a customer also implies a negative impact on the return on that investment.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Customer churn can happen for many reasons, including but not limited to:</p>
<!-- /wp:paragraph -->

<!-- wp:list -->
<ul><li>Inferior product quality</li><li>Unsatisfactory customer service</li><li>Consumers losing interest (particularly true for games)&nbsp;</li><li>Just the nature of the product itself</li></ul>
<!-- /wp:list -->

<!-- wp:paragraph -->
<p>It is not possible to always identify and control these factors, but it is important to track and try to understand the factors that contribute to churn. This can inform the product and the overall business strategy and also optimize processes like customer acquisition and support.</p>
<!-- /wp:paragraph -->

<!-- wp:quote -->
<blockquote class="wp-block-quote"><p><strong>A disclaimer first</strong> -&nbsp; We understand that there may be some ethical questions around engineering user behavior to keep them hooked to the game or an application in general. We won't get into this debate, though. We consider this particular case because the volume and the type of data is an excellent candidate for the type of analysis we want to perform. Furthermore, it allows us to explore different sophisticated tools and techniques available to perform this exercise.</p></blockquote>
<!-- /wp:quote -->

<!-- wp:paragraph -->
<p>For the purpose of this blog, we will analyze the clickstream data purely from a prediction point of view - how accurately and how soon can we predict if a user is going to churn based on their in-app behavior. We can use the same setup to predict any kind of churn in other domains.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p></p>
<!-- /wp:paragraph -->

<!-- wp:heading -->
<h2>Data capturing and setting up the delivery infrastructure</h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>For our use-case, the mobile game integrated RudderStack’s <strong><a rel="noreferrer noopener" aria-label="Unity SDK (opens in a new tab)" href="https://github.com/rudderlabs/rudder-sdk-unity" target="_blank">Unity SDK</a> </strong>for generating events. These events were then sent to RudderStack’s open-source data plane, from where they were routed into Google BigQuery for further analysis.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>We store all the events routed by RudderStack in a <strong>track</strong> table in <strong>BigQuery </strong>with the entire JSON payload as a column. In addition, we also create separate tables for each event type, with the event properties as columns. This is important because, in this way, we can have access to the whole event if we need to, exploiting BigQuery’s excellent support for semi-structured data. We can also optimize the usage of BigQuery by partitioning the data based on the event time. This allows us to optimize both the query execution time and the cost.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>The following images demonstrate two examples of tables created in BigQuery – one for a particular event type and the other for all events:</p>
<!-- /wp:paragraph -->

<!-- wp:image {"id":26006,"sizeSlug":"large"} -->
<figure class="wp-block-image size-large"><img src="https://rudderstack.com/wp-content/uploads/2020/03/image.png" alt="Structure of BigQuery tables for a particular event type and event-agnostic tables" class="wp-image-26006"/><figcaption> Left: BigQuery table for a particular event type<br>Right: BigQuery table for all events </figcaption></figure>
<!-- /wp:image -->

<!-- wp:paragraph -->
<p>As seen above, the table for a specific event contains attributes specific to that event, whereas the second table contains information that is event-agnostic. The two tables can be linked by the <code>id</code> field.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>RudderStack does the schema management automatically. It creates the table schema based on the event structure and keeps it updated if new fields are added to the event JSON or if the data types of the existing fields are changed. This approach maximizes the usage of your data warehouse without having to worry if your data pipeline is broken. It also ensures that your warehouse is always up-to-date.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p></p>
<!-- /wp:paragraph -->

<!-- wp:heading -->
<h2>Exploratory Data Analysis and churn prediction strategy</h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>The first step in building any ML model is to build the intuition around the data you are working with. BigQuery is great for this purpose as it allows you to run arbitrary queries on your data through its console and quickly explore them without having to rely on complicated external tools. Of course, if a more sophisticated analysis is needed,  you can connect your BigQuery instance to various third-party tools out there.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>In order to define churn, we use the plot below - which shows the distribution of the number of days between the first payment and churn. While it is impossible to know if anyone really churned, we assumed <strong>seven days of inactivity</strong> as a criterion for churn. We make this assumption based on the feedback we got from the product manager of the game while considering the broader understanding of churn for this particular industry. For this game (and most other games), people are generally very active, playing multiple times a day. If at some point they just leave the game - and while they might return - the general consensus is that the longer a user is inactive, the smaller the possibility of their return is. Considering this factor, seven days of inactivity is a good starting point for investigating customer churn with our data. </p>
<!-- /wp:paragraph -->

<!-- wp:image -->
<figure class="wp-block-image"><img src="https://lh5.googleusercontent.com/-x2ZZBpoPYoIeriKfhqiG83sqRetzkMSjfL2RUByxC-FSPQTQ2bohkaDlQ-WbNv5oDoVjtoMbEloZ6SYOuZdcH7Fk7pafc9f1r46-dQ7RvqhMmdnNLBkPM4A6DaaShBcQWF9BjX4" alt="Distribution statistic for number of days between a customer's first payment and last spin"/><figcaption> Distribution of the number of days between a customer’s first payment and their last spin </figcaption></figure>
<!-- /wp:image -->

<!-- wp:paragraph -->
<p>As observed initially, a vast majority of people leave within a couple of days of the first payment.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p></p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":3} -->
<h3>The churn prediction strategy</h3>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>The simplest approach to reduce churn is to send out an offer or something after a few days of inactivity. However, this approach is not the best. If we choose too low a threshold, we will be giving out too many offers. On the other hand, if we wait too long, the user would have been long gone, maybe even uninstalled the game. The objective is to predict with very high accuracy if someone will churn <strong>before</strong> they actually churn. So, the question is, how can we optimize this approach by incorporating an accurate churn prediction model?</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>We will try to answer this question in the rest of this blog. We will try to predict if <strong>someone will churn within three days </strong>of making a payment. This means that a person for whom the number of days between the date of first purchase/payment and the date of their last-logged event is<strong> three or less</strong> are labeled as <strong>churn-positive</strong>. If not, they are labeled as <strong>churn-negative</strong>. The goal is to predict if someone is positive within <strong>one day</strong> of paying - as most users are still active then and can be engaged with.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p></p>
<!-- /wp:paragraph -->

<!-- wp:heading -->
<h2>Feature Engineering for Customer Churn Prediction</h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>After an initial exploratory analysis, it is time to start working on building a model for customer churn prediction. Doing this requires defining a set of data dimensions or features that will be used to train the model. Feature engineering is something between an art and a science, as an intuition of both the data and the business case is required. In our case, we went through an ‘interview’ with the product manager of the game who understood both the data and the problem statement. This allowed us to select a well-defined set of data features for our task.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>The following features were identified as relevant for predicting churn after talking to the game product manager:</p>
<!-- /wp:paragraph -->

<!-- wp:list -->
<ul><li><strong>coin_balance:</strong> If someone has a lot of coins left, they are more likely to continue playing the game.&nbsp;</li><li><strong>total_bet/total_win/total_spins:</strong> People who are more active are generally more hard-core players and hence less likely to churn. By summing the amounts/numbers across all of the “spin” events of a user - the total amount or count of bets/wins or spins can be determined</li><li><strong>number_of_distinct_games</strong>: Similar to above, people who play more games are more likely to stay on.</li><li><strong>total_jackpot:</strong> People who win random jackpots are more likely to feel positive and hence continue.</li><li><strong>win ratio (total_win/total_bet):</strong> Similar to above, people who win more are less likely to churn.</li><li><strong>signup_to_first_pay:</strong> People who pay immediately after signing up are likely more hard-core players and unlikely to churn. People who take a long time to pay are likely amateurs and are more likely to churn after making the payment.</li></ul>
<!-- /wp:list -->

<!-- wp:paragraph -->
<p></p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":3} -->
<h3>Validating the features</h3>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>To validate the choice of these features, we performed some further exploratory data analysis. As an illustration, the following plot shows the distribution of some of these features between churners and non-churners. For this, we compared some of the features mentioned above, such as total bets placed, total spins, total win amount, etc. for churn-positive and churn-negative users.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>It is obvious that churners behaved very differently than non-churners.&nbsp; The charts generated below are for just one of the cases - the number of <strong>total_jackpot</strong>s and the difference between people who churn and who do not can be identified.</p>
<!-- /wp:paragraph -->

<!-- wp:image {"id":26007,"sizeSlug":"large"} -->
<figure class="wp-block-image size-large"><img src="https://rudderstack.com/wp-content/uploads/2020/03/image-1-1024x421.png" alt="Distribution of features between the churning and non-churning customers" class="wp-image-26007"/></figure>
<!-- /wp:image -->

<!-- wp:image {"id":26008,"sizeSlug":"large"} -->
<figure class="wp-block-image size-large"><img src="https://rudderstack.com/wp-content/uploads/2020/03/image-2-1024x398.png" alt="Distribution of features between the churning and non-churning customers" class="wp-image-26008"/><figcaption> Distribution of the features between churning customers and non-churning customers </figcaption></figure>
<!-- /wp:image -->

<!-- wp:paragraph -->
<p>These feature plots were generated by dumping the data via SQL and plotting using matplotlib (though any other charting solution can be used).</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>In general, it is found that the range of values for churn-positive users varies within a significantly narrower range compared to those for churn-negative users.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p></p>
<!-- /wp:paragraph -->

<!-- wp:heading -->
<h2>Building a Customer Churn Prediction Model using BigQueryML</h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Based on the features we have identified, it is now time to build the churn prediction model. We will use Google BigQuery to do so.</p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":3} -->
<h3>Step 1: Creating the Training Set</h3>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>The first step is to generate the dataset by generating all the features and combining them into one view.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Computing the feature requires the following steps:</p>
<!-- /wp:paragraph -->

<!-- wp:list -->
<ul><li>Finding user-specific event dates. For example, when they first signed up, when they first paid, their last day of activity, etc. As mentioned above, RudderStack maintains a track table with all the events, so mapping these activities is essentially finding the date when a specific event occurred in the <strong>track</strong> table. The <strong>RANK()</strong> function comes handy by letting us associate a monotonically increasing number <em>rank </em>to each occurrence of an event for each user.<br><br>The query is as shown below:</li></ul>
<!-- /wp:list -->

<!-- wp:code -->
<pre class="wp-block-code"><code>CREATE TABLE FIRST_REV_DATE_TABLE AS 
     SELECT
     anonymous_id, rev_date as first_rev_date
 FROM
     ( 
     SELECT anonymous_id,     
         DATE_TRUNC('d', sent_at) as rev_date,
         RANK() OVER (PARTITION by anonymous_id ORDER BY sent_at DESC) as rank,
     FROM
                RUDDER.track
     WHERE
               event=’revenue’         
     )
 WHERE
    rank = 1</code></pre>
<!-- /wp:code -->

<!-- wp:paragraph -->
<p>Other date-specific tables like <code>SIGNUP_DATE_TABLE</code> (date of first activity), <code>LAST_SPIN_DATE_TABLE</code> (a user’s last spin) can be computed similarly.</p>
<!-- /wp:paragraph -->

<!-- wp:list -->
<ul><li> Using the date tables above, one can compute the features. For example, to find the number of spins between the signup and <code>first_rev</code>, one has to join the <code>RUDDER.spin</code> table, <code>SIGNUP_DATE_TABLE</code> and <code>LAST_SPIN_DATE_TABLE</code>. <code>RUDDER.spin</code> table is the event-specific table that RudderStack creates. The query is as shown:</li></ul>
<!-- /wp:list -->

<!-- wp:code -->
<pre class="wp-block-code"><code>CREATE TABLE NUM_OF_SPINS AS 
SELECT anonymous_id
     SUM(RUDDER.spin.no_of_spins) as no_of_spins
FROM 
     SIGNUP_DATE_TABLE, 
     FIRST_REV_DATE_TABLE,
     RUDDER.spin table
WHERE
     SIGNUP_DATE_TABLE.anonymous_id = RUDDER.spin_table.anonymous_id
     AND SIGNUP_DATE_TABLE.anonymous_id = RUDDER.spin_table.anonymous_id
     AND FIRST_REV_DATE.first_rev_date >= RUDDER.spin_table.sent_at
GROUP BY anonymous_id</code></pre>
<!-- /wp:code -->

<!-- wp:list -->
<ul><li> The next step is to compute the label column. A user has churned in 3 days if the difference between <code>LAST_SPIN_DATE</code> and <code>FIRST_PAY_DATE</code> is <strong>&lt;= 3 days</strong> and <strong>7 days</strong> (churn threshold) have passed since <code>LAST_SPIN_DATE</code>. This again is a simple SQL query joining the <code>FIRST_REV_DATE</code> and <code>LAST_SPIN_DATE</code>. This is added as another table&nbsp; 3_day_churn.</li><li> Finally, all these features can be combined into one giant feature by joining across <code>anonymous_id</code>.</li></ul>
<!-- /wp:list -->

<!-- wp:paragraph -->
<p></p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":3} -->
<h3>Step 2: Building the model</h3>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Now that we have our final dataset by choosing and generating all the data features that we need, it’s time to build the model directly from within our data warehouse using BigQuery ML. BigQuery ML has the support for building machine learning models, using just SQL. This considerably simplifies model-building iterations and eventual deployment.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Currently, BigQuery ML only supports some basic models like Logistic and Linear Regression, but&nbsp;not NBD/Pareto (usually most effective for churn). However, the goal here was to show how one can iterate quickly build and operationalize their ML model with just SQL from within the data warehouse.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>The following query shows how to generate the model in BigQueryML.</p>
<!-- /wp:paragraph -->

<!-- wp:group -->
<div class="wp-block-group"><div class="wp-block-group__inner-container"><!-- wp:code -->
<pre class="wp-block-code"><code>CREATE OR REPLACE MODEL `BigQueryMLModel

OPTIONS (model_type='LOGISTIC_REG',auto_class_weights=TRUE,data_split_method='NO_SPLIT', input_label_cols=['within_3_days'],max_iterations = 15) 

AS SELECT anonymous_id,first_spin_to_first_pay,total_jackpot,total_bet,total_win,total_spins, number_of_distinct_games, event_count,coin_balance,SUM_WIN_BY_BET, within_3_days

FROM '3DAY_CHURN_MODEL_ALL_FEATURES'

WHERE dataframe = 'training'</code></pre>
<!-- /wp:code --></div></div>
<!-- /wp:group -->

<!-- wp:paragraph -->
<p> The above query creates a <strong>Logistic Regression</strong> model using the data from the table containing all feature values for all the users. The model auto-assigns the class weights. We direct the training process to not split the data into training and test datasets - since it has already been done during the data preparation stage. Furthermore, we select only the data intended for training as the input for the model training process. The name of the <strong>label </strong>column has also been specified. The column <code>within_3_days</code> is marked as true or false, depending on whether the user is churn-positive or churn-negative. The maximum number of training iterations or steps is also specified.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p> We run the following query to evaluate our model:</p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre class="wp-block-code"><code>SELECT * FROM ML.EVALUATE (MODEL `BigQueryMLModel`, 
   (SELECT Anonymous_id,first_spin_to_first_pay,total_jackpot,total_bet,total_win,total_spins, number_of_distinct_games, event_count,coin_balance,SUM_WIN_BY_BET, within_3_days
    FROM `3DAY_CHURN_MODEL_ALL_FEATURES`
    WHERE dataframe = 'test’
    )
 )</code></pre>
<!-- /wp:code -->

<!-- wp:paragraph -->
<p>The above query takes the test dataset from the data containing all features for all the users, evaluates the model performance. Basically, the model will predict the value of the <code>within_3_days</code> column considering all other features. We then compare the predicted value against the actual value to calculate the model performance statistics.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p></p>
<!-- /wp:paragraph -->

<!-- wp:heading -->
<h2>Analyzing the Churn Prediction Model Performance</h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>We get the following performance metrics for the model:</p>
<!-- /wp:paragraph -->

<!-- wp:image -->
<figure class="wp-block-image"><img src="https://lh5.googleusercontent.com/hjUi7_mwJQkasRiwnMSEZtqnP9RmebQZRWlhQzP573hsOnmRY1a9jtaQM56fMbl8zwka5FYl2vissmM-oy15gWZJxXuW15WGpqBQqasyH2jjNHOavUd83zWZ0vkIxZbETTu3yhZo" alt="Performance metrics of the churn prediction model"/><figcaption>Performance metrics for the model</figcaption></figure>
<!-- /wp:image -->

<!-- wp:paragraph -->
<p> The ROC curve for recall vs. precision is as shown below:</p>
<!-- /wp:paragraph -->

<!-- wp:image -->
<figure class="wp-block-image"><img src="https://lh4.googleusercontent.com/W3Cj-XXZ8YxV47bOZulGhk7c5ice2nIcSIJUAN8-IFH9O1Ryxuet6fe5Ao8RkOIMbVKUlQ1joDmjJntm-EYlfF5XD71U0t330lhIjJtjQIVsSvSiQuHyTVjD8f32Y30S3akBbQua" alt="ROC Curve for the churn prediction model"/><figcaption>ROC Curve</figcaption></figure>
<!-- /wp:image -->

<!-- wp:paragraph -->
<p>When we compare the model’s prediction for the users - the expectation is that the model should predict a possible churn for as many of them as possible. In other words - the model should be able to <strong>correctly</strong> <strong>recall </strong>the class for the relevant users. The model achieves a recall of 84%, which is commendable. This is because the derived features and the chosen algorithm are quite simplistic in nature.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>It is essential that the model is able to identify users who would churn in actuality. At the same time, it is also important that it doesn't wrongly identify users who wouldn't churn. The implications of such a mistake can range from wasted incentives and therefore reduced ROI, to irritated users. Going back to our use-case, this means that values predicted by the model for either class in the test dataset should match the actual values in as many cases as possible. This measure, called <strong>precision</strong>, is also relatively high at close to 86%. This is fairly good, again considering that ours is a very simplistic model.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p></p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":3} -->
<h3>Out-of-sample testing</h3>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>In addition to the above, we also perform an out-of-sample test. This essentially is carrying out predictions on records that are not a part of either the training or evaluation process. However, we know the churn status for this data.  In other words, it is the “unseen” data. Accuracy of prediction for such cases gives a reasonably good idea of how well the model can perform in production.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>In our case, we check the false positive/negative rates for the out-of-sample test. We record these figures in the table as shown:</p>
<!-- /wp:paragraph -->

<!-- wp:table {"align":"center"} -->
<figure class="wp-block-table aligncenter"><table class=""><tbody><tr><td><strong>Threshold</strong></td><td><strong>Recall</strong></td><td><strong>False_Positive_Rate</strong></td></tr><tr><td>0.5</td><td>38%</td><td>2%</td></tr><tr><td>0.4</td><td>46%</td><td>4%</td></tr><tr><td>0.3&nbsp;</td><td>55%</td><td>6%</td></tr><tr><td>0.2&nbsp;</td><td>61%</td><td>8%</td></tr><tr><td>0.1</td><td>70%</td><td>10%</td></tr></tbody></table></figure>
<!-- /wp:table -->

<!-- wp:paragraph -->
<p>When a model makes a prediction, it also associates a <strong>probability</strong> of being correct or <strong>confidence</strong> for each class that it predicts. For a 0.1 or 10% threshold, the class that has been predicted with greater than or equal to 10% confidence as the class for a particular user - the recall is 70%, and the false positive rate is 10%. This means that the model correctly identified <strong>70% </strong>of the users who <strong>actually churned</strong> as churn candidates. Only <strong>10%</strong> of the users <strong>who did not churn</strong> were <strong>wrongly classified</strong> as churn candidates.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p></p>
<!-- /wp:paragraph -->

<!-- wp:heading -->
<h2>Conclusion</h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Based on the model-building exercise we undertook, there are several key observations and takeaways:</p>
<!-- /wp:paragraph -->

<!-- wp:list -->
<ul><li>Judging by the performance metrics, the churn prediction model appears to be performing reasonably well as a starter project. The outputs of the model should satisfy the product manager. Hence, we can definitely run various campaigns using this model as a base by deploying it in production.</li><li>More accumulation of data will require a periodic refresh of the model.</li><li>Instead of solely relying on domain knowledge for feature selection, performing <strong>Principal Component Analysis</strong> can yield better results.</li></ul>
<!-- /wp:list -->

<!-- wp:paragraph -->
<p>Apart from the above observations, we can also investigate alternate analytics platforms that support more complex model-building processes, including support for <strong>custom estimator functions</strong>.<br></p>
<!-- /wp:paragraph -->