Skip to content
Snippets Groups Projects
Commit beee3339 authored by Aaron Cheung's avatar Aaron Cheung
Browse files

Finished machine learning model page, changes to stylesheet

parent 22432f63
No related branches found
No related tags found
No related merge requests found
......@@ -228,7 +228,7 @@ hr.gradient {
display: flex;
justify-content: center;
flex-wrap: wrap;
margin-bottom: 25px;
margin-bottom: 10px;
}
.accuracy-chart-image {
......@@ -243,6 +243,13 @@ hr.gradient {
transform: scale(1.6);
}
.table-container {
display: flex;
justify-content: center;
flex-wrap: wrap;
width: 100%;
}
.table {
width: 25%;
height: auto;
......
{% extends 'base.html' %}
{% block title %} Choosing a machine learning model {% endblock %}
{% block title %} Choosing a Machine Learning Model {% endblock %}
{% block content %}
<div class="subheading">Choosing a Machine Learning Model</div>
......@@ -16,294 +16,298 @@
<img src="{{ url_for('static', filename='images/models_accuracy.png') }}" alt="Accuracy of Each Model" class="accuracy-chart-image">
</div>
<div class="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>
<hr class="gradient">
<div class="table">
<table class="table1">
<thead>
<tr>
<th>Gaussian NB</th>
<th>Precision</th>
<th>Recall</th>
<th>F1-Score</th>
<th>Support</th>
</tr>
</thead>
<tbody>
<tr>
<td>Calm</td>
<td>0.48</td>
<td>0.68</td>
<td>0.57</td>
<td>47</td>
</tr>
<tr>
<td>Excited</td>
<td>0.76</td>
<td>0.69</td>
<td>0.72</td>
<td>51</td>
</tr>
<tr>
<td>Happy</td>
<td>0.49</td>
<td>0.63</td>
<td>0.55</td>
<td>35</td>
</tr>
<tr>
<td>Sad</td>
<td>0.95</td>
<td>0.59</td>
<td>0.73</td>
<td>64</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>Accuracy</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>0.64</td>
<td>197</td>
</tr>
<tr>
<td>Macro Avg</td>
<td>0.67</td>
<td>0.65</td>
<td>0.64</td>
<td>197</td>
</tr>
<tr>
<td>Weighted Avg</td>
<td>0.71</td>
<td>0.64</td>
<td>0.66</td>
<td>197&nbsp;</td>
</tr>
</tbody>
</table>
</div>
<div class="description">In the 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>
<div class="table">
<table class="table2">
<thead>
<tr>
<th>SVC</th>
<th>Precision</th>
<th>Recall</th>
<th>F1-Score</th>
<th>Support</th>
</tr>
</thead>
<tbody>
<tr>
<td>Calm</td>
<td>0.57</td>
<td>0.53</td>
<td>0.55</td>
<td>47</td>
</tr>
<tr>
<td>Excited</td>
<td>0.73</td>
<td>0.65</td>
<td>0.69</td>
<td>51</td>
</tr>
<tr>
<td>Happy</td>
<td>0.46</td>
<td>0.74</td>
<td>0.57</td>
<td>35</td>
</tr>
<tr>
<td>Sad</td>
<td>0.88</td>
<td>0.72</td>
<td>0.79</td>
<td>64</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>Accuracy</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>0.66</td>
<td>197</td>
</tr>
<tr>
<td>Macro Avg</td>
<td>0.66</td>
<td>0.66</td>
<td>0.65</td>
<td>197</td>
</tr>
<tr>
<td>Weighted Avg</td>
<td>0.70</td>
<td>0.66</td>
<td>0.67</td>
<td>197&nbsp;</td>
</tr>
</tbody>
</table>
</div>
<div class="table-container">
<div class="table">
<table class="table1">
<thead>
<tr>
<th>Gaussian NB</th>
<th>Precision</th>
<th>Recall</th>
<th>F1-Score</th>
<th>Support</th>
</tr>
</thead>
<tbody>
<tr>
<td>Calm</td>
<td>0.48</td>
<td>0.68</td>
<td>0.57</td>
<td>47</td>
</tr>
<tr>
<td>Excited</td>
<td>0.76</td>
<td>0.69</td>
<td>0.72</td>
<td>51</td>
</tr>
<tr>
<td>Happy</td>
<td>0.49</td>
<td>0.63</td>
<td>0.55</td>
<td>35</td>
</tr>
<tr>
<td>Sad</td>
<td>0.95</td>
<td>0.59</td>
<td>0.73</td>
<td>64</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>Accuracy</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>0.64</td>
<td>197</td>
</tr>
<tr>
<td>Macro Avg</td>
<td>0.67</td>
<td>0.65</td>
<td>0.64</td>
<td>197</td>
</tr>
<tr>
<td>Weighted Avg</td>
<td>0.71</td>
<td>0.64</td>
<td>0.66</td>
<td>197&nbsp;</td>
</tr>
</tbody>
</table>
</div>
<div class="table">
<table class="table3">
<thead>
<tr>
<th>Decision Tree</th>
<th>Precision</th>
<th>Recall</th>
<th>F1-Score</th>
<th>Support</th>
</tr>
</thead>
<tbody>
<tr>
<td>Calm</td>
<td>0.50</td>
<td>0.60</td>
<td>0.54</td>
<td>47</td>
</tr>
<tr>
<td>Excited</td>
<td>0.64</td>
<td>0.55</td>
<td>0.59</td>
<td>51</td>
</tr>
<tr>
<td>Happy</td>
<td>0.40</td>
<td>0.54</td>
<td>0.46</td>
<td>35</td>
</tr>
<tr>
<td>Sad</td>
<td>0.88</td>
<td>0.67</td>
<td>0.76</td>
<td>64</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>Accuracy</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>0.60</td>
<td>197</td>
</tr>
<tr>
<td>Macro Avg</td>
<td>0.60</td>
<td>0.59</td>
<td>0.59</td>
<td>197</td>
</tr>
<tr>
<td>Weighted Avg</td>
<td>0.64</td>
<td>0.60</td>
<td>0.61</td>
<td>197&nbsp;</td>
</tr>
</tbody>
</table>
</div>
<div class="table">
<table class="table2">
<thead>
<tr>
<th>SVC</th>
<th>Precision</th>
<th>Recall</th>
<th>F1-Score</th>
<th>Support</th>
</tr>
</thead>
<tbody>
<tr>
<td>Calm</td>
<td>0.57</td>
<td>0.53</td>
<td>0.55</td>
<td>47</td>
</tr>
<tr>
<td>Excited</td>
<td>0.73</td>
<td>0.65</td>
<td>0.69</td>
<td>51</td>
</tr>
<tr>
<td>Happy</td>
<td>0.46</td>
<td>0.74</td>
<td>0.57</td>
<td>35</td>
</tr>
<tr>
<td>Sad</td>
<td>0.88</td>
<td>0.72</td>
<td>0.79</td>
<td>64</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>Accuracy</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>0.66</td>
<td>197</td>
</tr>
<tr>
<td>Macro Avg</td>
<td>0.66</td>
<td>0.66</td>
<td>0.65</td>
<td>197</td>
</tr>
<tr>
<td>Weighted Avg</td>
<td>0.70</td>
<td>0.66</td>
<td>0.67</td>
<td>197&nbsp;</td>
</tr>
</tbody>
</table>
</div>
<div class="table">
<table class="table3">
<thead>
<tr>
<th>Decision Tree</th>
<th>Precision</th>
<th>Recall</th>
<th>F1-Score</th>
<th>Support</th>
</tr>
</thead>
<tbody>
<tr>
<td>Calm</td>
<td>0.50</td>
<td>0.60</td>
<td>0.54</td>
<td>47</td>
</tr>
<tr>
<td>Excited</td>
<td>0.64</td>
<td>0.55</td>
<td>0.59</td>
<td>51</td>
</tr>
<tr>
<td>Happy</td>
<td>0.40</td>
<td>0.54</td>
<td>0.46</td>
<td>35</td>
</tr>
<tr>
<td>Sad</td>
<td>0.88</td>
<td>0.67</td>
<td>0.76</td>
<td>64</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>Accuracy</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>0.60</td>
<td>197</td>
</tr>
<tr>
<td>Macro Avg</td>
<td>0.60</td>
<td>0.59</td>
<td>0.59</td>
<td>197</td>
</tr>
<tr>
<td>Weighted Avg</td>
<td>0.64</td>
<td>0.60</td>
<td>0.61</td>
<td>197&nbsp;</td>
</tr>
</tbody>
</table>
</div>
<div class="table">
<table class="table4">
<thead>
<tr>
<th>Log Regr.</th>
<th>Precision</th>
<th>Recall</th>
<th>F1-Score</th>
<th>Support</th>
</tr>
</thead>
<tbody>
<tr>
<td>Calm</td>
<td>0.66</td>
<td>0.49</td>
<td>0.56</td>
<td>47</td>
</tr>
<tr>
<td>Excited</td>
<td>0.74</td>
<td>0.73</td>
<td>0.73</td>
<td>51</td>
</tr>
<tr>
<td>Happy</td>
<td>0.46</td>
<td>0.74</td>
<td>0.57</td>
<td>35</td>
</tr>
<tr>
<td>Sad</td>
<td>0.88</td>
<td>0.77</td>
<td>0.82</td>
<td>64</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>Accuracy</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>0.69</td>
<td>197</td>
</tr>
<tr>
<td>Macro Avg</td>
<td>0.68</td>
<td>0.68</td>
<td>0.67</td>
<td>197</td>
</tr>
<tr>
<td>Weighted Avg</td>
<td>0.72</td>
<td>0.69</td>
<td>0.69</td>
<td>197&nbsp;</td>
</tr>
</tbody>
</table>
<div class="table">
<table class="table4">
<thead>
<tr>
<th>Log Regr.</th>
<th>Precision</th>
<th>Recall</th>
<th>F1-Score</th>
<th>Support</th>
</tr>
</thead>
<tbody>
<tr>
<td>Calm</td>
<td>0.66</td>
<td>0.49</td>
<td>0.56</td>
<td>47</td>
</tr>
<tr>
<td>Excited</td>
<td>0.74</td>
<td>0.73</td>
<td>0.73</td>
<td>51</td>
</tr>
<tr>
<td>Happy</td>
<td>0.46</td>
<td>0.74</td>
<td>0.57</td>
<td>35</td>
</tr>
<tr>
<td>Sad</td>
<td>0.88</td>
<td>0.77</td>
<td>0.82</td>
<td>64</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>Accuracy</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>0.69</td>
<td>197</td>
</tr>
<tr>
<td>Macro Avg</td>
<td>0.68</td>
<td>0.68</td>
<td>0.67</td>
<td>197</td>
</tr>
<tr>
<td>Weighted Avg</td>
<td>0.72</td>
<td>0.69</td>
<td>0.69</td>
<td>197&nbsp;</td>
</tr>
</tbody>
</table>
</div>
</div>
{% endblock %}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment