{"cells":[{"cell_type":"markdown","metadata":{"id":"TQizDt2SfcCg"},"source":["# Dataset preparation"]},{"cell_type":"markdown","metadata":{"id":"FnULoHlkfcCg"},"source":["## Dataset import"]},{"cell_type":"code","execution_count":1,"metadata":{"ExecuteTime":{"end_time":"2021-05-24T08:51:52.684020Z","start_time":"2021-05-24T08:51:50.367249Z"},"scrolled":true,"id":"VqwVyAA3fcCg","executionInfo":{"status":"ok","timestamp":1747743743769,"user_tz":-120,"elapsed":8885,"user":{"displayName":"Grégoire","userId":"01249298206117462766"}}},"outputs":[],"source":["import time,datetime\n","start_time = time.time()\n","\n","import pandas as pd\n","import numpy as np\n","import matplotlib.pyplot as plt\n","import seaborn as sns\n","import plotly.express as px\n","\n","from tqdm.notebook import tqdm_notebook, tnrange\n","from tqdm.contrib import tenumerate\n","\n","import joblib\n","\n","%matplotlib inline\n","from os import listdir"]},{"cell_type":"code","source":["from google.colab import drive\n","drive.mount('/content/drive')\n","import os\n","path = \"/content/drive/MyDrive/Colab_Notebooks/Project_6/Flipkart/Images/\"\n","os.chdir(path)"],"metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"Ntb8-hDaP4JV","executionInfo":{"status":"ok","timestamp":1747743778185,"user_tz":-120,"elapsed":34418,"user":{"displayName":"Grégoire","userId":"01249298206117462766"}},"outputId":"af8e8b92-2d10-4113-be3d-1cd9bf5575ae"},"execution_count":2,"outputs":[{"output_type":"stream","name":"stdout","text":["Mounted at /content/drive\n"]}]},{"cell_type":"code","source":["list_photos = [file for file in listdir(path)]\n","print(len(list_photos))"],"metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"NN9qimB8jUZW","executionInfo":{"status":"ok","timestamp":1747743781424,"user_tz":-120,"elapsed":3238,"user":{"displayName":"Grégoire","userId":"01249298206117462766"}},"outputId":"f575524c-118f-43b1-c2e8-b7df825e798f"},"execution_count":3,"outputs":[{"output_type":"stream","name":"stdout","text":["1066\n"]}]},{"cell_type":"code","execution_count":4,"metadata":{"ExecuteTime":{"end_time":"2021-05-24T08:51:52.739988Z","start_time":"2021-05-24T08:51:52.686019Z"},"id":"GD-FeMY4fcCh","executionInfo":{"status":"ok","timestamp":1747743781826,"user_tz":-120,"elapsed":402,"user":{"displayName":"Grégoire","userId":"01249298206117462766"}}},"outputs":[],"source":["Flipkart = pd.read_csv('../flipkart_com-ecommerce_sample_1050.csv',encoding='iso-8859-1')\n","Flipkart.head(5)\n","\n","dataset=Flipkart[['product_category_tree','image']].copy()"]},{"cell_type":"code","execution_count":5,"metadata":{"ExecuteTime":{"end_time":"2021-05-24T08:51:52.748003Z","start_time":"2021-05-24T08:51:52.741987Z"},"id":"KQnfD0jyfcCh","executionInfo":{"status":"ok","timestamp":1747743781834,"user_tz":-120,"elapsed":7,"user":{"displayName":"Grégoire","userId":"01249298206117462766"}}},"outputs":[],"source":["# Renommage des catégories (legendes des matrices de confusion trop longues)\n","shorten={'Watches ':'Watches',\n"," 'Computers ':'Computers',\n"," 'Home Decor & Festive Needs ':'Decor',\n"," 'Kitchen & Dining ':'Kitchen',\n"," 'Home Furnishing ':'Furniture',\n"," 'Beauty and Personal Care ':'Beauty',\n"," 'Baby Care ':'Baby'}"]},{"cell_type":"code","execution_count":6,"metadata":{"ExecuteTime":{"end_time":"2021-05-24T08:51:52.795956Z","start_time":"2021-05-24T08:51:52.749984Z"},"colab":{"base_uri":"https://localhost:8080/","height":269},"id":"RquPdRpYfcCh","executionInfo":{"status":"ok","timestamp":1747743781905,"user_tz":-120,"elapsed":60,"user":{"displayName":"Grégoire","userId":"01249298206117462766"}},"outputId":"d0965e4f-4b9d-4fb8-fa85-e625afd0f04c"},"outputs":[{"output_type":"execute_result","data":{"text/plain":[" category count\n","0 Furniture 150\n","1 Baby 150\n","2 Watches 150\n","3 Decor 150\n","4 Kitchen 150\n","5 Beauty 150\n","6 Computers 150"],"text/html":["\n","
| \n"," | category | \n","count | \n","
|---|---|---|
| 0 | \n","Furniture | \n","150 | \n","
| 1 | \n","Baby | \n","150 | \n","
| 2 | \n","Watches | \n","150 | \n","
| 3 | \n","Decor | \n","150 | \n","
| 4 | \n","Kitchen | \n","150 | \n","
| 5 | \n","Beauty | \n","150 | \n","
| 6 | \n","Computers | \n","150 | \n","
| \n"," | count | \n","
|---|---|
| category | \n","\n"," |
| Furniture | \n","150 | \n","
| Baby | \n","150 | \n","
| Watches | \n","150 | \n","
| Decor | \n","150 | \n","
| Kitchen | \n","150 | \n","
| Beauty | \n","150 | \n","
| Computers | \n","150 | \n","
| \n"," | count | \n","
|---|---|
| cat_code | \n","\n"," |
| 0 | \n","150 | \n","
| 1 | \n","150 | \n","
| 2 | \n","150 | \n","
| 3 | \n","150 | \n","
| 4 | \n","150 | \n","
| 5 | \n","150 | \n","
| 6 | \n","150 | \n","
| \n"," | category | \n","cat_code | \n","image | \n","
|---|---|---|---|
| 0 | \n","Furniture | \n","0 | \n","55b85ea15a1536d46b7190ad6fff8ce7.jpg | \n","
| 1 | \n","Baby | \n","1 | \n","7b72c92c2f6c40268628ec5f14c6d590.jpg | \n","
| \n"," | category | \n","image | \n","
|---|---|---|
| cat_code | \n","\n"," | \n"," |
| 0 | \n","150 | \n","150 | \n","
| 1 | \n","150 | \n","150 | \n","
| 2 | \n","150 | \n","150 | \n","
| 3 | \n","150 | \n","150 | \n","
| 4 | \n","150 | \n","150 | \n","
| 5 | \n","150 | \n","150 | \n","
| 6 | \n","150 | \n","150 | \n","
| \n"," | cluster | \n","effectives | \n","
|---|---|---|
| Category | \n","\n"," | \n"," |
| Furniture | \n","3 | \n","31 | \n","
| Baby | \n","0 | \n","3 | \n","
| Watches | \n","4 | \n","1 | \n","
| Decor | \n","5 | \n","593 | \n","
| Kitchen | \n","1 | \n","390 | \n","
| Beauty | \n","6 | \n","5 | \n","
| Computers | \n","2 | \n","27 | \n","
scipy.sparse._csr.csr_matrix
def __init__(arg1, shape=None, dtype=None, copy=False, *, maxprint=None)
Compressed Sparse Row matrix.\n","\n","This can be instantiated in several ways:\n"," csr_matrix(D)\n"," where D is a 2-D ndarray\n","\n"," csr_matrix(S)\n"," with another sparse array or matrix S (equivalent to S.tocsr())\n","\n"," csr_matrix((M, N), [dtype])\n"," to construct an empty matrix with shape (M, N)\n"," dtype is optional, defaulting to dtype='d'.\n","\n"," csr_matrix((data, (row_ind, col_ind)), [shape=(M, N)])\n"," where ``data``, ``row_ind`` and ``col_ind`` satisfy the\n"," relationship ``a[row_ind[k], col_ind[k]] = data[k]``.\n","\n"," csr_matrix((data, indices, indptr), [shape=(M, N)])\n"," is the standard CSR representation where the column indices for\n"," row i are stored in ``indices[indptr[i]:indptr[i+1]]`` and their\n"," corresponding values are stored in ``data[indptr[i]:indptr[i+1]]``.\n"," If the shape parameter is not supplied, the matrix dimensions\n"," are inferred from the index arrays.\n","\n","Attributes\n","----------\n","dtype : dtype\n"," Data type of the matrix\n","shape : 2-tuple\n"," Shape of the matrix\n","ndim : int\n"," Number of dimensions (this is always 2)\n","nnz\n","size\n","data\n"," CSR format data array of the matrix\n","indices\n"," CSR format index array of the matrix\n","indptr\n"," CSR format index pointer array of the matrix\n","has_sorted_indices\n","has_canonical_format\n","T\n","\n","Notes\n","-----\n","\n","Sparse matrices can be used in arithmetic operations: they support\n","addition, subtraction, multiplication, division, and matrix power.\n","\n","Advantages of the CSR format\n"," - efficient arithmetic operations CSR + CSR, CSR * CSR, etc.\n"," - efficient row slicing\n"," - fast matrix vector products\n","\n","Disadvantages of the CSR format\n"," - slow column slicing operations (consider CSC)\n"," - changes to the sparsity structure are expensive (consider LIL or DOK)\n","\n","Canonical Format\n"," - Within each row, indices are sorted by column.\n"," - There are no duplicate entries.\n","\n","Examples\n","--------\n","\n",">>> import numpy as np\n",">>> from scipy.sparse import csr_matrix\n",">>> csr_matrix((3, 4), dtype=np.int8).toarray()\n","array([[0, 0, 0, 0],\n"," [0, 0, 0, 0],\n"," [0, 0, 0, 0]], dtype=int8)\n","\n",">>> row = np.array([0, 0, 1, 2, 2, 2])\n",">>> col = np.array([0, 2, 2, 0, 1, 2])\n",">>> data = np.array([1, 2, 3, 4, 5, 6])\n",">>> csr_matrix((data, (row, col)), shape=(3, 3)).toarray()\n","array([[1, 0, 2],\n"," [0, 0, 3],\n"," [4, 5, 6]])\n","\n",">>> indptr = np.array([0, 2, 3, 6])\n",">>> indices = np.array([0, 2, 2, 0, 1, 2])\n",">>> data = np.array([1, 2, 3, 4, 5, 6])\n",">>> csr_matrix((data, indices, indptr), shape=(3, 3)).toarray()\n","array([[1, 0, 2],\n"," [0, 0, 3],\n"," [4, 5, 6]])\n","\n","Duplicate entries are summed together:\n","\n",">>> row = np.array([0, 1, 2, 0])\n",">>> col = np.array([0, 1, 1, 0])\n",">>> data = np.array([1, 2, 4, 8])\n",">>> csr_matrix((data, (row, col)), shape=(3, 3)).toarray()\n","array([[9, 0, 0],\n"," [0, 2, 0],\n"," [0, 4, 0]])\n","\n","As an example of how to construct a CSR matrix incrementally,\n","the following snippet builds a term-document matrix from texts:\n","\n",">>> docs = [["hello", "world", "hello"], ["goodbye", "cruel", "world"]]\n",">>> indptr = [0]\n",">>> indices = []\n",">>> data = []\n",">>> vocabulary = {}\n",">>> for d in docs:\n","... for term in d:\n","... index = vocabulary.setdefault(term, len(vocabulary))\n","... indices.append(index)\n","... data.append(1)\n","... indptr.append(len(indices))\n","...\n",">>> csr_matrix((data, indices, indptr), dtype=int).toarray()\n","array([[2, 1, 0, 0],\n"," [0, 1, 1, 1]])\n"," \n","
| \n"," | T0 | \n","T1 | \n","T2 | \n","T3 | \n","T4 | \n","T5 | \n","T6 | \n","T7 | \n","T8 | \n","T9 | \n","... | \n","T1513 | \n","T1514 | \n","T1515 | \n","T1516 | \n","T1517 | \n","T1518 | \n","T1519 | \n","T1520 | \n","T1521 | \n","T1522 | \n","
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | \n","0.009255 | \n","0.000000 | \n","0.008999 | \n","0.000000 | \n","0.031329 | \n","0.026206 | \n","0.008216 | \n","0.004788 | \n","0.004553 | \n","0.008961 | \n","... | \n","0.000000 | \n","0.008644 | \n","0.005458 | \n","0.003937 | \n","0.000000 | \n","0.008885 | \n","0.016233 | \n","0.000000 | \n","0.004490 | \n","0.012439 | \n","
| 1 | \n","0.009825 | \n","0.027270 | \n","0.105082 | \n","0.024663 | \n","0.000000 | \n","0.000000 | \n","0.008722 | \n","0.050830 | \n","0.019333 | \n","0.009512 | \n","... | \n","0.000000 | \n","0.045880 | \n","0.034762 | \n","0.000000 | \n","0.020514 | \n","0.018863 | \n","0.000000 | \n","0.000000 | \n","0.019065 | \n","0.000000 | \n","
| 2 | \n","0.041272 | \n","0.000000 | \n","0.000000 | \n","0.069068 | \n","0.039915 | \n","0.000000 | \n","0.012213 | \n","0.000000 | \n","0.040607 | \n","0.119874 | \n","... | \n","0.000000 | \n","0.000000 | \n","0.000000 | \n","0.005852 | \n","0.000000 | \n","0.000000 | \n","0.018096 | \n","0.000000 | \n","0.006674 | \n","0.000000 | \n","
| 3 | \n","0.006530 | \n","0.018125 | \n","0.012699 | \n","0.000000 | \n","0.031578 | \n","0.006163 | \n","0.017391 | \n","0.060812 | \n","0.019275 | \n","0.000000 | \n","... | \n","0.006418 | \n","0.036593 | \n","0.007702 | \n","0.005555 | \n","0.006818 | \n","0.006269 | \n","0.000000 | \n","0.000000 | \n","0.012672 | \n","0.046807 | \n","
| 4 | \n","0.010072 | \n","0.000000 | \n","0.019586 | \n","0.012641 | \n","0.009741 | \n","0.019012 | \n","0.008941 | \n","0.000000 | \n","0.009910 | \n","0.009751 | \n","... | \n","0.029697 | \n","0.037627 | \n","0.011879 | \n","0.008568 | \n","0.000000 | \n","0.000000 | \n","0.017665 | \n","0.009397 | \n","0.000000 | \n","0.009024 | \n","
| ... | \n","... | \n","... | \n","... | \n","... | \n","... | \n","... | \n","... | \n","... | \n","... | \n","... | \n","... | \n","... | \n","... | \n","... | \n","... | \n","... | \n","... | \n","... | \n","... | \n","... | \n","... | \n","
| 1045 | \n","0.022273 | \n","0.061821 | \n","0.010828 | \n","0.000000 | \n","0.000000 | \n","0.052554 | \n","0.009886 | \n","0.011523 | \n","0.000000 | \n","0.043128 | \n","... | \n","0.010945 | \n","0.000000 | \n","0.000000 | \n","0.018948 | \n","0.000000 | \n","0.032071 | \n","0.019532 | \n","0.010390 | \n","0.000000 | \n","0.019956 | \n","
| 1046 | \n","0.000000 | \n","0.000000 | \n","0.022621 | \n","0.000000 | \n","0.000000 | \n","0.021958 | \n","0.000000 | \n","0.000000 | \n","0.022890 | \n","0.000000 | \n","... | \n","0.000000 | \n","0.000000 | \n","0.000000 | \n","0.000000 | \n","0.000000 | \n","0.022334 | \n","0.020402 | \n","0.000000 | \n","0.000000 | \n","0.020845 | \n","
| 1047 | \n","0.000000 | \n","0.038788 | \n","0.024458 | \n","0.000000 | \n","0.016218 | \n","0.007914 | \n","0.014887 | \n","0.000000 | \n","0.008250 | \n","0.024353 | \n","... | \n","0.008241 | \n","0.015662 | \n","0.000000 | \n","0.014266 | \n","0.026261 | \n","0.032195 | \n","0.000000 | \n","0.023468 | \n","0.000000 | \n","0.000000 | \n","
| 1048 | \n","0.000000 | \n","0.020467 | \n","0.000000 | \n","0.000000 | \n","0.000000 | \n","0.000000 | \n","0.000000 | \n","0.022890 | \n","0.000000 | \n","0.000000 | \n","... | \n","0.043483 | \n","0.082641 | \n","0.000000 | \n","0.094094 | \n","0.000000 | \n","0.000000 | \n","0.096995 | \n","0.020639 | \n","0.021463 | \n","0.019820 | \n","
| 1049 | \n","0.000000 | \n","0.000000 | \n","0.000000 | \n","0.015652 | \n","0.000000 | \n","0.011770 | \n","0.000000 | \n","0.012904 | \n","0.000000 | \n","0.024147 | \n","... | \n","0.000000 | \n","0.000000 | \n","0.014708 | \n","0.000000 | \n","0.000000 | \n","0.011971 | \n","0.000000 | \n","0.011635 | \n","0.000000 | \n","0.000000 | \n","
1050 rows × 1523 columns
\n","| \n"," | 458 | \n","
|---|---|
| T0 | \n","0.000000 | \n","
| T1 | \n","0.000000 | \n","
| T2 | \n","0.000000 | \n","
| T3 | \n","0.000000 | \n","
| T4 | \n","0.017128 | \n","
| ... | \n","... | \n","
| T1518 | \n","0.025502 | \n","
| T1519 | \n","0.007765 | \n","
| T1520 | \n","0.000000 | \n","
| T1521 | \n","0.025775 | \n","
| T1522 | \n","0.039670 | \n","
1523 rows × 1 columns
\n","| \n"," | cluster | \n","effectives | \n","
|---|---|---|
| Category | \n","\n"," | \n"," |
| Furniture | \n","1 | \n","132 | \n","
| Baby | \n","5 | \n","50 | \n","
| Watches | \n","0 | \n","230 | \n","
| Decor | \n","6 | \n","251 | \n","
| Kitchen | \n","3 | \n","205 | \n","
| Beauty | \n","4 | \n","127 | \n","
| Computers | \n","2 | \n","55 | \n","
| \n"," | cluster | \n","effectives | \n","
|---|---|---|
| Category | \n","\n"," | \n"," |
| Furniture | \n","6 | \n","17 | \n","
| Baby | \n","1 | \n","1 | \n","
| Watches | \n","4 | \n","279 | \n","
| Decor | \n","0 | \n","225 | \n","
| Kitchen | \n","3 | \n","1 | \n","
| Beauty | \n","5 | \n","425 | \n","
| Computers | \n","2 | \n","102 | \n","
| \n"," | cluster | \n","effectives | \n","
|---|---|---|
| Category | \n","\n"," | \n"," |
| Furniture | \n","1 | \n","12 | \n","
| Baby | \n","6 | \n","15 | \n","
| Watches | \n","3 | \n","2 | \n","
| Decor | \n","0 | \n","612 | \n","
| Kitchen | \n","2 | \n","338 | \n","
| Beauty | \n","4 | \n","2 | \n","
| Computers | \n","5 | \n","69 | \n","
| \n"," | cluster | \n","effectives | \n","
|---|---|---|
| Category | \n","\n"," | \n"," |
| Furniture | \n","0 | \n","153 | \n","
| Baby | \n","5 | \n","228 | \n","
| Watches | \n","1 | \n","119 | \n","
| Decor | \n","3 | \n","149 | \n","
| Kitchen | \n","2 | \n","72 | \n","
| Beauty | \n","6 | \n","134 | \n","
| Computers | \n","4 | \n","195 | \n","
| \n"," | cluster | \n","effectives | \n","
|---|---|---|
| Category | \n","\n"," | \n"," |
| Furniture | \n","6 | \n","4 | \n","
| Baby | \n","4 | \n","44 | \n","
| Watches | \n","3 | \n","285 | \n","
| Decor | \n","0 | \n","245 | \n","
| Kitchen | \n","1 | \n","1 | \n","
| Beauty | \n","5 | \n","324 | \n","
| Computers | \n","2 | \n","147 | \n","
| \n"," | cluster | \n","effectives | \n","
|---|---|---|
| Category | \n","\n"," | \n"," |
| Furniture | \n","1 | \n","115 | \n","
| Baby | \n","4 | \n","159 | \n","
| Watches | \n","3 | \n","133 | \n","
| Decor | \n","0 | \n","234 | \n","
| Kitchen | \n","2 | \n","157 | \n","
| Beauty | \n","6 | \n","132 | \n","
| Computers | \n","5 | \n","120 | \n","
| \n"," | cluster | \n","effectives | \n","
|---|---|---|
| Category | \n","\n"," | \n"," |
| Furniture | \n","1 | \n","165 | \n","
| Baby | \n","3 | \n","124 | \n","
| Watches | \n","4 | \n","148 | \n","
| Decor | \n","6 | \n","183 | \n","
| Kitchen | \n","0 | \n","109 | \n","
| Beauty | \n","5 | \n","153 | \n","
| Computers | \n","2 | \n","168 | \n","
| \n"," | cluster | \n","effectives | \n","
|---|---|---|
| Category | \n","\n"," | \n"," |
| Furniture | \n","2 | \n","139 | \n","
| Baby | \n","3 | \n","148 | \n","
| Watches | \n","0 | \n","145 | \n","
| Decor | \n","4 | \n","159 | \n","
| Kitchen | \n","6 | \n","145 | \n","
| Beauty | \n","1 | \n","154 | \n","
| Computers | \n","5 | \n","160 | \n","
| \n"," | cluster | \n","effectives | \n","
|---|---|---|
| Category | \n","\n"," | \n"," |
| Furniture | \n","4 | \n","19 | \n","
| Baby | \n","6 | \n","120 | \n","
| Watches | \n","0 | \n","109 | \n","
| Decor | \n","5 | \n","320 | \n","
| Kitchen | \n","2 | \n","120 | \n","
| Beauty | \n","1 | \n","203 | \n","
| Computers | \n","3 | \n","159 | \n","
| \n"," | cluster | \n","effectives | \n","
|---|---|---|
| Category | \n","\n"," | \n"," |
| Furniture | \n","4 | \n","163 | \n","
| Baby | \n","0 | \n","153 | \n","
| Watches | \n","2 | \n","149 | \n","
| Decor | \n","5 | \n","124 | \n","
| Kitchen | \n","6 | \n","154 | \n","
| Beauty | \n","3 | \n","154 | \n","
| Computers | \n","1 | \n","153 | \n","
| \n"," | cluster | \n","effectives | \n","
|---|---|---|
| Category | \n","\n"," | \n"," |
| Furniture | \n","6 | \n","11 | \n","
| Baby | \n","1 | \n","1 | \n","
| Watches | \n","5 | \n","140 | \n","
| Decor | \n","4 | \n","63 | \n","
| Kitchen | \n","2 | \n","58 | \n","
| Beauty | \n","0 | \n","713 | \n","
| Computers | \n","3 | \n","64 | \n","
| \n"," | cluster | \n","effectives | \n","
|---|---|---|
| Category | \n","\n"," | \n"," |
| Furniture | \n","2 | \n","50 | \n","
| Baby | \n","3 | \n","80 | \n","
| Watches | \n","1 | \n","190 | \n","
| Decor | \n","5 | \n","337 | \n","
| Kitchen | \n","6 | \n","121 | \n","
| Beauty | \n","0 | \n","198 | \n","
| Computers | \n","4 | \n","74 | \n","
| \n"," | cluster | \n","effectives | \n","
|---|---|---|
| Category | \n","\n"," | \n"," |
| Furniture | \n","6 | \n","76 | \n","
| Baby | \n","1 | \n","264 | \n","
| Watches | \n","5 | \n","81 | \n","
| Decor | \n","3 | \n","195 | \n","
| Kitchen | \n","4 | \n","277 | \n","
| Beauty | \n","0 | \n","101 | \n","
| Computers | \n","2 | \n","56 | \n","
| \n"," | cluster | \n","effectives | \n","
|---|---|---|
| Category | \n","\n"," | \n"," |
| Furniture | \n","6 | \n","119 | \n","
| Baby | \n","1 | \n","125 | \n","
| Watches | \n","0 | \n","120 | \n","
| Decor | \n","4 | \n","208 | \n","
| Kitchen | \n","2 | \n","178 | \n","
| Beauty | \n","5 | \n","115 | \n","
| Computers | \n","3 | \n","185 | \n","
| \n"," | cluster | \n","effectives | \n","
|---|---|---|
| Category | \n","\n"," | \n"," |
| Furniture | \n","3 | \n","160 | \n","
| Baby | \n","5 | \n","155 | \n","
| Watches | \n","1 | \n","148 | \n","
| Decor | \n","0 | \n","195 | \n","
| Kitchen | \n","6 | \n","61 | \n","
| Beauty | \n","4 | \n","190 | \n","
| Computers | \n","2 | \n","141 | \n","
| \n"," | cluster | \n","effectives | \n","
|---|---|---|
| Category | \n","\n"," | \n"," |
| Furniture | \n","4 | \n","157 | \n","
| Baby | \n","0 | \n","180 | \n","
| Watches | \n","2 | \n","104 | \n","
| Decor | \n","3 | \n","165 | \n","
| Kitchen | \n","1 | \n","146 | \n","
| Beauty | \n","5 | \n","126 | \n","
| Computers | \n","6 | \n","172 | \n","
| \n"," | cluster | \n","effectives | \n","
|---|---|---|
| Category | \n","\n"," | \n"," |
| Furniture | \n","5 | \n","168 | \n","
| Baby | \n","0 | \n","177 | \n","
| Watches | \n","6 | \n","48 | \n","
| Decor | \n","4 | \n","164 | \n","
| Kitchen | \n","1 | \n","174 | \n","
| Beauty | \n","2 | \n","94 | \n","
| Computers | \n","3 | \n","225 | \n","
| \n"," | cluster | \n","effectives | \n","
|---|---|---|
| Category | \n","\n"," | \n"," |
| Furniture | \n","2 | \n","140 | \n","
| Baby | \n","4 | \n","168 | \n","
| Watches | \n","5 | \n","169 | \n","
| Decor | \n","0 | \n","181 | \n","
| Kitchen | \n","1 | \n","217 | \n","
| Beauty | \n","3 | \n","168 | \n","
| Computers | \n","6 | \n","7 | \n","
| \n"," | cluster | \n","effectives | \n","
|---|---|---|
| Category | \n","\n"," | \n"," |
| Furniture | \n","2 | \n","83 | \n","
| Baby | \n","5 | \n","165 | \n","
| Watches | \n","0 | \n","245 | \n","
| Decor | \n","1 | \n","220 | \n","
| Kitchen | \n","3 | \n","1 | \n","
| Beauty | \n","4 | \n","261 | \n","
| Computers | \n","6 | \n","75 | \n","
scipy.sparse._csr.csr_matrix
def __init__(arg1, shape=None, dtype=None, copy=False, *, maxprint=None)
Compressed Sparse Row matrix.\n","\n","This can be instantiated in several ways:\n"," csr_matrix(D)\n"," where D is a 2-D ndarray\n","\n"," csr_matrix(S)\n"," with another sparse array or matrix S (equivalent to S.tocsr())\n","\n"," csr_matrix((M, N), [dtype])\n"," to construct an empty matrix with shape (M, N)\n"," dtype is optional, defaulting to dtype='d'.\n","\n"," csr_matrix((data, (row_ind, col_ind)), [shape=(M, N)])\n"," where ``data``, ``row_ind`` and ``col_ind`` satisfy the\n"," relationship ``a[row_ind[k], col_ind[k]] = data[k]``.\n","\n"," csr_matrix((data, indices, indptr), [shape=(M, N)])\n"," is the standard CSR representation where the column indices for\n"," row i are stored in ``indices[indptr[i]:indptr[i+1]]`` and their\n"," corresponding values are stored in ``data[indptr[i]:indptr[i+1]]``.\n"," If the shape parameter is not supplied, the matrix dimensions\n"," are inferred from the index arrays.\n","\n","Attributes\n","----------\n","dtype : dtype\n"," Data type of the matrix\n","shape : 2-tuple\n"," Shape of the matrix\n","ndim : int\n"," Number of dimensions (this is always 2)\n","nnz\n","size\n","data\n"," CSR format data array of the matrix\n","indices\n"," CSR format index array of the matrix\n","indptr\n"," CSR format index pointer array of the matrix\n","has_sorted_indices\n","has_canonical_format\n","T\n","\n","Notes\n","-----\n","\n","Sparse matrices can be used in arithmetic operations: they support\n","addition, subtraction, multiplication, division, and matrix power.\n","\n","Advantages of the CSR format\n"," - efficient arithmetic operations CSR + CSR, CSR * CSR, etc.\n"," - efficient row slicing\n"," - fast matrix vector products\n","\n","Disadvantages of the CSR format\n"," - slow column slicing operations (consider CSC)\n"," - changes to the sparsity structure are expensive (consider LIL or DOK)\n","\n","Canonical Format\n"," - Within each row, indices are sorted by column.\n"," - There are no duplicate entries.\n","\n","Examples\n","--------\n","\n",">>> import numpy as np\n",">>> from scipy.sparse import csr_matrix\n",">>> csr_matrix((3, 4), dtype=np.int8).toarray()\n","array([[0, 0, 0, 0],\n"," [0, 0, 0, 0],\n"," [0, 0, 0, 0]], dtype=int8)\n","\n",">>> row = np.array([0, 0, 1, 2, 2, 2])\n",">>> col = np.array([0, 2, 2, 0, 1, 2])\n",">>> data = np.array([1, 2, 3, 4, 5, 6])\n",">>> csr_matrix((data, (row, col)), shape=(3, 3)).toarray()\n","array([[1, 0, 2],\n"," [0, 0, 3],\n"," [4, 5, 6]])\n","\n",">>> indptr = np.array([0, 2, 3, 6])\n",">>> indices = np.array([0, 2, 2, 0, 1, 2])\n",">>> data = np.array([1, 2, 3, 4, 5, 6])\n",">>> csr_matrix((data, indices, indptr), shape=(3, 3)).toarray()\n","array([[1, 0, 2],\n"," [0, 0, 3],\n"," [4, 5, 6]])\n","\n","Duplicate entries are summed together:\n","\n",">>> row = np.array([0, 1, 2, 0])\n",">>> col = np.array([0, 1, 1, 0])\n",">>> data = np.array([1, 2, 4, 8])\n",">>> csr_matrix((data, (row, col)), shape=(3, 3)).toarray()\n","array([[9, 0, 0],\n"," [0, 2, 0],\n"," [0, 4, 0]])\n","\n","As an example of how to construct a CSR matrix incrementally,\n","the following snippet builds a term-document matrix from texts:\n","\n",">>> docs = [["hello", "world", "hello"], ["goodbye", "cruel", "world"]]\n",">>> indptr = [0]\n",">>> indices = []\n",">>> data = []\n",">>> vocabulary = {}\n",">>> for d in docs:\n","... for term in d:\n","... index = vocabulary.setdefault(term, len(vocabulary))\n","... indices.append(index)\n","... data.append(1)\n","... indptr.append(len(indices))\n","...\n",">>> csr_matrix((data, indices, indptr), dtype=int).toarray()\n","array([[2, 1, 0, 0],\n"," [0, 1, 1, 1]])\n"," \n","
| \n"," | T0 | \n","T1 | \n","T2 | \n","T3 | \n","T4 | \n","T5 | \n","T6 | \n","T7 | \n","T8 | \n","T9 | \n","... | \n","T1007 | \n","T1008 | \n","T1009 | \n","T1010 | \n","T1011 | \n","T1012 | \n","T1013 | \n","T1014 | \n","T1015 | \n","T1016 | \n","
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | \n","0.017925 | \n","0.035772 | \n","0.000000 | \n","0.000000 | \n","0.022300 | \n","0.019393 | \n","0.018604 | \n","0.019261 | \n","0.022502 | \n","0.031912 | \n","... | \n","0.020979 | \n","0.000000 | \n","0.039918 | \n","0.000000 | \n","0.054361 | \n","0.000000 | \n","0.000000 | \n","0.000000 | \n","0.019798 | \n","0.045896 | \n","
| 1 | \n","0.019075 | \n","0.000000 | \n","0.000000 | \n","0.043958 | \n","0.023731 | \n","0.020637 | \n","0.039595 | \n","0.020497 | \n","0.000000 | \n","0.000000 | \n","... | \n","0.000000 | \n","0.016605 | \n","0.000000 | \n","0.000000 | \n","0.038566 | \n","0.024747 | \n","0.000000 | \n","0.000000 | \n","0.000000 | \n","0.024421 | \n","
| 2 | \n","0.032290 | \n","0.032220 | \n","0.000000 | \n","0.018603 | \n","0.020086 | \n","0.017467 | \n","0.000000 | \n","0.000000 | \n","0.000000 | \n","0.014372 | \n","... | \n","0.018896 | \n","0.056218 | \n","0.017977 | \n","0.090095 | \n","0.016321 | \n","0.000000 | \n","0.000000 | \n","0.071908 | \n","0.017832 | \n","0.000000 | \n","
| 3 | \n","0.000000 | \n","0.097522 | \n","0.000000 | \n","0.016087 | \n","0.000000 | \n","0.000000 | \n","0.000000 | \n","0.030005 | \n","0.052582 | \n","0.000000 | \n","... | \n","0.000000 | \n","0.036462 | \n","0.015546 | \n","0.000000 | \n","0.014114 | \n","0.018114 | \n","0.000000 | \n","0.062185 | \n","0.015421 | \n","0.000000 | \n","
| 4 | \n","0.018055 | \n","0.000000 | \n","0.022844 | \n","0.041608 | \n","0.022463 | \n","0.000000 | \n","0.093698 | \n","0.038803 | \n","0.022666 | \n","0.096435 | \n","... | \n","0.021132 | \n","0.000000 | \n","0.000000 | \n","0.020151 | \n","0.000000 | \n","0.023425 | \n","0.015894 | \n","0.000000 | \n","0.019942 | \n","0.000000 | \n","
| ... | \n","... | \n","... | \n","... | \n","... | \n","... | \n","... | \n","... | \n","... | \n","... | \n","... | \n","... | \n","... | \n","... | \n","... | \n","... | \n","... | \n","... | \n","... | \n","... | \n","... | \n","... | \n","
| 1045 | \n","0.100279 | \n","0.000000 | \n","0.000000 | \n","0.019257 | \n","0.000000 | \n","0.000000 | \n","0.000000 | \n","0.000000 | \n","0.000000 | \n","0.014878 | \n","... | \n","0.000000 | \n","0.014549 | \n","0.018610 | \n","0.018653 | \n","0.000000 | \n","0.065049 | \n","0.000000 | \n","0.000000 | \n","0.036918 | \n","0.000000 | \n","
| 1046 | \n","0.051576 | \n","0.034309 | \n","0.000000 | \n","0.019809 | \n","0.042777 | \n","0.055799 | \n","0.035686 | \n","0.018473 | \n","0.000000 | \n","0.061215 | \n","... | \n","0.000000 | \n","0.014966 | \n","0.019143 | \n","0.000000 | \n","0.000000 | \n","0.000000 | \n","0.121068 | \n","0.000000 | \n","0.018988 | \n","0.022010 | \n","
| 1047 | \n","0.152401 | \n","0.016897 | \n","0.000000 | \n","0.019511 | \n","0.000000 | \n","0.000000 | \n","0.017575 | \n","0.018196 | \n","0.000000 | \n","0.045221 | \n","... | \n","0.059458 | \n","0.014741 | \n","0.018855 | \n","0.000000 | \n","0.000000 | \n","0.043938 | \n","0.059624 | \n","0.000000 | \n","0.000000 | \n","0.021679 | \n","
| 1048 | \n","0.034926 | \n","0.052275 | \n","0.022094 | \n","0.060364 | \n","0.043451 | \n","0.018893 | \n","0.018124 | \n","0.000000 | \n","0.000000 | \n","0.031090 | \n","... | \n","0.000000 | \n","0.000000 | \n","0.019444 | \n","0.116939 | \n","0.000000 | \n","0.000000 | \n","0.061488 | \n","0.000000 | \n","0.019287 | \n","0.000000 | \n","
| 1049 | \n","0.140235 | \n","0.000000 | \n","0.000000 | \n","0.000000 | \n","0.000000 | \n","0.000000 | \n","0.000000 | \n","0.000000 | \n","0.000000 | \n","0.015604 | \n","... | \n","0.000000 | \n","0.000000 | \n","0.019519 | \n","0.097821 | \n","0.000000 | \n","0.022742 | \n","0.000000 | \n","0.000000 | \n","0.019361 | \n","0.022442 | \n","
1050 rows × 1017 columns
\n","| \n"," | 458 | \n","
|---|---|
| T0 | \n","0.000000 | \n","
| T1 | \n","0.000000 | \n","
| T2 | \n","0.023769 | \n","
| T3 | \n","0.000000 | \n","
| T4 | \n","0.000000 | \n","
| ... | \n","... | \n","
| T1012 | \n","0.024373 | \n","
| T1013 | \n","0.033074 | \n","
| T1014 | \n","0.041837 | \n","
| T1015 | \n","0.000000 | \n","
| T1016 | \n","0.000000 | \n","
1017 rows × 1 columns
\n","| \n"," | cluster | \n","effectives | \n","
|---|---|---|
| Category | \n","\n"," | \n"," |
| Furniture | \n","6 | \n","177 | \n","
| Baby | \n","4 | \n","155 | \n","
| Watches | \n","0 | \n","165 | \n","
| Decor | \n","2 | \n","89 | \n","
| Kitchen | \n","5 | \n","203 | \n","
| Beauty | \n","1 | \n","150 | \n","
| Computers | \n","3 | \n","111 | \n","
| \n"," | cluster | \n","effectives | \n","
|---|---|---|
| Category | \n","\n"," | \n"," |
| Furniture | \n","0 | \n","83 | \n","
| Baby | \n","6 | \n","21 | \n","
| Watches | \n","2 | \n","239 | \n","
| Decor | \n","3 | \n","225 | \n","
| Kitchen | \n","1 | \n","213 | \n","
| Beauty | \n","5 | \n","174 | \n","
| Computers | \n","4 | \n","95 | \n","
| \n"," | cluster | \n","effectives | \n","
|---|---|---|
| Category | \n","\n"," | \n"," |
| Furniture | \n","4 | \n","250 | \n","
| Baby | \n","1 | \n","148 | \n","
| Watches | \n","6 | \n","167 | \n","
| Decor | \n","2 | \n","158 | \n","
| Kitchen | \n","5 | \n","97 | \n","
| Beauty | \n","0 | \n","214 | \n","
| Computers | \n","3 | \n","16 | \n","
| \n"," | cluster | \n","effectives | \n","
|---|---|---|
| Category | \n","\n"," | \n"," |
| Furniture | \n","5 | \n","175 | \n","
| Baby | \n","1 | \n","150 | \n","
| Watches | \n","4 | \n","170 | \n","
| Decor | \n","0 | \n","114 | \n","
| Kitchen | \n","2 | \n","145 | \n","
| Beauty | \n","6 | \n","174 | \n","
| Computers | \n","3 | \n","122 | \n","
| \n"," | cluster | \n","effectives | \n","
|---|---|---|
| Category | \n","\n"," | \n"," |
| Furniture | \n","0 | \n","83 | \n","
| Baby | \n","6 | \n","21 | \n","
| Watches | \n","2 | \n","239 | \n","
| Decor | \n","3 | \n","225 | \n","
| Kitchen | \n","1 | \n","213 | \n","
| Beauty | \n","5 | \n","174 | \n","
| Computers | \n","4 | \n","95 | \n","
| \n"," | cluster | \n","effectives | \n","
|---|---|---|
| Category | \n","\n"," | \n"," |
| Furniture | \n","4 | \n","157 | \n","
| Baby | \n","3 | \n","133 | \n","
| Watches | \n","0 | \n","159 | \n","
| Decor | \n","5 | \n","133 | \n","
| Kitchen | \n","2 | \n","177 | \n","
| Beauty | \n","1 | \n","146 | \n","
| Computers | \n","6 | \n","145 | \n","
| \n"," | cluster | \n","effectives | \n","
|---|---|---|
| Category | \n","\n"," | \n"," |
| Furniture | \n","5 | \n","124 | \n","
| Baby | \n","3 | \n","147 | \n","
| Watches | \n","0 | \n","144 | \n","
| Decor | \n","4 | \n","163 | \n","
| Kitchen | \n","2 | \n","181 | \n","
| Beauty | \n","6 | \n","133 | \n","
| Computers | \n","1 | \n","158 | \n","
| \n"," | cluster | \n","effectives | \n","
|---|---|---|
| Category | \n","\n"," | \n"," |
| Furniture | \n","0 | \n","136 | \n","
| Baby | \n","6 | \n","154 | \n","
| Watches | \n","1 | \n","147 | \n","
| Decor | \n","3 | \n","159 | \n","
| Kitchen | \n","2 | \n","149 | \n","
| Beauty | \n","4 | \n","145 | \n","
| Computers | \n","5 | \n","160 | \n","
| \n"," | cluster | \n","effectives | \n","
|---|---|---|
| Category | \n","\n"," | \n"," |
| Furniture | \n","4 | \n","163 | \n","
| Baby | \n","3 | \n","138 | \n","
| Watches | \n","1 | \n","167 | \n","
| Decor | \n","0 | \n","188 | \n","
| Kitchen | \n","5 | \n","99 | \n","
| Beauty | \n","6 | \n","168 | \n","
| Computers | \n","2 | \n","127 | \n","
| \n"," | cluster | \n","effectives | \n","
|---|---|---|
| Category | \n","\n"," | \n"," |
| Furniture | \n","0 | \n","151 | \n","
| Baby | \n","3 | \n","162 | \n","
| Watches | \n","6 | \n","154 | \n","
| Decor | \n","5 | \n","113 | \n","
| Kitchen | \n","1 | \n","163 | \n","
| Beauty | \n","4 | \n","155 | \n","
| Computers | \n","2 | \n","152 | \n","
| \n"," | cluster | \n","effectives | \n","
|---|---|---|
| Category | \n","\n"," | \n"," |
| Furniture | \n","2 | \n","73 | \n","
| Baby | \n","5 | \n","49 | \n","
| Watches | \n","0 | \n","309 | \n","
| Decor | \n","4 | \n","242 | \n","
| Kitchen | \n","3 | \n","34 | \n","
| Beauty | \n","1 | \n","270 | \n","
| Computers | \n","6 | \n","73 | \n","
| \n"," | cluster | \n","effectives | \n","
|---|---|---|
| Category | \n","\n"," | \n"," |
| Furniture | \n","2 | \n","111 | \n","
| Baby | \n","0 | \n","103 | \n","
| Watches | \n","3 | \n","202 | \n","
| Decor | \n","5 | \n","208 | \n","
| Kitchen | \n","6 | \n","119 | \n","
| Beauty | \n","1 | \n","223 | \n","
| Computers | \n","4 | \n","84 | \n","
| \n"," | cluster | \n","effectives | \n","
|---|---|---|
| Category | \n","\n"," | \n"," |
| Furniture | \n","5 | \n","85 | \n","
| Baby | \n","6 | \n","99 | \n","
| Watches | \n","0 | \n","245 | \n","
| Decor | \n","1 | \n","150 | \n","
| Kitchen | \n","3 | \n","119 | \n","
| Beauty | \n","2 | \n","263 | \n","
| Computers | \n","4 | \n","89 | \n","
| \n"," | cluster | \n","effectives | \n","
|---|---|---|
| Category | \n","\n"," | \n"," |
| Furniture | \n","4 | \n","176 | \n","
| Baby | \n","0 | \n","199 | \n","
| Watches | \n","3 | \n","134 | \n","
| Decor | \n","5 | \n","135 | \n","
| Kitchen | \n","6 | \n","121 | \n","
| Beauty | \n","2 | \n","105 | \n","
| Computers | \n","1 | \n","180 | \n","
| \n"," | cluster | \n","effectives | \n","
|---|---|---|
| Category | \n","\n"," | \n"," |
| Furniture | \n","6 | \n","139 | \n","
| Baby | \n","5 | \n","126 | \n","
| Watches | \n","0 | \n","169 | \n","
| Decor | \n","1 | \n","142 | \n","
| Kitchen | \n","3 | \n","181 | \n","
| Beauty | \n","4 | \n","139 | \n","
| Computers | \n","2 | \n","154 | \n","
| \n"," | cluster | \n","effectives | \n","
|---|---|---|
| Category | \n","\n"," | \n"," |
| Furniture | \n","4 | \n","105 | \n","
| Baby | \n","1 | \n","133 | \n","
| Watches | \n","5 | \n","181 | \n","
| Decor | \n","2 | \n","167 | \n","
| Kitchen | \n","3 | \n","179 | \n","
| Beauty | \n","6 | \n","141 | \n","
| Computers | \n","0 | \n","144 | \n","
| \n"," | cluster | \n","effectives | \n","
|---|---|---|
| Category | \n","\n"," | \n"," |
| Furniture | \n","0 | \n","188 | \n","
| Baby | \n","2 | \n","240 | \n","
| Watches | \n","1 | \n","128 | \n","
| Decor | \n","3 | \n","218 | \n","
| Kitchen | \n","4 | \n","96 | \n","
| Beauty | \n","6 | \n","123 | \n","
| Computers | \n","5 | \n","57 | \n","
| \n"," | cluster | \n","effectives | \n","
|---|---|---|
| Category | \n","\n"," | \n"," |
| Furniture | \n","6 | \n","151 | \n","
| Baby | \n","2 | \n","124 | \n","
| Watches | \n","1 | \n","154 | \n","
| Decor | \n","4 | \n","131 | \n","
| Kitchen | \n","0 | \n","180 | \n","
| Beauty | \n","3 | \n","165 | \n","
| Computers | \n","5 | \n","145 | \n","
| \n"," | precision | \n","recall | \n","f1_score | \n","ARI | \n","
|---|---|---|---|---|
| title | \n","\n"," | \n"," | \n"," | \n"," |
| BoVW | \n","32.26% | \n","25.90% | \n","16.17% | \n","4.33% | \n","
| BoVW + TFiDF | \n","21.91% | \n","29.90% | \n","25.07% | \n","6.15% | \n","
| BoVW + LatentDirichletAllocation | \n","24.59% | \n","26.57% | \n","20.27% | \n","3.55% | \n","
| BoVW + PCA (2 components, 11.95% explained variance) | \n","11.78% | \n","23.33% | \n","11.97% | \n","4.39% | \n","
| BoVW + TFiDF + PCA (2 components, 8.01% explained variance) | \n","19.94% | \n","27.62% | \n","22.38% | \n","4.71% | \n","
| BoVW + LDA + PCA (2 components, 100.00% explained variance) | \n","24.59% | \n","26.57% | \n","20.28% | \n","3.53% | \n","
| BoVW + T-SNE 2 components | \n","31.75% | \n","31.81% | \n","31.35% | \n","6.68% | \n","
| BoVW + TFiDF + T-SNE 2 components | \n","23.10% | \n","27.24% | \n","24.16% | \n","5.19% | \n","
| BoVW + LDA + T-SNE 2 components | \n","15.71% | \n","26.19% | \n","18.71% | \n","4.04% | \n","
| BoVW + MDS 2 components | \n","19.37% | \n","23.62% | \n","17.67% | \n","2.72% | \n","
| BoVW + TFiDF + MDS 2 components | \n","27.18% | \n","27.33% | \n","27.22% | \n","4.42% | \n","
| BoVW + LDA + MDS 2 components | \n","12.14% | \n","20.00% | \n","10.02% | \n","0.97% | \n","
| BoVW + Spectral 2 components | \n","27.55% | \n","30.48% | \n","26.25% | \n","5.51% | \n","
| BoVW + TFiDF + Spectral 2 components | \n","21.29% | \n","28.10% | \n","23.19% | \n","6.16% | \n","
| BoVW + LDA + Spectral 2 components | \n","18.76% | \n","26.67% | \n","21.54% | \n","4.54% | \n","
| BoVW + UMAP 2 components | \n","20.66% | \n","26.00% | \n","21.00% | \n","4.91% | \n","
| BoVW + TFiDF + UMAP 2 components | \n","25.67% | \n","29.24% | \n","26.44% | \n","6.19% | \n","
| BoVW + LDA + UMAP 2 components | \n","17.71% | \n","22.95% | \n","17.89% | \n","2.23% | \n","
| \n"," | precision | \n","recall | \n","f1_score | \n","ARI | \n","
|---|---|---|---|---|
| title | \n","\n"," | \n"," | \n"," | \n"," |
| BoVW | \n","20.05% | \n","25.62% | \n","21.09% | \n","3.31% | \n","
| BoVW + TFiDF | \n","31.61% | \n","30.48% | \n","30.53% | \n","5.37% | \n","
| BoVW + LatentDirichletAllocation | \n","17.23% | \n","21.90% | \n","17.77% | \n","1.05% | \n","
| BoVW + PCA (2 components, 17.76% explained variance) | \n","18.67% | \n","26.19% | \n","21.59% | \n","3.99% | \n","
| BoVW + TFiDF + PCA (2 components, 15.35% explained variance) | \n","20.24% | \n","28.10% | \n","22.76% | \n","4.84% | \n","
| BoVW + LDA + PCA (2 components, 100.00% explained variance) | \n","17.23% | \n","21.90% | \n","17.77% | \n","1.05% | \n","
| BoVW + T-SNE 2 components | \n","24.60% | \n","28.00% | \n","25.65% | \n","4.59% | \n","
| BoVW + TFiDF + T-SNE 2 components | \n","20.74% | \n","27.33% | \n","22.51% | \n","4.45% | \n","
| BoVW + LDA + T-SNE 2 components | \n","15.96% | \n","22.00% | \n","17.92% | \n","1.09% | \n","
| BoVW + MDS 2 components | \n","19.80% | \n","27.24% | \n","22.58% | \n","4.06% | \n","
| BoVW + TFiDF + MDS 2 components | \n","26.61% | \n","26.76% | \n","26.61% | \n","3.85% | \n","
| BoVW + LDA + MDS 2 components | \n","11.10% | \n","18.67% | \n","12.73% | \n","0.17% | \n","
| BoVW + Spectral 2 components | \n","28.34% | \n","27.52% | \n","26.96% | \n","3.80% | \n","
| BoVW + TFiDF + Spectral 2 components | \n","23.35% | \n","27.14% | \n","24.23% | \n","3.88% | \n","
| BoVW + LDA + Spectral 2 components | \n","15.50% | \n","21.71% | \n","17.61% | \n","1.05% | \n","
| BoVW + UMAP 2 components | \n","24.45% | \n","27.90% | \n","25.38% | \n","4.34% | \n","
| BoVW + TFiDF + UMAP 2 components | \n","25.08% | \n","28.48% | \n","25.91% | \n","4.76% | \n","
| BoVW + LDA + UMAP 2 components | \n","17.14% | \n","19.24% | \n","17.48% | \n","0.35% | \n","