<?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[Stories by Akashramesh on Medium]]></title>
        <description><![CDATA[Stories by Akashramesh on Medium]]></description>
        <link>https://medium.com/@akashramesh445?source=rss-499b1014d5f1------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*2K8_KRAzoRZsXVx3HCT2bw.jpeg</url>
            <title>Stories by Akashramesh on Medium</title>
            <link>https://medium.com/@akashramesh445?source=rss-499b1014d5f1------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 23:04:42 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@akashramesh445/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[ Predicting Spotify Song Popularity Using Machine Learning]]></title>
            <link>https://medium.com/@akashramesh445/predicting-spotify-song-popularity-using-machine-learning-185f392d1e87?source=rss-499b1014d5f1------2</link>
            <guid isPermaLink="false">https://medium.com/p/185f392d1e87</guid>
            <category><![CDATA[spotify]]></category>
            <category><![CDATA[model-training]]></category>
            <category><![CDATA[spotify-playlist]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[popular-song]]></category>
            <dc:creator><![CDATA[Akashramesh]]></dc:creator>
            <pubDate>Wed, 12 Nov 2025 16:48:28 GMT</pubDate>
            <atom:updated>2025-11-12T16:48:28.582Z</atom:updated>
            <content:encoded><![CDATA[<p><em>By Akash Ramesh | M.Tech Artificial Intelligence Student, Amrita Vishwa Vidyapeetham</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qiYd8AZhoxWY2BYWWFCYYw.png" /></figure><blockquote>“Can data science predict what makes a hit song?”<br> That question inspired me to combine my love for music with my curiosity for machine learning.<br> The result? A regression-based model that tries to predict how popular a song will be on Spotify — purely from its audio characteristics.</blockquote><p>In this post, I’ll walk you through how I built the <strong>Spotify Song Popularity Predictor</strong>, what I learned along the way, and how machine learning can peek into the art of music.</p><h3>🎯 The Goal</h3><p>Spotify assigns every track a <strong>popularity score (0–100)</strong> based on play counts, recency, and listener engagement.<br> My goal was to <strong>predict this popularity score</strong> using <strong>only the track’s audio features</strong> — such as:</p><ul><li>Danceability</li><li>Energy</li><li>Valence (musical positivity)</li><li>Tempo (beats per minute)</li><li>Loudness, Acoustic Ness, and more</li></ul><p>In other words:</p><blockquote>Given a song’s measurable audio properties, can we estimate how popular it will be?</blockquote><h3>🎧 The Dataset</h3><p>I used the <strong>Ultimate Spotify Tracks DB</strong> dataset from Kaggle — a massive collection of <strong>232,000+ songs</strong> with 18 attributes.</p><p>Each track includes both numerical features (like danceability, energy, loudness, tempo) and categorical ones (artist, genre, mode, time signature).</p><p>Here’s a small glimpse:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/823/1*M8IP5JviqioXm0mHJO0-jw.png" /></figure><h3>🧠 Machine Learning Approach</h3><p>This is a <strong>Supervised Regression Problem</strong> — we’re predicting a continuous value.</p><h3>Steps I followed:</h3><ol><li><strong>Data Preprocessing:</strong><br> Cleaned missing values and scaled all numerical features.</li><li><strong>Feature Selection:</strong><br> Chose the top 10 most relevant features correlated with popularity.</li><li><strong>Model Training: Use three models</strong></li></ol><ul><li>Linear Regression</li><li>Ridge Regression (L2 Regularization)</li><li>Lasso Regression (L1 Regularization)</li></ul><p>4.<strong> Evaluation:</strong><br> Measured accuracy using R² and RMSE.</p><p>5. <strong>Visualization:</strong><br> Used Seaborn heatmaps and scatter plots for analysis.</p><h3>📊 The Correlation Heatmap</h3><p>I plotted a heatmap of the features versus popularity.</p><p>🎶 <strong>Danceability</strong>, <strong>energy</strong>, and <strong>valence</strong> showed the strongest positive correlation with popularity — which makes sense:<br> people like energetic, feel-good music!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/802/1*skBcirPVr--4TP5LNdIptA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/987/1*pqqp4rMRDi5lJj6s3g7sCg.png" /></figure><p>The performance across models was similar, showing <strong>modest predictive power</strong> — not bad considering we’re predicting human taste using numbers!</p><h3>💡 Key Insight:</h3><p>Popularity isn’t just about the audio — it’s also influenced by marketing, artist fame, and timing.<br> That’s why even the best regression model only captures <strong>part</strong> of the story.</p><h3>📈 Visualization of Predictions</h3><p>Here’s how the <strong>actual vs predicted</strong> popularity looked:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/748/1*ya_AFxaLYF1MI9dh665jZQ.png" /></figure><p>The scatter plot showed a clear linear trend, though with variance — songs with similar features can perform differently depending on external factors.</p><h3>🧪 Lessons Learned</h3><ul><li><strong>Linear models are simple yet powerful</strong> — they gave interpretable insights.</li><li><strong>Regularization (Ridge/Lasso)</strong> helped control overfitting but didn’t improve R² significantly — meaning features weren’t highly collinear.</li><li><strong>Popularity prediction</strong> has limited linear correlation — it’s a mix of measurable and human factors.</li></ul><h3>🔮 Future Work</h3><p>To truly predict <em>future</em> popularity trends, the model can be enhanced by:</p><ul><li>Adding <strong>time-based features</strong> (release date, streaming count by week).</li><li>Using <strong>time-series forecasting</strong> (Prophet, ARIMA, or LSTM).</li><li>Integrating <strong>Spotify API</strong> to analyze live songs and update predictions dynamically.</li></ul><p>Imagine an AI tool that tells artists:</p><blockquote>“This track has a 70% chance of trending next month.”</blockquote><p>That’s the future of <strong>AI in music analytics</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*a7x6O8Q9m0JRpcjDdl3UyA.jpeg" /></figure><h3>💻 Tech Stack</h3><ul><li><strong>Python</strong></li><li><strong>Pandas, NumPy</strong> for data manipulation</li><li><strong>Matplotlib, Seaborn</strong> for visualization</li><li><strong>Scikit-learn</strong> for regression models</li><li><strong>Google Colab</strong> for experimentation</li></ul><h3>🎓 About the Author</h3><p>I’m <strong>Akash Ramesh</strong>, an M.Tech AI student at <strong>Amrita Vishwa Vidyapeetham, Amritapuri</strong>.<br> I’m passionate about blending machine learning with creative fields like music and art.</p><blockquote>This project taught me that data can describe creativity — but never replace it. 🎶</blockquote><h3>🔗 References</h3><ul><li>Kaggle Dataset: <a href="https://www.kaggle.com/datasets/zaheenhamidani/ultimate-spotify-tracks-db">Ultimate Spotify Tracks DB</a></li><li>Scikit-learn Documentation — <a href="https://scikit-learn.org/">https://scikit-learn.org</a></li><li>Spotify Web API — <a href="https://developer.spotify.com/documentation/web-api">https://developer.spotify.com/documentation/web-api</a></li></ul><h3>✨ Closing Note</h3><p>Predicting music popularity may not be perfect, but this project proves that <strong>machine learning can listen too</strong> — and maybe, one day, even jam along.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=185f392d1e87" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>