{
  "id": 360804,
  "title": "Which Distance vector should we choose ",
  "url": "/competitions/tabular-playground-series-oct-2022/discussion/360804",
  "author_name": "",
  "post_date": "2022-10-18T11:16:04.438008800Z",
  "votes": 13,
  "comment_count": 2,
  "views": 0,
  "content": "<p><a href=\"https://postimg.cc/DJtmyVwF\" target=\"_blank\"><img src=\"https://i.postimg.cc/nrLm2p8s/Screenshot-2022-10-18-165905.png\" alt=\"Screenshot-2022-10-18-165905.png\"></a><br>\n<strong>Euclidean distance</strong>: It basically calculates the distance from a to b and bit easy to calculate. But just think when we have hundreds and thousands of dimensions then what happens? Coz it has to take many numbers from all the dimensions and check the distance. it can look messy and time-consuming.</p>\n<p><a href=\"https://postimg.cc/PNMYQ4K4\" target=\"_blank\"><img src=\"https://i.postimg.cc/Y25RkDWJ/Screenshot-2022-10-18-164702.png\" alt=\"Screenshot-2022-10-18-164702.png\"></a></p>\n<p><strong>Cosine Similarity</strong>: Basically cosine similarity calculates the angle between two values, which is less number than the euclidean distance and better for high dimensions. The difference between similarity and distance is <em>distance invers of similarity</em>.<br>\n<br><br>\n        <code>from sklearn.metrics.pairwise import cosine_similarity</code> </p>",
  "messages": [
    {
      "id": "1993422",
      "postDate": "10/18/2022 11:16:04",
      "content": "<p><a href=\"https://postimg.cc/DJtmyVwF\" target=\"_blank\"><img src=\"https://i.postimg.cc/nrLm2p8s/Screenshot-2022-10-18-165905.png\" alt=\"Screenshot-2022-10-18-165905.png\"></a><br>\n<strong>Euclidean distance</strong>: It basically calculates the distance from a to b and bit easy to calculate. But just think when we have hundreds and thousands of dimensions then what happens? Coz it has to take many numbers from all the dimensions and check the distance. it can look messy and time-consuming.</p>\n<p><a href=\"https://postimg.cc/PNMYQ4K4\" target=\"_blank\"><img src=\"https://i.postimg.cc/Y25RkDWJ/Screenshot-2022-10-18-164702.png\" alt=\"Screenshot-2022-10-18-164702.png\"></a></p>\n<p><strong>Cosine Similarity</strong>: Basically cosine similarity calculates the angle between two values, which is less number than the euclidean distance and better for high dimensions. The difference between similarity and distance is <em>distance invers of similarity</em>.<br>\n<br><br>\n        <code>from sklearn.metrics.pairwise import cosine_similarity</code> </p>",
      "rawMarkdown": "[![Screenshot-2022-10-18-165905.png](https://i.postimg.cc/nrLm2p8s/Screenshot-2022-10-18-165905.png)](https://postimg.cc/DJtmyVwF)\n**Euclidean distance**: It basically calculates the distance from a to b and bit easy to calculate. But just think when we have hundreds and thousands of dimensions then what happens? Coz it has to take many numbers from all the dimensions and check the distance. it can look messy and time-consuming.\n\n[![Screenshot-2022-10-18-164702.png](https://i.postimg.cc/Y25RkDWJ/Screenshot-2022-10-18-164702.png)](https://postimg.cc/PNMYQ4K4)\n\n**Cosine Similarity**: Basically cosine similarity calculates the angle between two values, which is less number than the euclidean distance and better for high dimensions. The difference between similarity and distance is *distance invers of similarity*.\n<br>\n        `from sklearn.metrics.pairwise import cosine_similarity`",
      "votes": null
    },
    {
      "id": "1995019",
      "postDate": "10/19/2022 12:26:02",
      "content": "<p>There are 3 dimensions: x, y and z. The gaming field is a 3-Dimensional space.  The euclidean distance will take the three coordinates as input.</p>\n<p>For cosine similarity, it's computed between two vectos, not two points.  <br>\nSo you need three points to compute it:  <br>\nExample  <br>\nV1: distance from a player to the ball  <br>\nV2: distance from the ball to the goal.  <br>\nThe angle between these two can be a useful feature. </p>",
      "rawMarkdown": "There are 3 dimensions: x, y and z. The gaming field is a 3-Dimensional space.  The euclidean distance will take the three coordinates as input.\n\nFor cosine similarity, it's computed between two vectos, not two points.  \nSo you need three points to compute it:  \nExample  \nV1: distance from a player to the ball  \nV2: distance from the ball to the goal.  \nThe angle between these two can be a useful feature.",
      "votes": null
    },
    {
      "id": "1999186",
      "postDate": "10/22/2022 07:00:19",
      "content": "<p>Euclidean distance calculates distdistances from one another like a to b then b to c then c to a, I think cosine similarity follow also this.</p>",
      "rawMarkdown": "Euclidean distance calculates distdistances from one another like a to b then b to c then c to a, I think cosine similarity follow also this.",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 1995019,
      "author_name": "donatoriccio",
      "author_url": "",
      "post_date": "10/19/2022 12:26:02",
      "content": "<p>There are 3 dimensions: x, y and z. The gaming field is a 3-Dimensional space.  The euclidean distance will take the three coordinates as input.</p>\n<p>For cosine similarity, it's computed between two vectos, not two points.  <br>\nSo you need three points to compute it:  <br>\nExample  <br>\nV1: distance from a player to the ball  <br>\nV2: distance from the ball to the goal.  <br>\nThe angle between these two can be a useful feature. </p>",
      "votes": null,
      "replies": [
        {
          "id": 1999186,
          "author_name": "gazu468",
          "author_url": "",
          "post_date": "10/22/2022 07:00:19",
          "content": "<p>Euclidean distance calculates distdistances from one another like a to b then b to c then c to a, I think cosine similarity follow also this.</p>",
          "votes": null,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "1993422": "[![Screenshot-2022-10-18-165905.png](https://i.postimg.cc/nrLm2p8s/Screenshot-2022-10-18-165905.png)](https://postimg.cc/DJtmyVwF)\n**Euclidean distance**: It basically calculates the distance from a to b and bit easy to calculate. But just think when we have hundreds and thousands of dimensions then what happens? Coz it has to take many numbers from all the dimensions and check the distance. it can look messy and time-consuming.\n\n[![Screenshot-2022-10-18-164702.png](https://i.postimg.cc/Y25RkDWJ/Screenshot-2022-10-18-164702.png)](https://postimg.cc/PNMYQ4K4)\n\n**Cosine Similarity**: Basically cosine similarity calculates the angle between two values, which is less number than the euclidean distance and better for high dimensions. The difference between similarity and distance is *distance invers of similarity*.\n<br>\n        `from sklearn.metrics.pairwise import cosine_similarity`",
    "1995019": "There are 3 dimensions: x, y and z. The gaming field is a 3-Dimensional space.  The euclidean distance will take the three coordinates as input.\n\nFor cosine similarity, it's computed between two vectos, not two points.  \nSo you need three points to compute it:  \nExample  \nV1: distance from a player to the ball  \nV2: distance from the ball to the goal.  \nThe angle between these two can be a useful feature.",
    "1999186": "Euclidean distance calculates distdistances from one another like a to b then b to c then c to a, I think cosine similarity follow also this."
  },
  "source": "meta"
}