<pid="intro">Welcome to the website of my dissertation project. This project aims to predict the moods of songs in a Spotify playlist by using both Spotify's track audio features and sentiment analysis of song lyrics, and feeding this data into a machine learning model.
<pid="intro">Welcome to the website of my dissertation project. This project aims to predict the moods of songs in a Spotify playlist by using both Spotify's track audio features and sentiment analysis of song lyrics, and feeding this data into a machine learning model.
<br><br>
<br><br>
For my project, it will be used to analyse the Top Songs of 2019 - 2022 to look at the listening habits of people during the COVID-19 pandemic, and how they may have been affected. Here you will be able to see the results of my analysis - for example, the most common moods, how useful sentiment analysis of lyrics is in mood prediction, and my justification of choice in machine learning model. A logistic regression model was used to predict the moods - all charts shown are therefore based on this model.
For my project, it will be used to analyse the Top Songs of 2019 - 2022 to look at the listening habits of people during the COVID-19 pandemic, and how they may have been affected. Here you will be able to see the results of my analysis - for example, the most common moods - how useful sentiment analysis of lyrics is in mood prediction, and my justification of choice in machine learning model. A logistic regression model was used to predict the moods - all charts shown are therefore based on this model.
{% block title %} Choosing a machine learning model {% endblock %}
{% block title %} Choosing a machine learning model {% endblock %}
{% block content %}
{% block content %}
<p>Machine learning models page</p>
<divclass="subheading">Choosing a Machine Learning Model</div>
<divclass="description">In this project, I tested four different machine learning classification models to predict the mood of the songs in a given playlist, which was trained using a dataset I created: Gaussian Naive Bayes, Support Vector Classifier, Decision Tree, and Logistic Regression. By using different measures to test which was the most accurate (precision, recall, F1-score), I decided to use logistic regression for the final implementation as it had the best scores.</div>
<imgsrc="{{ url_for('static', filename='images/models_accuracy.png') }}"alt="Accuracy of Each Model"class="accuracy-chart-image">
</div>
<divclass="description">In these confusion matrices, we can see how logistic regression has the greatest number of predicted moods matching the true moods for all except "Calm". When we compare the accuracies we see that logistic regression performs the best, where the accuracy is how many correctly classified instances there are over the total number of instances. However, this may not always be the best measure if the dataset is not completely balanced (there are slight differences in number of songs per mood in the dataset). So, we can look at other metrics to compare the models:</div>