Skip to content

Similar Products

To make the most from a Similar Products recommendation, make sure you configure the EvaluationSettings to properly reflect the datakeys that you want to perform similarity comparisons on.

The default setup contains the following datakey significance. It is highly recommended that this be tweaked to include more specific data keys relevant to your particular needs.

json
  DisplayName: 1.0,
  SimilarListPrice: 0.5,
  CommonImmediateParentCategories: 1.0,
  CommonParentsParentCategories: 0.5,
  CommonAncestorCategories: 0.25,
  CommonProductDataKeys: 0.0,
  IdenticalProductDataValues: 1.0,
  SimilarSalesPrice: 0.5,
  SimilarBrand: 0.5

By default, SimilarProducts does not evaluate Variant data. This may be activated on a per-dataset basis. If you believe you have need of this, reach out to us to discuss the possibility of adding variant data evaluation.

Similarity Significance

Similarity is evaluated as a score, based on the type of data and the type of comparison being made. This score is calculated in the engine, and is not exposed to the user or in the My Relewise UI.

Every datakey comparison is then multiplied by the significance score. This allows certain datafields to be marked as more important, by multiplying its base score with a higher value.

  • A significance score of 1.0 will use the score as-is.
  • A significance score of 0.5 will use half the score.
  • A significance score of 2.0 will multiply the score by 2.

Once the scores have been weighted, they are added together, and the product with the highest score is deemed "most similar". The final score of the similarity is not exposed to the user or in the UI.

Datakey Similarity

Beyond the default configuration, the evaluationSettings can be set up to compare any datakey in your dataset. You must specify the name of the datakey as part of SignificantProductDataFields, as well as specify the comparer to be used, and the significance value.

json
  "SignificantProductDataFields": [
    {
      "Key": "datakey",
      "Comparer": "StringSimilarity",
      "Significance": 1.0
    }
  ],

Comparer Types

When specifying your own datakeys for the evaluationSettings, the key can take one of several Comparers:

  • Equals: Data values must be identical. Supported for all data types except ObjectLists.
  • NumericPercentDifference: Data values must be numerically close. Supported for doubles and MultiCurrency data.
  • StringSimilarity: Strings must be similar. Supported for string data.
  • KeyExists: Data key must exist on both products. Supported for all data types.
  • CollectionOverlap: Compares to collections on how many equivalent elements they have. Supported for String Lists and MultiLingual data.

Transformer

For string-based evaluation, such as DisplayName or a Datakey using the StringSimilarity comparer or similar, it is possible to include a Transformer value, which specifies particular words that should not be evaluated as part of the similarity comparison.

For SignificantDataValue evaluations, the Transformer is added with a ValuesToTrim list, as shown below.

A transformer can also be added to the DisplayName, using ProductDisplayNameTransformer.

json
{
  "$type": "Relewise.Client.DataTypes.SignificantDataValue, Relewise.Client",
  "Key": "datakey",
  "Comparer": "StringSimilarity",
  "Significance": 0.0,
  "Transformer": {
    "ValuesToTrim": [
      "the",
      "in",
      "of"
    ]
  }
}

Don't know us? Don't worry - you can find more information about us, by visiting our main page www.relewise.com