diff --git a/projects/Music-Playlist-Generator/Code.ipynb b/projects/Music-Playlist-Generator/Code.ipynb new file mode 100644 index 00000000..fc20e0ef --- /dev/null +++ b/projects/Music-Playlist-Generator/Code.ipynb @@ -0,0 +1,944 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "id": "nCPqi62WlgH6" + }, + "outputs": [], + "source": [] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "39tdMsC6lgH7" + }, + "source": [ + "##### Dataset Source : Kaggle [https://www.kaggle.com/cnic92/spotify-past-decades-songs-50s10s?select=2010.csv ]\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "id": "OAwYR5I2lgH8" + }, + "outputs": [], + "source": [ + "import pandas as pd\n", + "import matplotlib.pyplot as plt\n", + "from sklearn.metrics import accuracy_score" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "4oL3re86mR1G", + "outputId": "1455a20a-bd04-4d09-e889-c46b517c1782" + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Mounted at /content/drive\n" + ] + } + ], + "source": [ + "from google.colab import drive\n", + "drive.mount('/content/drive')" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "qNYQBFwRlgH-", + "outputId": "4b33c722-af33-4212-e76f-ca406772ac93" + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + " Unnamed: 0 PC1 PC2 PC3 top genre\n", + "0 0 3.616142 -2.822903 2.304606 19\n", + "1 1 4.398339 -3.324495 1.631486 14\n", + "2 2 -0.313810 -2.883387 1.236102 13\n", + "3 3 -0.048058 -1.703037 -0.188615 9\n", + "4 4 1.842614 0.768541 1.373641 15\n" + ] + } + ], + "source": [ + "data = pd.read_csv('/content/drive/MyDrive/Colab Notebooks/Machine Learning/Project/Phase2/modifiedDataset.csv')\n", + "print(data.head())" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "s2LqgOZtlgH_", + "outputId": "71a67024-c511-46c5-ac40-a3ff5301dd94" + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + "RangeIndex: 100 entries, 0 to 99\n", + "Data columns (total 5 columns):\n", + " # Column Non-Null Count Dtype \n", + "--- ------ -------------- ----- \n", + " 0 Unnamed: 0 100 non-null int64 \n", + " 1 PC1 100 non-null float64\n", + " 2 PC2 100 non-null float64\n", + " 3 PC3 100 non-null float64\n", + " 4 top genre 100 non-null int64 \n", + "dtypes: float64(3), int64(2)\n", + "memory usage: 4.0 KB\n" + ] + } + ], + "source": [ + "data.info()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "id": "lsnZtOUPlgIA" + }, + "outputs": [], + "source": [ + "data=data.drop(['Unnamed: 0'],axis = 1)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "zJhIHM1llgIA", + "outputId": "a026abf4-ca96-4354-ae02-c84a1b9bce70" + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + "RangeIndex: 100 entries, 0 to 99\n", + "Data columns (total 4 columns):\n", + " # Column Non-Null Count Dtype \n", + "--- ------ -------------- ----- \n", + " 0 PC1 100 non-null float64\n", + " 1 PC2 100 non-null float64\n", + " 2 PC3 100 non-null float64\n", + " 3 top genre 100 non-null int64 \n", + "dtypes: float64(3), int64(1)\n", + "memory usage: 3.2 KB\n" + ] + } + ], + "source": [ + "data.info()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "OU-Z_YT9lgIB", + "outputId": "5e9f1004-0c92-4e22-eb71-efb0fc512697" + }, + "outputs": [ + { + "data": { + "text/plain": [ + "(100, 4)" + ] + }, + "execution_count": 9, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "data.shape" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "id": "q0pYrRgZlgIB" + }, + "outputs": [], + "source": [ + "from sklearn.model_selection import train_test_split \n", + "arr=data.values\n", + "X=arr[:,0:3]\n", + "Y=arr[:,3]\n", + "X_train, X_test, y_train, y_test = train_test_split(X, Y, test_size=0.20, random_state=1) " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "id": "fC1STwKZlgIC" + }, + "outputs": [], + "source": [ + "accuracies=[]\n", + "modelName=[]" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "8mwoPq2ClgIC" + }, + "source": [ + "## KNN" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "A9ynaFeVlgIC", + "outputId": "4b1150cd-9dd3-4a18-896a-a0e729eb009a" + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Accuracy: 0.35\n" + ] + } + ], + "source": [ + "from sklearn.neighbors import KNeighborsClassifier \n", + "\n", + "classifier = KNeighborsClassifier(n_neighbors=4) \n", + "classifier.fit(X_train, y_train)\n", + "y_pred = classifier.predict(X_test)\n", + "\n", + "\n", + "\n", + "knn_accuracy=accuracy_score(y_test,y_pred)\n", + "print(\"Accuracy:\",knn_accuracy)\n", + "\n", + "accuracies.append(knn_accuracy)\n", + "modelName.append(\"KNN\")\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "3IxvinEtlgID" + }, + "source": [ + "## SVM" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "1VjNCdeflgID", + "outputId": "7a2302b0-a83d-4957-fef6-5e6826d65717" + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Accuracy: 0.35\n" + ] + } + ], + "source": [ + "from sklearn.svm import SVC\n", + "svm_model_linear = SVC(kernel = 'linear', C = 1).fit(X_train, y_train)\n", + "svm_predictions = svm_model_linear.predict(X_test)\n", + " \n", + "# model accuracy for X_test \n", + "accuracy = svm_model_linear.score(X_test, y_test)\n", + " \n", + "svm_accuracy=accuracy_score(y_test,svm_predictions)\n", + "print(\"Accuracy:\",svm_accuracy)\n", + "\n", + "accuracies.append(svm_accuracy)\n", + "modelName.append(\"SVM\")" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "bUXbniwrlgIE" + }, + "source": [ + "## Logistic Regression" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "ly23zGWslgIE", + "outputId": "6b4c6201-914b-429b-dfa1-dce29aca4c1c" + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Accuracy: 0.4\n" + ] + } + ], + "source": [ + "#Logistic Regression\n", + "\n", + "from sklearn.linear_model import LogisticRegression\n", + "model = LogisticRegression(max_iter=1000,random_state=0, \n", + " solver='lbfgs', multi_class='multinomial')\n", + "model.fit(X_train, y_train)\n", + "\n", + "predicted = model.predict(X_test)\n", + "logistic_accuracy=accuracy_score(y_test, predicted)\n", + "print(\"Accuracy:\",logistic_accuracy)\n", + "\n", + "accuracies.append(logistic_accuracy)\n", + "modelName.append(\"Logistic Regression\")" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "C3-HUkdblgIF" + }, + "source": [ + "## Decision Tree" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "n1aZu_JzlgIF", + "outputId": "ea10acdf-de93-4d2c-fd63-373858e577f8" + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Accuracy: 0.1\n" + ] + } + ], + "source": [ + "from sklearn.tree import DecisionTreeClassifier\n", + "\n", + "tree = DecisionTreeClassifier(criterion = 'entropy', random_state = 10)\n", + "tree.fit(X_train, y_train)\n", + "pred = tree.predict(X_test)\n", + "tree_accuracy=accuracy_score(y_test, pred)\n", + "print(\"Accuracy:\",tree_accuracy)\n", + "\n", + "accuracies.append(tree_accuracy)\n", + "modelName.append(\"Decision Tree\")" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "2s-Z0URdlgIG" + }, + "source": [ + "## Naive bayes" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "e-YEzn-GlgIG", + "outputId": "11158f65-00b2-4ad7-bb62-d40befaa820a" + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Accuracy: 0.3\n" + ] + } + ], + "source": [ + "from sklearn.naive_bayes import GaussianNB\n", + "gnb = GaussianNB()\n", + "gnb.fit(X_train, y_train)\n", + "gnb_predict =gnb.predict(X_test)\n", + "gnb_accuracy=accuracy_score(y_test, gnb_predict)\n", + "print(\"Accuracy:\",gnb_accuracy)\n", + "\n", + "accuracies.append(gnb_accuracy)\n", + "modelName.append(\"Naive Bayes\")" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/", + "height": 350 + }, + "id": "kFVSeHvTlgIH", + "outputId": "139778e3-9658-4751-bcfb-3b4d46ffc541" + }, + "outputs": [ + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAmcAAAFNCAYAAABFbcjcAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4yLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+WH4yJAAAgAElEQVR4nO3debglVXn3/e+PRgYBEaRjFGgaFRUQRW1R4xhFxKhgIgY0KBgTxIgzecXow5SYgMZZfAQVhxgFlOjbIgZHnHDoRhBtDLFBlEYcEBARZLyfP2odKTbndO+G3t3Vfb6f69rXqVq1qureVbWr7rNqSlUhSZKkYVhvTQcgSZKkW5mcS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3/qaWN++FdPvWD/bKXg4sSHdDyPl0LdAw/f5hreEbAiQNTpJN23/mtGv17lVVQ0hAbiPdIzLuUlV/SHJfuqTkAetgYi2tcenuhH5bVY115+3azBsCJA3R05O8jm4f9VO6u7uG6K7AV9rpugD/YGImrXrtn7SX0LXMrfNsOZMkSRoQrzmTJEkaEJMzSZKkATE5kyRJGhCTM0mzQpJK8tFe//pJft2ePL8y07k4K3hZ9Dh1JGkmJmeSZovfAw9KsnHrfwq3PuxSkgbD5EzSbHI63ds1AJ5L70HA7an9n24Ps/x2kge38nsk+XySJUneT++VSEn2T/Ld9jDN49tzzyTpTjE5kzSbnATsl2Qj4MHAd3rDjgLOqaoHA/8EfKSVHwF8o6p2pnvzxjyAJDvSvfj5MVW1K937G2fFM5gkTZYPoZU0a1TVeUnm07WanT4y+LF0L6Onqr7cWszuRvdC5r9q5Z9NcmWr/2S6Fz4vaq/c3JjuJd+SdKeYnEmabRYC/w48EbjHnZhOgA9X1etWRVCSNMXTmpJmmxOBo6rqByPlX6edlkzyRODyqroa+BrwvFb+NGCLVv9LwD5J/qQN2zLJdpMPX9K6zpYzSbNKVS0D3jnNoCOBE5OcB1wLHNDKjwI+nmQJcBbwszad85O8Afh8kvWAG4GX0r0LVJLuMN+tKUmSNCCe1pQkSRoQkzNJkqQBMTmTJEkaEJMzSZKkATE5kyRJGhCTM0mSpAExOZMkSRoQkzNJkqQB+X9w5+OXpbGpLgAAAABJRU5ErkJggg==", + "text/plain": [ + "
" + ] + }, + "metadata": { + "needs_background": "light" + }, + "output_type": "display_data" + } + ], + "source": [ + "fig = plt.figure(figsize = (10, 5))\n", + "plt.bar(modelName, accuracies)\n", + "plt.xlabel('Model')\n", + "plt.ylabel('Accuracy')\n", + "plt.title('Accuracies of Different Models Before Validating the Data')\n", + "plt.show()" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "StLiCOJtlgII" + }, + "source": [ + "# Applying validation" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "JG2tdishlgII" + }, + "source": [ + "## KNN" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "id": "0IQ31mCUlgII" + }, + "outputs": [], + "source": [ + "k_vals=[]\n", + "mean_accuracies=[]\n", + "exec_time=[]" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "mABTD_wulgIJ", + "outputId": "f734864c-abb7-4614-c93c-20d482fe1e7e" + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "0.1\n", + "0.25\n", + "0.3\n", + "0.6\n", + "0.6\n", + "\n", + "Mean: 0.37\n" + ] + } + ], + "source": [ + "from sklearn.model_selection import KFold\n", + "import numpy as np\n", + "import time\n", + "\n", + "kf = KFold(n_splits=5, random_state=None) \n", + "\n", + "accuracy =[]\n", + "\n", + "for train_index, test_index in kf.split(X):\n", + " X_train, X_test = X[train_index], X[test_index] \n", + " y_train, y_test = Y[train_index], Y[test_index]\n", + " \n", + " from sklearn.neighbors import KNeighborsClassifier \n", + " \n", + " start = time.time()\n", + " k=10\n", + " classifier = KNeighborsClassifier(n_neighbors=k) \n", + " classifier.fit(X_train, y_train)\n", + " y_pred = classifier.predict(X_test)\n", + " end = time.time()\n", + " \n", + " accuracy.append(accuracy_score(y_test, y_pred))\n", + " print(accuracy_score(y_test, y_pred))\n", + "\n", + "acc=np.array(accuracy) \n", + "print(\"\\nMean: \",np.mean(acc))\n", + " " + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "Hn2IzDKslgIL" + }, + "source": [ + "## SVM" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "sR_jTPJ1lgIL", + "outputId": "2ea38e9e-6041-4b44-8829-023cec7871a0" + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "0.15\n", + "0.25\n", + "0.3\n", + "0.65\n", + "0.65\n", + "\n", + "Mean: 0.4\n" + ] + } + ], + "source": [ + "from sklearn.model_selection import KFold\n", + "import numpy as np\n", + "kf = KFold(n_splits=5, random_state=None) \n", + "# X is the feature set and y is the target\n", + "\n", + "accuracy =[]\n", + "\n", + "for train_index, test_index in kf.split(X):\n", + " X_train, X_test = X[train_index], X[test_index] \n", + " y_train, y_test = Y[train_index], Y[test_index]\n", + " \n", + " from sklearn.svm import SVC\n", + " svm_model_linear = SVC(kernel = 'linear', C = 1).fit(X_train, y_train)\n", + " svm_predictions = svm_model_linear.predict(X_test)\n", + " \n", + " svm_accuracy=accuracy_score(y_test,svm_predictions)\n", + " accuracy.append(svm_accuracy)\n", + " print(accuracy_score(y_test, svm_predictions))\n", + "\n", + "acc=np.array(accuracy) \n", + "print(\"\\nMean: \",np.mean(acc))\n", + " " + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "3TIrWDj9lgIM" + }, + "source": [ + "## Logistic Regression" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "WAw9tFWblgIM", + "outputId": "904ae642-db76-423e-cd0d-abdcc8175ecd" + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "0.15\n", + "0.3\n", + "0.35\n", + "0.65\n", + "0.65\n", + "\n", + "Mean: 0.42000000000000004\n" + ] + } + ], + "source": [ + "from sklearn.model_selection import KFold\n", + "import numpy as np\n", + "kf = KFold(n_splits=5, random_state=None) \n", + "# X is the feature set and y is the target\n", + "\n", + "accuracy =[]\n", + "\n", + "for train_index, test_index in kf.split(X):\n", + " X_train, X_test = X[train_index], X[test_index] \n", + " y_train, y_test = Y[train_index], Y[test_index]\n", + " \n", + " from sklearn.linear_model import LogisticRegression\n", + " model = LogisticRegression(max_iter=1000,random_state=0,\n", + " solver='lbfgs', multi_class='multinomial')\n", + " model.fit(X_train, y_train)\n", + "\n", + " predicted = model.predict(X_test)\n", + " logistic_accuracy=accuracy_score(y_test, predicted)\n", + "\n", + " accuracy.append(logistic_accuracy)\n", + " print(accuracy_score(y_test, predicted))\n", + "\n", + "acc=np.array(accuracy) \n", + "print(\"\\nMean: \",np.mean(acc))\n", + " " + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "-_s2qPjjlgIN" + }, + "source": [ + "## Decision Tree" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "m8PGgbldlgIN", + "outputId": "afda23b0-01db-48b0-b768-45a6ca1c5c3a" + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "0.0\n", + "0.2\n", + "0.25\n", + "0.2\n", + "0.4\n", + "\n", + "Mean: 0.21000000000000002\n" + ] + } + ], + "source": [ + "from sklearn.model_selection import KFold\n", + "import numpy as np\n", + "kf = KFold(n_splits=5, random_state=None) \n", + "# X is the feature set and y is the target\n", + "\n", + "accuracy =[]\n", + "\n", + "for train_index, test_index in kf.split(X):\n", + " X_train, X_test = X[train_index], X[test_index] \n", + " y_train, y_test = Y[train_index], Y[test_index]\n", + " \n", + " from sklearn.tree import DecisionTreeClassifier\n", + "\n", + " tree = DecisionTreeClassifier(criterion = 'entropy', random_state = 10)\n", + " tree.fit(X_train, y_train)\n", + " pred = tree.predict(X_test)\n", + " tree_accuracy=accuracy_score(y_test, pred)\n", + "\n", + " accuracy.append(tree_accuracy)\n", + " print(accuracy_score(y_test, pred))\n", + "\n", + "acc=np.array(accuracy) \n", + "print(\"\\nMean: \",np.mean(acc))\n", + " " + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "HA_r_ylDlgIO" + }, + "source": [ + "## Naive Bayes" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "sBzShKLqlgIO", + "outputId": "9ac3b3c7-adee-44b6-8a57-23c103f1acac" + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "0.15\n", + "0.3\n", + "0.2\n", + "0.6\n", + "0.65\n", + "\n", + "Mean: 0.38\n" + ] + } + ], + "source": [ + "from sklearn.model_selection import KFold\n", + "import numpy as np\n", + "kf = KFold(n_splits=5, random_state=None) \n", + "# X is the feature set and y is the target\n", + "\n", + "accuracy =[]\n", + "\n", + "for train_index, test_index in kf.split(X):\n", + " X_train, X_test = X[train_index], X[test_index] \n", + " y_train, y_test = Y[train_index], Y[test_index]\n", + " \n", + " from sklearn.naive_bayes import GaussianNB\n", + " gnb = GaussianNB()\n", + " gnb.fit(X_train, y_train)\n", + " gnb_predict =gnb.predict(X_test)\n", + " gnb_accuracy=accuracy_score(y_test, gnb_predict)\n", + "\n", + " accuracy.append(gnb_accuracy)\n", + " print(accuracy_score(y_test, gnb_predict))\n", + "\n", + "acc=np.array(accuracy) \n", + "print(\"\\nMean: \",np.mean(acc))\n", + " " + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "bGJ5EDX0lgIO" + }, + "source": [ + "## Naive Bayes -Implementation" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "id": "nMfuw5ZPlgIP" + }, + "outputs": [], + "source": [ + "import math\n", + "import numpy as np\n", + "from sklearn.model_selection import train_test_split \n", + "\n", + "arr=data.values\n", + "X=arr[:,0:3]\n", + "Y=arr[:,3]\n", + "X_train, X_test, y_train, y_test = train_test_split(X, Y, test_size=0.20, random_state=1) \n", + "\n", + "class NaiveBayes():\n", + " \n", + " def fit(self, X, y):\n", + " self.X = X\n", + " self.y = y\n", + " self.classes = np.unique(y)\n", + " self.parameters = []\n", + " for i, c in enumerate(self.classes):\n", + " X_where_c = X[np.where(y == c)]\n", + " self.parameters.append([])\n", + " for col in X_where_c.T:\n", + " parameters = {\"mean\": col.mean(), \"var\": col.var()}\n", + " self.parameters[i].append(parameters)\n", + " \n", + " \n", + " def likelihood(self, mean, var, x):\n", + " m = 0.01\n", + " gaussian = (1.0 / math.sqrt(2.0 * math.pi * var + m))*(math.exp(-(math.pow(x - mean, 2) / (2 * var + m))))\n", + " return gaussian\n", + " \n", + " def prior(self, target):\n", + " return np.mean(self.y == target)\n", + " \n", + " def predict(self, X):\n", + " y_pred = []\n", + " for j in X:\n", + " posteriors = []\n", + " for i, c in enumerate(self.classes):\n", + " posterior = self.prior(c)\n", + " for feature_value, params in zip(j, self.parameters[i]):\n", + " likelihood = self.likelihood(params[\"mean\"], params[\"var\"], feature_value)\n", + " posterior *= likelihood\n", + " posteriors.append(posterior)\n", + " y_pred.append(self.classes[np.argmax(posteriors)])\n", + " return y_pred" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "m_8X-i4WlgIP", + "outputId": "4d779fe0-870f-4655-8681-51663f1d8cae" + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Accuracy: 0.3\n" + ] + } + ], + "source": [ + "model = NaiveBayes()\n", + "model.fit(X_train,y_train)\n", + "pred = model.predict(X_test)\n", + "\n", + "print(\"Accuracy: \",accuracy_score(y_test,pred))" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/", + "height": 350 + }, + "id": "08zIaDwzlgIQ", + "outputId": "360dee4e-b36d-4a72-a705-419f92d70c04" + }, + "outputs": [ + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAmcAAAFNCAYAAABFbcjcAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4yLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+WH4yJAAAgAElEQVR4nO3debglVXnv8e+PRmZU1I6RsVFxgKioLWpUNIoKUcGrGFGJkJAQjDiTiIkXEYegSZwiRtQgDhEQidxWMagoccChG0G0QbQZlCaozSQgyuR7/6h1oNic070benfX6f5+nmc/p2rVWlVv1a6993uqVlWlqpAkSdIwrLemA5AkSdJtTM4kSZIGxORMkiRpQE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84kSZIGxD5nkiRJA2JyJkmSNCAmZ5IkSQNiciZpnZCkknyyN75+kmXtzvMrM5+Ls4KHRY9TR5JmYnImaV3xG+CPkmzcxp/ObTe7lKTBMDmTtC45he7pGgAvoncj4HbX/pPbzSy/k+ThrfzeSb6UZHGSj9B7JFKSfZN8r91M8+h23zNJuktMziStS44H9kmyEfBw4Lu9aW8GzqqqhwP/AHy8lb8J+GZV7UT35I1tAZI8lO7Bz0+oqp3pnt+4TtyDSdJkeRNaSeuMqjonyTy6o2anjEx+It3D6Kmqr7YjZneneyDz81r5F5Jc1eo/je6BzwvbIzc3pnvItyTdJSZnktY1C4B/AZ4C3PsuzCfAx6rqDasiKEma4mlNSeuaY4A3V9UPR8q/QTstmeQpwOVVdQ3wdeDFrXwPYItW/zRg7yR/0KbdK8l2kw9f0trOI2eS1ilVtRR43zSTDgeOSXIOcD2wXyt/M3BcksXAGcDP23zOTfJG4EtJ1gNuAl5O9yxQSbrTfLamJEnSgHhaU5IkaUBMziRJkgbE5EySJGlATM4kSZIGxORMkiRpQEzOJEmSBsTkTJIkaUBMziRJkgbk/wPrgZouWzYM4gAAAABJRU5ErkJggg==", + "text/plain": [ + "
" + ] + }, + "metadata": { + "needs_background": "light" + }, + "output_type": "display_data" + } + ], + "source": [ + "model_name2=[\"KNN\",\"SVM\",\"Logistic Regression\",\"Decision Tree\",\"Naive Bayes\"]\n", + "acc_val=[0.32,0.40,0.42,0.21,0.38]\n", + "fig = plt.figure(figsize = (10, 5))\n", + "plt.bar(model_name2, acc_val)\n", + "plt.xlabel('Model')\n", + "plt.ylabel('Accuracy')\n", + "plt.title('Accuracies of different Models after validating the Data')\n", + "plt.show()\n" + ] + } + ], + "metadata": { + "colab": { + "name": "Project Source Code.ipynb", + "provenance": [] + }, + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.8.10" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/projects/Music-Playlist-Generator/Dataset/2010.csv b/projects/Music-Playlist-Generator/Dataset/2010.csv new file mode 100644 index 00000000..df8a67d5 --- /dev/null +++ b/projects/Music-Playlist-Generator/Dataset/2010.csv @@ -0,0 +1,101 @@ +Number,title,artist,top genre,year,bpm,nrgy,dnce,dB,live,val,dur,acous,spch,pop +1,bad guy,Billie Eilish,electropop,2019,135,43,70,-11,10,56,194,33,38,94 +2,7 rings,Ariana Grande,dance pop,2019,140,32,78,-11,9,33,179,59,33,90 +3,Old Town Road - Remix,Lil Nas X,country rap,2019,136,62,88,-6,11,64,157,5,10,89 +4,Señorita,Shawn Mendes,canadian pop,2019,117,55,76,-6,8,75,191,4,3,88 +5,rockstar (feat. 21 Savage),Post Malone,dfw rap,2018,160,52,59,-6,13,13,218,12,7,88 +6,SAD!,XXXTENTACION,emo rap,2018,75,61,74,-5,12,47,167,26,14,87 +7,Sunflower - Spider-Man: Into the Spider-Verse,Post Malone,dfw rap,2019,90,52,76,-4,7,93,158,53,6,86 +8,God's Plan,Drake,canadian hip hop,2018,77,45,75,-9,55,36,199,3,11,85 +9,One Kiss (with Dua Lipa),Calvin Harris,dance pop,2018,124,86,79,-3,8,59,215,4,11,85 +10,Thunder,Imagine Dragons,modern rock,2017,168,82,61,-5,15,29,187,1,4,85 +11,I Fall Apart,Post Malone,dfw rap,2016,144,54,56,-5,20,29,223,7,4,84 +12,HUMBLE.,Kendrick Lamar,conscious hip hop,2017,150,62,91,-7,10,42,177,0,10,84 +13,Starboy,The Weeknd,canadian contemporary r&b,2016,186,59,68,-7,14,49,230,14,28,84 +14,FRIENDS,Marshmello,brostep,2018,95,88,63,-2,13,53,203,21,5,83 +15,Psycho (feat. Ty Dolla $ign),Post Malone,dfw rap,2018,140,56,75,-8,11,46,221,55,11,83 +16,Congratulations,Post Malone,dfw rap,2016,123,80,63,-4,25,49,220,22,4,83 +17,In My Feelings,Drake,canadian hip hop,2018,91,63,84,-6,40,35,218,6,13,83 +18,The Hills,The Weeknd,canadian contemporary r&b,2015,113,56,58,-7,14,14,242,7,5,83 +19,no tears left to cry,Ariana Grande,dance pop,2018,122,71,70,-6,29,35,206,4,6,83 +20,Dancing On My Own,Calum Scott,pop,2018,113,17,68,-9,10,24,260,84,3,83 +21,New Rules,Dua Lipa,dance pop,2017,116,70,76,-6,15,61,209,0,7,83 +22,Treat You Better,Shawn Mendes,canadian pop,2017,83,82,44,-4,11,75,188,11,34,83 +23,Something Just Like This,The Chainsmokers,electropop,2017,103,64,62,-7,16,45,247,5,3,83 +24,Happier,Ed Sheeran,pop,2017,90,39,52,-7,14,24,208,54,3,82 +25,Attention,Charlie Puth,dance pop,2018,100,61,78,-5,13,80,209,11,5,82 +26,IDGAF,Dua Lipa,dance pop,2017,97,54,84,-6,8,51,218,4,9,82 +27,There's Nothing Holdin' Me Back,Shawn Mendes,canadian pop,2017,122,81,87,-4,8,97,199,38,6,82 +28,Scared to Be Lonely,Martin Garrix,big room,2017,138,54,58,-8,26,20,221,9,6,81 +29,Whatever It Takes,Imagine Dragons,modern rock,2017,135,66,67,-5,12,56,201,4,3,81 +30,Let Me Love You,DJ Snake,electronic trap,2016,100,72,65,-5,14,16,206,9,3,81 +31,i hate u i love u (feat. olivia o'brien),gnash,pop,2016,93,28,49,-13,10,18,251,69,30,81 +32,Silence,Marshmello,brostep,2017,142,76,52,-3,17,29,181,26,9,80 +33,The Nights,Avicii,big room,2014,126,84,53,-5,25,65,177,2,4,80 +34,Without You (feat. Sandro Cavazza),Avicii,big room,2017,134,86,66,-5,5,30,182,0,4,80 +35,In the Name of Love,Martin Garrix,big room,2016,134,52,50,-6,45,17,196,11,4,80 +36,Faded,Alan Walker,electro house,2018,180,63,47,-5,11,16,212,3,5,80 +37,Story of My Life,One Direction,boy band,2013,121,66,60,-6,12,29,245,23,5,80 +38,Solo (feat. Demi Lovato),Clean Bandit,dance pop,2018,105,64,74,-5,35,56,223,4,4,79 +39,Love Lies (with Normani),Khalid,alternative r&b,2018,144,65,71,-6,13,34,202,10,4,79 +40,Little Do You Know,Alex & Sierra,neo mellow,2014,146,29,50,-9,19,37,185,75,3,79 +41,Mercy,Shawn Mendes,canadian pop,2017,148,66,56,-5,11,36,209,13,8,79 +42,Exchange,Bryson Tiller,pop,2015,160,43,53,-11,14,27,195,11,19,79 +43,One Last Time,Ariana Grande,dance pop,2014,125,59,63,-5,10,10,197,9,3,79 +44,DJ Got Us Fallin' In Love (feat. Pitbull),Usher,atl hip hop,2010,120,86,66,-3,8,65,221,3,11,78 +45,Give Me Everything,Pitbull,dance pop,2011,129,94,67,-3,30,53,252,19,16,78 +46,Waiting For Love,Avicii,big room,2015,128,74,58,-4,20,61,231,31,5,78 +47,Stay,Zedd,complextro,2017,102,62,69,-5,12,54,210,25,6,78 +48,It Ain't Me (with Selena Gomez),Kygo,edm,2017,100,53,64,-7,9,52,221,12,7,78 +49,Hall of Fame,The Script,celtic rock,2012,85,87,42,-4,12,63,203,7,6,78 +50,Payphone,Maroon 5,pop,2012,110,75,74,-5,29,55,231,2,4,78 +51,PILLOWTALK,ZAYN,dance pop,2016,125,70,58,-4,9,44,203,12,5,78 +52,All I Want,Kodaline,irish pop,2013,86,41,21,-10,8,16,306,17,4,78 +53,Youngblood,5 Seconds of Summer,boy band,2018,120,85,60,-5,12,15,203,2,46,77 +54,Symphony (feat. Zara Larsson),Clean Bandit,dance pop,2017,123,63,71,-5,14,46,212,26,6,77 +55,Unsteady,X Ambassadors,indie poptimism,2015,117,67,39,-6,12,20,194,18,6,77 +56,Classic,MKTO,dance pop,2012,102,79,72,-5,16,76,175,4,12,77 +57,Time of Our Lives,Pitbull,dance pop,2014,124,80,72,-6,69,72,229,9,6,77 +58,Please Don't Go,Joel Adams,australian pop,2015,84,77,51,-5,29,24,211,1,6,76 +59,When You Love Someone,James TW,neo mellow,2019,126,45,68,-6,5,35,217,26,3,76 +60,I Dont Wanna Live Forever (Fifty Shades Darker),ZAYN,dance pop,2016,118,45,74,-8,33,9,245,6,6,76 +61,Perfect Strangers,Jonas Blue,dance pop,2018,118,86,73,-4,21,70,197,39,5,76 +62,Friends (with BloodPop®),Justin Bieber,canadian pop,2017,105,73,74,-5,30,62,189,0,4,75 +63,September Song,JP Cooper,dance pop,2017,96,62,61,-7,9,37,220,5,4,75 +64,Never Forget You,Zara Larsson,dance pop,2017,146,73,58,-6,27,28,213,0,5,75 +65,Say You Won't Let Go,James Arthur,pop,2016,99,56,40,-7,9,48,211,69,5,75 +66,Airplanes (feat. Hayley Williams),B.o.B,atl hip hop,2010,93,87,66,-4,4,38,180,11,12,75 +67,Whistle,Flo Rida,dance pop,2012,104,94,75,-6,29,74,225,2,5,75 +68,Do It Again,Pia Mia,dance pop,2015,96,56,71,-7,9,41,208,3,5,74 +69,Paris,The Chainsmokers,electropop,2017,100,64,65,-7,9,25,222,2,3,74 +70,All My Friends (feat. Tinashe & Chance the Rapper),Snakehips,dance pop,2015,95,52,69,-6,11,18,230,12,13,74 +71,Slide (feat. Frank Ocean & Migos),Calvin Harris,dance pop,2017,104,80,74,-3,25,51,231,50,5,74 +72,No Promises (feat. Demi Lovato),Cheat Codes,dance pop,2017,113,67,74,-5,11,60,224,6,13,73 +73,The Ocean (feat. Shy Martin),Mike Perry,big room,2016,90,57,63,-6,10,19,183,2,3,73 +74,Capsize,FRENSHIP,electropop,2016,93,71,68,-6,69,36,238,4,3,72 +75,As Long As You Love Me,Justin Bieber,canadian pop,2012,140,87,57,-3,36,61,229,8,10,72 +76,Pretty Girl - Cheat Codes X CADE Remix,Maggie Lindemann,dance pop,2017,121,87,70,-5,10,73,194,15,3,71 +77,2U (feat. Justin Bieber),David Guetta,dance pop,2017,145,65,55,-6,23,56,195,22,6,71 +78,Strip That Down (feat. Quavo),Liam Payne,dance pop,2019,106,50,87,-5,8,55,202,20,5,71 +79,Wildest Dreams,Taylor Swift,dance pop,2014,140,66,55,-7,11,47,220,7,7,71 +80,Sun Is Shining,Axwell /\ Ingrosso,big room,2017,132,76,47,-3,7,38,255,9,5,71 +81,Solo Dance,Martin Jensen,big room,2016,115,85,75,-2,20,40,175,5,5,70 +82,Alone,Alan Walker,electro house,2016,97,93,68,-3,12,16,161,19,5,70 +83,You Don't Know Me (feat. RAYE),Jax Jones,dance pop,2019,124,67,88,-6,32,67,213,16,14,70 +84,Can't Hold Us (feat. Ray Dalton),Macklemore & Ryan Lewis,dance pop,2012,146,93,63,-4,10,88,258,3,8,70 +85,Hurts So Good,Astrid S,dance pop,2016,120,63,67,-5,9,42,209,8,5,69 +86,Five More Hours - Deorro x Chris Brown,Deorro,big room,2017,128,88,70,-3,82,50,212,3,22,69 +87,She Looks So Perfect,5 Seconds of Summer,boy band,2014,160,95,49,-4,33,44,202,0,13,69 +88,Where Them Girls At (feat. Nicki Minaj & Flo Rida),David Guetta,dance pop,2012,130,88,67,-3,26,55,195,6,4,69 +89,Mama,Jonas Blue,dance pop,2017,104,79,74,-4,5,54,184,10,4,68 +90,Don't Leave,Snakehips,dance pop,2017,122,70,66,-3,26,34,215,22,8,68 +91,Drag Me Down,One Direction,boy band,2015,138,71,72,-6,5,61,192,10,4,68 +92,The One That Got Away,Katy Perry,dance pop,2010,134,80,69,-4,16,88,227,0,4,66 +93,Shed a Light,Robin Schulz,dance pop,2016,122,79,48,-5,26,58,191,11,10,65 +94,Sex,Cheat Codes,dance pop,2016,105,69,60,-6,13,19,228,0,16,60 +95,Call on Me - Ryan Riback Remix,Starley,aussietronica,2016,105,84,67,-4,16,72,222,6,4,58 +96,Stereo Hearts (feat. Adam Levine),Gym Class Heroes,dance pop,2011,90,80,65,-3,27,80,211,3,10,56 +97,Dynamite,Taio Cruz,dance pop,2011,120,79,76,-4,3,87,203,0,8,56 +98,Break Your Heart,Taio Cruz,dance pop,2011,122,89,67,-5,24,68,185,0,3,54 +99,Summer Air,ItaloBrothers,dance pop,2017,102,75,76,-4,8,49,184,6,7,43 +100,All I Wanna Do,Martin Jensen,big room,2016,112,79,73,-4,7,56,194,16,7,32 diff --git a/projects/Music-Playlist-Generator/Dataset/modifiedDataset.csv b/projects/Music-Playlist-Generator/Dataset/modifiedDataset.csv new file mode 100644 index 00000000..34187c55 --- /dev/null +++ b/projects/Music-Playlist-Generator/Dataset/modifiedDataset.csv @@ -0,0 +1,101 @@ +,PC1,PC2,PC3,top genre +0,3.616141838045304,-2.822902972645361,2.3046064757805396,19 +1,4.398339183889341,-3.324495085318442,1.6314855591062267,14 +2,-0.31381016014387075,-2.883386951956723,1.2361020234572946,13 +3,-0.04805804919248927,-1.7030371761078738,-0.18861530244231067,9 +4,1.8426141778162948,0.768540513335906,1.373641268000399,15 +5,0.3354360762689297,-2.1964955534717636,-0.7287243560128691,20 +6,-0.10844681638192365,-3.5607127660891615,-1.6718318530136795,15 +7,1.384018372829489,-0.22243912194648374,0.189274260293463,8 +8,-1.361266658719117,-0.8586243737121053,0.6332565906721997,14 +9,-0.30833992281308775,0.36694267129291636,1.9764003972730655,23 +10,0.9459908918646543,1.1352403817281576,0.7240162792800067,15 +11,0.1717232699825516,-2.0153915827113065,1.5548360044992655,12 +12,1.603598523863566,-0.535783759119436,3.1775186955546513,7 +13,-1.3833729667488857,-0.19362247482294223,-0.7517968054317717,6 +14,2.1658866334186797,-1.2935935809782984,0.02231034742063663,15 +15,-0.4525948762862116,0.45885841510239533,0.12301362603361515,15 +16,0.20828123844517998,-0.321659121221222,0.31341814813444424,8 +17,1.726893294162431,1.4636828795013779,-0.27121246972196295,7 +18,0.03756431820346574,0.23815653187792846,0.7160461980028658,14 +19,4.81310893692669,-0.32636609319734133,-2.333023542979218,25 +20,-0.3983228687822834,-0.7465782183687973,0.215907184321655,14 +21,-0.4330248639861649,-0.9607586797821716,0.7845635099173909,9 +22,0.8034630877850764,0.9810980230641051,-0.6968579193301684,19 +23,2.7519925253113597,0.0343795527398503,-1.9387956435376321,25 +24,-0.5921633918047158,-1.3882358222176752,-0.8462309965919257,14 +25,0.3328651189792074,-1.1624240139278637,-0.6424629819429225,14 +26,-1.3749754178198639,-2.6290627159587423,-0.5253973560560643,9 +27,1.7414265445606236,1.1577324346694693,0.7900100675667068,4 +28,-0.3767897877553316,-0.3032676170083006,0.3233417260662118,23 +29,0.1779089224108922,0.5586227650076552,-0.5245365205798607,18 +30,5.994378006718067,-0.1773712678126203,-0.775181600209338,25 +31,-0.18158343016685016,0.24771170154971506,0.9092363684571311,6 +32,-1.241791679301437,0.0845715835086434,0.6951477957191913,4 +33,-0.7595723520191142,-0.12764370482158102,0.6892975812378297,4 +34,1.0896728057475913,1.5440782887467932,1.0014362430686556,4 +35,0.8719185622952274,1.6589693369949774,1.7983437574087526,17 +36,1.1173011539096769,1.0806485426684191,-0.44863885932884184,5 +37,-0.5466006448360059,0.24307603887656265,-0.19342326052881462,14 +38,0.3032532220801342,-0.13245019468392738,0.6153331092700077,0 +39,3.6141983889102125,-0.7344511064987999,-0.6347482487043495,24 +40,0.43485421596572166,0.5264698797753606,0.8115675209155487,9 +41,3.027010429792177,-0.05317491117923558,1.9444083243502117,25 +42,0.6773089425537545,0.4978041144926755,-0.0030959328407856148,14 +43,-1.4889081552142442,-0.05963361059640142,0.2313588408245621,1 +44,-1.0704420673505322,0.9337044551357857,0.9790498238295121,14 +45,-0.23056976550152752,0.5251790215417026,-0.28531409288294873,4 +46,0.12308973702744956,-0.6156360203120319,-0.9975575753729204,11 +47,0.9142517343117152,-0.14816094719323653,-0.9593541773531465,16 +48,-1.1112218416394841,0.7850836436024602,-0.9669303836061297,10 +49,-0.8490404010480093,0.45873035433478365,-0.10337617719101565,25 +50,-0.31284465218550905,0.24893982706946136,-0.08507852583841145,14 +51,4.002535114615317,4.134907871352277,-2.133585443182263,22 +52,0.5203219040906611,-0.2765230222691595,2.8679573973897527,5 +53,0.2171846551775288,-0.4067478615429422,-0.3479319774863016,14 +54,1.0012848489504949,1.2510972764309856,-0.1732764847337349,21 +55,-1.4531441729143797,-1.5504548242985434,0.09169933989967081,14 +56,-1.1587379824445627,0.9346532936488997,1.1724901007226287,14 +57,-0.27832466321205995,1.6306566185871878,-0.5235013873935199,3 +58,1.3074052347783602,-0.190711868925238,-0.8369782895885123,24 +59,1.8128517738452667,1.3092356135598096,0.07819647014002977,14 +60,-1.2036347146087105,-1.058474394054308,-0.44747028250046955,14 +61,-1.37335836517878,-0.4784865209648402,-0.08826145780593811,9 +62,0.5959395164877943,0.5737742986998753,-1.0706127195397233,14 +63,0.008792255841608018,1.3958798429920867,1.1251147887197581,14 +64,2.148347814443103,0.15342824666161753,-2.101875366793808,25 +65,-1.0654621281368815,-0.6976684862717359,-0.4139106083486258,1 +66,-1.687111282711874,0.07240958504881678,-0.1407807749410561,14 +67,0.42526585038676057,-0.2521265955108028,-1.0047166104447276,14 +68,0.5752316821108683,0.7740570023687839,-0.926420372718982,19 +69,1.2048786427119784,0.3970014226680162,-0.7309886132541132,14 +70,-0.6289218452346479,-0.10857816593415547,-1.2207517387424998,14 +71,-0.4866076502002463,-0.433985077688012,-0.14490001198443295,14 +72,0.327803945057724,0.13827722144055662,-1.0603841083241998,4 +73,-0.5336916114585291,2.1133034338880448,0.014877647904208114,19 +74,-1.5674832265399339,1.3525134086017292,1.0716335532173544,9 +75,-1.601007262552469,-0.7498362838342726,-0.4469185176430769,14 +76,0.05289678848487639,0.22619791599679737,0.4536886648811551,14 +77,-0.17494077912236392,-1.549074549330579,-1.2343115024149787,14 +78,0.4245265956687523,0.83036497671433,0.28028280603036465,14 +79,-0.38904050042327615,2.255885583915747,-0.34963029101788135,4 +80,-2.2536088535449945,-0.40255491213954375,0.06284458381193045,4 +81,-1.548574389833448,-0.3215953166342841,-0.5881523608043706,17 +82,-0.6787899450080211,-1.1294504054104102,0.5082931074506135,14 +83,-1.838150721329998,0.8644301565339065,0.3530802821449976,14 +84,-0.2995358270285516,0.1630367600554869,-0.5232428218999995,14 +85,-2.0730542525949733,1.2896618686092463,2.6659914012324113,4 +86,-1.4946330954337583,1.5775557854719515,2.1611997636527716,5 +87,-2.124871769455353,0.3220646946616079,0.3745187835085153,14 +88,-1.594837999621373,-0.8679438298756731,-0.9538389608711192,14 +89,-0.6766277626862692,0.6887161601033823,-0.1324322561457294,14 +90,-0.776607802109245,-0.7685734762936685,-0.08903431730917737,5 +91,-2.0927187181297495,0.17331812439406982,-0.13739031819653583,14 +92,-1.0263844606902799,0.7555540895190651,0.23370664106358824,14 +93,0.09544875386899473,1.371847535658841,-0.264541368396444,14 +94,-2.186477550060975,0.5106203783761935,-1.1990388054530512,2 +95,-2.613147659154937,0.3187714934311677,-1.0644586719961082,14 +96,-2.5294787315789424,-0.8566124426286618,-0.756540352241294,14 +97,-2.605953624112448,0.22238952076972482,-0.2940542489493141,14 +98,-2.3448256212267604,-0.28870292625224764,-1.5019222281845146,14 +99,-2.6417197925600915,0.08562926674162673,-1.8064652074282006,4 diff --git a/projects/Music-Playlist-Generator/README.md b/projects/Music-Playlist-Generator/README.md new file mode 100644 index 00000000..ccfab6c9 --- /dev/null +++ b/projects/Music-Playlist-Generator/README.md @@ -0,0 +1,23 @@ +# Music-Playlist-Generator +A machine learning model to sort and create playlist classified based on different genres made by analyzing various mood factors like danceability, loudness etc in a song. + + +In this repository, you will be able see: +``` +├── Dataset +| └── 2010.csv (Orginal Dataset) +| └── modifiedDataset.csv (Modified Dataset) +| +├── Project Documentation +├── Project Source Code (ipynb notebook) + +``` +## Dataset +Source : [Kaggle](https://www.kaggle.com/cnic92/spotify-past-decades-songs-50s10s?select=2010.csv) + +The datasets used in the project are the data derived from the spotify API derived from various +sources like Kaggle. The datasets contain details about various moods that a song possesses +based on which the songs are classified to different Genres. It contains details about the top 100 songs in 2010-2019 + + +