<?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"><channel><title><![CDATA[Vashni Roy | Engineering Notes]]></title><description><![CDATA[Vashni Roy | Engineering Notes]]></description><link>https://vashniroy.hashnode.dev</link><image><url>https://cdn.hashnode.com/res/hashnode/image/upload/v1593680282896/kNC7E8IR4.png</url><title>Vashni Roy | Engineering Notes</title><link>https://vashniroy.hashnode.dev</link></image><generator>RSS for Node</generator><lastBuildDate>Sun, 18 Oct 2026 12:51:07 GMT</lastBuildDate><atom:link href="https://vashniroy.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Does a More Complex ML Model Actually Give Better Results?]]></title><description><![CDATA[I recently compared Logistic Regression and XGBoost on a customer churn problem.
I expected XGBoost to do better, but the results were actually the opposite. Logistic Regression performed better acros]]></description><link>https://vashniroy.hashnode.dev/does-a-more-complex-ml-model-actually-give-better-results</link><guid isPermaLink="true">https://vashniroy.hashnode.dev/does-a-more-complex-ml-model-actually-give-better-results</guid><category><![CDATA[Machine Learning]]></category><category><![CDATA[Xgboost]]></category><category><![CDATA[Data Science]]></category><category><![CDATA[Python]]></category><category><![CDATA[Model Evaluation]]></category><dc:creator><![CDATA[Vashni Roy]]></dc:creator><pubDate>Wed, 14 Oct 2026 10:38:12 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/6acf457a25d8f536e4e28294/e377163a-759c-4802-b220-fb3be3d10dab.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>I recently compared Logistic Regression and XGBoost on a customer churn problem.</p>
<p>I expected XGBoost to do better, but the results were actually the opposite. Logistic Regression performed better across all the metrics I compared.</p>
<p>I also ran 5-fold cross-validation to make sure this wasn't just because of one data split. The results were similar there too.</p>
<p>So, I thought this was worth sharing.</p>
<h2>How I compared them</h2>
<p>I used the Telco Customer Churn dataset, which has 7,043 customer records. Around 26.5% of them had churned. I kept the setup the same for both models so the comparison was fair:</p>
<ul>
<li><p>80% data for training and 20% for testing</p>
</li>
<li><p>Same train/test split</p>
</li>
<li><p>Numerical features were scaled</p>
</li>
<li><p>Categorical features were one-hot encoded</p>
</li>
<li><p>Compared using Accuracy, Precision, Recall, F1 and ROC-AUC</p>
</li>
</ul>
<p>I first ran Logistic Regression and then XGBoost on the same setup.</p>
<h2>The first results</h2>
<table>
<thead>
<tr>
<th>Metric</th>
<th>Logistic Regression</th>
<th>XGBoost</th>
</tr>
</thead>
<tbody><tr>
<td>Accuracy</td>
<td>0.806</td>
<td>0.785</td>
</tr>
<tr>
<td>Precision</td>
<td>0.657</td>
<td>0.606</td>
</tr>
<tr>
<td>Recall</td>
<td>0.559</td>
<td>0.543</td>
</tr>
<tr>
<td>F1</td>
<td>0.604</td>
<td>0.573</td>
</tr>
<tr>
<td>ROC-AUC</td>
<td>0.842</td>
<td>0.825</td>
</tr>
</tbody></table>
<p>Logistic Regression performed better across all five metrics.</p>
<p>But this was only one train/test split. I didn't want to conclude anything based on that alone, so I checked both models again using 5-fold cross-validation.</p>
<h2>Checking with cross-validation</h2>
<p>I ran 5-fold cross-validation for both models using the same evaluation metrics. This gave me a better view of how the models performed across different splits of the data.</p>
<table>
<thead>
<tr>
<th>Metric</th>
<th>Logistic Regression</th>
<th>XGBoost</th>
</tr>
</thead>
<tbody><tr>
<td>Accuracy</td>
<td>0.802 ± 0.012</td>
<td>0.780 ± 0.012</td>
</tr>
<tr>
<td>Precision</td>
<td>0.653 ± 0.026</td>
<td>0.602 ± 0.028</td>
</tr>
<tr>
<td>Recall</td>
<td>0.542 ± 0.041</td>
<td>0.508 ± 0.023</td>
</tr>
<tr>
<td>F1</td>
<td>0.592 ± 0.030</td>
<td>0.551 ± 0.024</td>
</tr>
<tr>
<td>ROC-AUC</td>
<td>0.846 ± 0.013</td>
<td>0.822 ± 0.009</td>
</tr>
</tbody></table>
<p>The same pattern showed up again. Logistic Regression stayed ahead across all five metrics.</p>
<p>So the first result wasn't just coming from one particular data split.</p>
<h2>What I took from this</h2>
<p>This doesn't mean Logistic Regression is better than XGBoost.</p>
<p>I used XGBoost without much tuning, and with a different dataset or setup, the results could easily change.</p>
<p>For me, the main takeaway was simple: <strong>start with a good baseline before adding complexity.</strong></p>
<p>A more complex model should earn its place by giving you something better performance, better handling of the problem, or some other clear advantage.</p>
<p>In this case, it didn't.</p>
<h2>Experiment</h2>
<p>I’ve kept the complete experiment, code, results, and cross-validation in GitHub if you want to take a closer look:</p>
<p><strong>GitHub:</strong> <a href="https://github.com/VASHNIROY/Churn-prediction/tree/main/experiments/logistic-vs-xgboost">Experiment</a></p>
]]></content:encoded></item></channel></rss>