type
status
date
slug
summary
tags
category
icon
password
Calculating Product Similarity Using Weighted Euclidean Distance
Suppose we have two products, Product A and Product B, and each has the following features:
Feature Type | Feature Name | Product A | Product B | Weight (wᵢ) |
Image Feature | Image Vector | 0.5 | 0.7 | 0.4 |
Text Feature | Title Vector | 0.8 | 0.6 | 0.3 |
Categorical | Brand (One-hot) | 1.0 | 0.0 | 0.2 |
Categorical | Color (One-hot) | 1.0 | 1.0 | 0.1 |
✅ Step-by-Step Calculation
We'll use the formula:
1. Image Feature:
2. Title/Text Feature:
3. Brand (One-hot):
4. Color (One-hot):
Final Distance:
Interpretation:
- The smaller the distance, the more similar the products are.
- In this example, the brand difference contributed the most to the distance due to its high weight and binary difference.
- The image and text also influenced similarity moderately.
- Color was identical, so it had no effect on the distance.
- Author:Entropyobserver
- URL:https://tangly1024.com/article/1c6d698f-3512-810f-84be-f889d024dd36
- Copyright:All articles in this blog, except for special statements, adopt BY-NC-SA agreement. Please indicate the source!